Skip to content

Commit

Permalink
修改SCL角度二级解析公式
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanyiaini committed Nov 28, 2023
1 parent 518b7a6 commit 5c9ced1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ project(ydlidar_sdk C CXX)
# version
set(YDLIDAR_SDK_VERSION_MAJOR 1)
set(YDLIDAR_SDK_VERSION_MINOR 1)
set(YDLIDAR_SDK_VERSION_PATCH 20)
set(YDLIDAR_SDK_VERSION_PATCH 21)
set(YDLIDAR_SDK_VERSION ${YDLIDAR_SDK_VERSION_MAJOR}.${YDLIDAR_SDK_VERSION_MINOR}.${YDLIDAR_SDK_VERSION_PATCH})

##########################################################
Expand Down
2 changes: 1 addition & 1 deletion samples/sdm_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ int main(int argc, char *argv[])
f_optvalue = 0.025f;
laser.setlidaropt(LidarPropMinRange, &f_optvalue, sizeof(float));
/// unit: Hz
float frequency = 100.0;
float frequency = 250.0;
laser.setlidaropt(LidarPropScanFrequency, &frequency, sizeof(float));

// 雷达初始化
Expand Down
8 changes: 6 additions & 2 deletions samples/tri_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ int main(int argc, char *argv[])
laser.setlidaropt(LidarPropDeviceType, &optval, sizeof(int));
/// sample rate
optval = isSingleChannel ? 3 : 4;
optval = 5;
laser.setlidaropt(LidarPropSampleRate, &optval, sizeof(int));
/// abnormal count
optval = 4;
Expand All @@ -227,21 +228,24 @@ int main(int argc, char *argv[])

//////////////////////bool property/////////////////
/// fixed angle resolution
bool b_optvalue = true;
bool b_optvalue = false;
laser.setlidaropt(LidarPropFixedResolution, &b_optvalue, sizeof(bool));
/// rotate 180
b_optvalue = false;
laser.setlidaropt(LidarPropReversion, &b_optvalue, sizeof(bool));
/// Counterclockwise
b_optvalue = false;
laser.setlidaropt(LidarPropInverted, &b_optvalue, sizeof(bool));
b_optvalue = true;
laser.setlidaropt(LidarPropAutoReconnect, &b_optvalue, sizeof(bool));
/// one-way communication
b_optvalue = false;
laser.setlidaropt(LidarPropSingleChannel, &isSingleChannel, sizeof(bool));
/// intensity
b_optvalue = false;
laser.setlidaropt(LidarPropIntenstiy, &b_optvalue, sizeof(bool));
/// Motor DTR
b_optvalue = false;
b_optvalue = true;
laser.setlidaropt(LidarPropSupportMotorDtrCtrl, &b_optvalue, sizeof(bool));
/// HeartBeat
b_optvalue = false;
Expand Down
5 changes: 3 additions & 2 deletions src/YDlidarDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1294,8 +1294,9 @@ void YDlidarDriver::parseNodeFromeBuffer(node_info *node)
else if (isSCLLidar(m_LidarType) ||
isSCLLidar2(model))
{
//SCL雷达角度二级解析公式(α = asind(17.8/dist))
correctAngle = int32_t(asin(17.8 / node->dist) * 180.0 / M_PI * 64.0);
//SCL雷达角度二级解析公式
//correctAngle = int32_t(asin(17.8 / node->dist) * 180.0 / M_PI * 64.0);
correctAngle = int32_t(atan(17.8 / (node->dist / 4.0)) * 180.0 / M_PI * 64.0);
// printf("SCL correct angle [%d]\n", correctAngle);
}
else if (isTriangleLidar(m_LidarType) &&
Expand Down

0 comments on commit 5c9ced1

Please sign in to comment.