- 连接激光雷达电源线和接口
- 驱动安装
mkdir laser_ws && cd laser_ws/ mkdir src && cd src/ git clone https://github.com/RoboSense-LiDAR/rslidar_msg.git git clone https://github.com/RoboSense-LiDAR/rslidar_sdk.git cd rslidar_sdk git submodule init git submodule update sudo apt-get update sudo apt-get install -y libyaml-cpp-dev sudo apt-get install -y libpcap-dev
注:此篇没有提及工业相机驱动usb_cam
-
修改配置文件并编译
CMakeLists.txt之上,将变量COMPILE_METHOD设置为COLCON
set(COMPILE_METHOD COLCON)
package_ros2.xml重命名为package.xml,将其他的package.xml删掉
回到laser_ws目录,分别编译这两个包,注意顺序
colcon build --packages-select rslidar_msg
colcon build --packages-select rslidar_sdk
4.网络设置
Address:192.168.1.102
Netmask:255.255.255.0
DNS:223.5.5.5
查询ip地址
ifconfig
测试是否正常,ping + inet地址
ping 192.168.1.102
5.编辑配置文件并测试
common:
msg_source: 1 #0: not use Lidar
#1: packet message comes from online Lidar
#2: packet message comes from ROS or ROS2
#3: packet message comes from Pcap file
send_packet_ros: true #true: Send packets through ROS or ROS2(Used to record packet)
send_point_cloud_ros: true #true: Send point cloud through ROS or ROS2
lidar:
- driver:
lidar_type: RSHELIOS_16P #LiDAR type - RS16, RS32, RSBP, RSHELIOS, RSHELIOS_16P, RS128, RS80, RS48, RSP128, RSP80, RSP48,
# RSM1, RSM1_JUMBO, RSM2, RSM3, RSE1, RSMX.
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
ros:
ros_frame_id: rslidar #Frame id of packet message and point cloud message
ros_recv_packet_topic: /rslidar_packets #Topic used to receive lidar packets from ROS
ros_send_packet_topic: /rslidar_packets #Topic used to send lidar packets through ROS
ros_send_point_cloud_topic: /rslidar_points #Topic used to send point cloud through ROS
6.回到laser_ws目录,编译并测试
cd laser_ws/
colcon build
source install/setup.bash
ros2 launch rslidar_sdk start.py
标签:RoboSense16,point,humble,packet,lidar,rslidar,ROS2,ros,cloud From: https://blog.csdn.net/2301_77667918/article/details/145139933