rs_driver为速腾聚创雷达驱动内核。支持RS-LiDAR-16, RS-LiDAR-32, RS-Bpearl, RS-128和RS-80的点云数据解析,方便用户二次开发使用。
- Boost
- pthread
- pcap
Boost 与 pthread 均为系统库,可直接链接使用。
Pcap则需使用以下指令安装:
sudo apt-get install -y libpcap-dev
首先安装驱动
cd rs_driver
mkdir build && cd build
cmake .. && make -j4
sudo make install
使用时,需要在CMakeLists文件中链接雷达驱动
find_package(rs_driver REQUIRED)
include_directories(${rs_driver_INCLUDE_DIRS})
target_link_libraries(project ${rs_driver_LIBRARIES})
直接将rs_driver放入用户工程内,在CMakeLists中链接即可
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/rs_driver/cmake)
include(rs_driver)
include_directories(${rs_driver_INCLUDE_DIRS})
target_link_libraries(project ${rs_driver_LIBRARIES})
rs_driver提供了两个示例程序,存放于rs_driver/demo中:
- demo_online.cpp
- demo_pcap.cpp
若希望编译这两个示例程序,需要将CMakeLists文件内的COMPILE_DEMOS设置为TRUE(默认为FALSE)。
#=============================
# Compile Demos (TRUE/FALSE)
#=============================
set(COMPILE_DEMOS TRUE)
用户可参考示例程序,编写自己的代码调用雷达驱动。
rs_driver is the driver code for RoboSense LiDAR, include RS-LiDAR-16, RS-LiDAR-32, RS-Bpearl , RS-128 and RS-80 . It can be used to extract packets from lidar to point cloud, and it is convenient for users to do advanced development.
- Boost
- pthread
- pcap
Boost and pthread are libraries of system, that can be linked directly.
Pcap need to be installed as follow:
sudo apt-get install -y libpcap-dev
Install the driver.
cd rs_driver
mkdir build && cd build
cmake .. && make -j4
sudo make install
Then find the driver package and link it in the project CMakeLists.
find_package(rs_driver REQUIRED)
include_directories(${rs_driver_INCLUDE_DIRS})
target_link_libraries(project ${rs_driver_LIBRARIES})
Put the rs_driver in the project and link it in the CMakeLists.
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/rs_driver/cmake)
include(rs_driver)
include_directories(${rs_driver_INCLUDE_DIRS})
target_link_libraries(project ${rs_driver_LIBRARIES})
rs_driver supply two demo programs which are stored inrs_driver/demo:
- demo_online.cpp
- demo_pcap.cpp
User need to set the COMPILE_DEMOS in CMakeLists to TRUE to compile these two programs( the default value is FALSE).
#=============================
# Compile Demos (TRUE/FALSE)
#=============================
set(COMPILE_DEMOS TRUE)
User can refer to the demo code to use rs_driver api.