1、下载SDK功能包
直接访问网址Releases · RoboSense-LiDAR/rslidar_sdk · GitHub 下载最新版本的rslidar_sdk,下载 **rslidar_sdk.tar.gz** 压缩包,不要下载Source code。因为Source code压缩包内不包含子模块rs_driver的代码, 用户还需自行下载rs_driver的代码放入其中才行
下载下来的功能包放入ros工作空间catkin_ws2的src内,目前的最新版本是v1.5.9
2、安装依赖
Yaml (必需)
sudo apt-get update
sudo apt-get install -y libyaml-cpp-dev
libpcap (必需)
sudo apt-get install -y libpcap-dev
ROS
sudo apt-get install ros-melodic-desktop
3、编译功能包
(1) 打开工程内的*CMakeLists.txt*文件,将文件顶部的变量**COMPILE_METHOD**改为**CATKIN**
#=======================================
# Compile setup (ORIGINAL,CATKIN,COLCON)
#=======================================
set(COMPILE_METHOD CATKIN)
(2) 将rslidar_sdk工程目录下的*package_ros1.xml*文件复制到*package.xml*
(3)在工作空间下打开终端,编译功能包
catkin_make
4、配置电脑的静态IP
(1)打开电脑设置--网络--有线连接--IPV4设置为手动,配置电脑系统的静态IP地址为“192.168.1.102”,子网掩码为“255.255.255.0”,网关不需要配置
配置完成后,可以通过ifconfig命令查看静态IP是否生效
(2)设置参数文件,在/home/pc/catkin_ws2/src/rslidar_sdk-v1.5.9/config/config.yaml中设置lidar类型
lidar:
- driver:
lidar_type: RSHELIOS_16P #LiDAR type - RS16, RS32, RSBP, RSBPV4, RSHELIOS, RSHELIOS_16P, RS128, RS80, RS48, RSP128, RSP80, RSP48,
# RSM1, RSM1_JUMBO, RSM2, RSE1
msop_port: 6699 #Msop port of lidar
difop_port: 7788 #Difop port of lidar
start_angle: 0 #Start angle of point cloud
end_angle: 360 #End angle of point cloud
wait_for_difop: true
min_distance: 0.2 #Minimum distance of point cloud
max_distance: 200 #Maximum distance of point cloud
use_lidar_clock: false #True--Use the lidar clock as the message timestamp
#False-- Use the system clock as the timestamp
pcap_path: /home/robosense/lidar.pcap #The path of pcap file
5、启动实时显示
(1)将RS-Helios-16P连接网线到电脑,并且上电,运行,等待电脑识别到lidar设备,如图所示则是连接上了
打开一个终端,输入
roscore
再打开一个新的终端,输入命令
roslaunch rslidar_sdk start.launch
就可以在rviz中显示RS-Helios-16P点云数据
本文章参考官方参考手册:
https://cdn.robosense.cn/20220923161259_62013.pdf
https://github.com/RoboSense-LiDAR/rslidar_sdk/blob/main/README_CN.md
rslidar_sdk/06_how_to_decode_online_lidar_CN.md at main · RoboSense-LiDAR/rslidar_sdk · GitHub