Skip to content

Commit

Permalink
[update]修复上次提交发现的bug,更新新型号支持相关文档,增加子项目CMake配置文件方便开发者引用(版本号v3.3.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
mingdonghu committed Mar 11, 2023
1 parent be0c240 commit 6148cd3
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 6 deletions.
47 changes: 47 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# sub project
message(STATUS "operation system is ${CMAKE_SYSTEM}")

if(CMAKE_SYSTEM_NAME MATCHES "Linux")
message(STATUS "current platform: Linux ")

set(LDLIDAR_DRIVER_SOURCE_LINUX
${CMAKE_CURRENT_SOURCE_DIR}/src/ldlidar_driver.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/ldlidar_driver_linux.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/ldlidar_dataprocess.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/ldlidar_protocol.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/log_module.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/network_socket_interface_linux.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/serial_interface_linux.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/sl_transform.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/slbf.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/tofbf.cpp
)

add_library(ldlidar_driver STATIC
${LDLIDAR_DRIVER_SOURCE_LINUX}
)

elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
message(STATUS "current platform: Windows")

set(LDLIDAR_DRIVER_SOURCE_WIN
${CMAKE_CURRENT_SOURCE_DIR}/src/ldlidar_driver.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/ldlidar_driver_win.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/ldlidar_dataprocess.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/ldlidar_protocol.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/log_module.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/serial_interface_win.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/sl_transform.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/slbf.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/tofbf.cpp
)

add_library(ldlidar_driver STATIC
${LDLIDAR_DRIVER_SOURCE_WIN}
)

else()
message(STATUS "other platform: ${CMAKE_SYSTEM_NAME}")
endif (CMAKE_SYSTEM_NAME MATCHES "Linux")


1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This SDK is only applicable to the LiDAR products sold by Shenzhen LDROBOT Co.,
| LDROBOT LiDAR LD06 | 2D DTOF |
| LDROBOT LiDAR LD19 | 2D DTOF |
| LDROBOT LiDAR LD14 | 2D Triangle|
| LDROBOT LiDAR LD14P | 2D Triangle|

---
## Get SDK
Expand Down
2 changes: 1 addition & 1 deletion include/ldlidar_driver/ldlidar_datatype.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <vector>
#include <string>

#define LDLiDAR_SDK_VERSION_NUMBER "3.3.0"
#define LDLiDAR_SDK_VERSION_NUMBER "3.3.1"

#define ANGLE_TO_RADIAN(angle) ((angle)*3141.59 / 180000)

Expand Down
2 changes: 1 addition & 1 deletion sample/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ include_directories(
set(LDLIDAR_DRIVER_SOURCE_LINUX
${CMAKE_CURRENT_SOURCE_DIR}/../../src/ldlidar_driver.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../src/ldlidar_driver_linux.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../src/lipkg.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../src/ldlidar_dataprocess.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../src/ldlidar_protocol.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../src/log_module.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../src/network_socket_interface_linux.cpp
Expand Down
2 changes: 2 additions & 0 deletions sample/linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ $ ./build/ldlidar <lidar_typename> <serial_number>
# example:
# LDLiDAR LD14
$ ./build/ldlidar LD14 /dev/ttyUSB0
# LDLiDAR LD14P
$ ./build/ldlidar LD14P /dev/ttyUSB0
# LDLiDAR LD06
$ ./build/ldlidar LD06 /dev/ttyUSB0
# LDLiDAR LD19
Expand Down
2 changes: 2 additions & 0 deletions sample/linux/README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ $ ./build/ldlidar <lidar_typename> <serial_number>
# example:
# LDLiDAR LD14
$ ./build/ldlidar LD14 /dev/ttyUSB0
# LDLiDAR LD14P
$ ./build/ldlidar LD14P /dev/ttyUSB0
# LDLiDAR LD06
$ ./build/ldlidar LD06 /dev/ttyUSB0
# LDLiDAR LD19
Expand Down
4 changes: 3 additions & 1 deletion sample/linux/demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ struct LdsInfoStruct {
uint32_t baudrate;
};

LdsInfoStruct LdsInfoArrary[3] = {
LdsInfoStruct LdsInfoArrary[4] = {
{"LD14", ldlidar::LDType::LD_14, 115200},
{"LD14P", ldlidar::LDType::LD_14P, 230400},
{"LD06", ldlidar::LDType::LD_06, 230400},
{"LD19", ldlidar::LDType::LD_19, 230400},
};
Expand Down Expand Up @@ -75,6 +76,7 @@ int main(int argc, char **argv) {
LOG_INFO("please input: ./ldlidar <lidar type> <serial number>","");
LOG_INFO("example:","");
LOG_INFO("./ldlidar LD14 /dev/ttyUSB0","");
LOG_INFO("./ldlidar LD14P /dev/ttyUSB0","");
LOG_INFO("./ldlidar LD06 /dev/ttyUSB0","");
LOG_INFO("./ldlidar LD19 /dev/ttyUSB0","");
exit(EXIT_FAILURE);
Expand Down
5 changes: 3 additions & 2 deletions sample/windows/windemo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ int main(int argc, char** argv) {
uint32_t baudrate;
};

const int inf_array_size = 3;
const int inf_array_size = 4;
lidar_inf_struct inf_array[inf_array_size] = {
{0, "LDLiDAR LD06", ldlidar::LDType::LD_06, 230400},
{1, "LDLiDAR LD14", ldlidar::LDType::LD_14, 115200},
{2, "LDLiDAR LD19", ldlidar::LDType::LD_19, 230400}};
{2, "LDLiDAR LD14P", ldlidar::LDType::LD_14P, 230400},
{3, "LDLiDAR LD19", ldlidar::LDType::LD_19, 230400}};

printf("The SDK support ldlidar product:\n");
for (auto inf_base : inf_array) {
Expand Down
4 changes: 3 additions & 1 deletion test/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ struct LdsInfoStruct {
uint32_t baudrate;
};

LdsInfoStruct LdsInfoArrary[3] = {
LdsInfoStruct LdsInfoArrary[4] = {
{"LD14", ldlidar::LDType::LD_14, 115200},
{"LD14P", ldlidar::LDType::LD_14P, 230400},
{"LD06", ldlidar::LDType::LD_06, 230400},
{"LD19", ldlidar::LDType::LD_19, 230400},
};
Expand Down Expand Up @@ -99,6 +100,7 @@ int test(int argc, char **argv) {
LOG_INFO("please input: ./test_node <lidar type> <serial number>","");
LOG_INFO("example:","");
LOG_INFO("./test_node LD14 /dev/ttyUSB0","");
LOG_INFO("./test_node LD14P /dev/ttyUSB0","");
LOG_INFO("./test_node LD06 /dev/ttyUSB0","");
LOG_INFO("./test_node LD19 /dev/ttyUSB0","");
exit(EXIT_FAILURE);
Expand Down

0 comments on commit 6148cd3

Please sign in to comment.