速腾聚创16线激光雷达ros驱动安装与rviz点云展示说明

.速腾聚创16线激光雷达ros驱动安装与rviz点云展示说明

V1.0.0 – by Holden

Date : 2021-10-12

1. 激光雷达硬件连接

1.1 工具准备

  • 准备一套速腾聚创16线激光雷达
  • 本文使用的PC系统是Ubuntu 1804系统,也使用Ubuntu 1604,Ubuntu 20.04;
  • 准备AC 220V电源或DC 12V;

1.2 硬件连接

[1] 如下图所示,将雷达一端的航插头接口与雷达电源盒子的航插头接口两个,对准红点接好;
链接头

[2] 接上电源,接上网线,一端接入到PC,一端接入到电源盒子,如下图;

速腾聚创雷达连接

[3] 设置PC Ubuntu1804静态IP,速腾聚创16线激光雷达出厂默认发送到192.168.1.102,在连接前可以通过wireshark抓包工具进行检测;

!!!正常发送UDP数据流才算正常接入!!!

设置静态IP
wireshark
UDP字节流

2. 激光雷达参数配置

​ 从以上数据流可以看出,雷达的IP是192.168.1.200,PC的静态IP是192.168.1.102,端口分别是6699、7788

如果需要修改这些信息,需要使用速腾聚创16线激光雷达的官方上位机,下载路径:https://www.robosense.ai/resources-27

本文不做解释!!

3. ROS驱动安装&&参数配置

[1] 使用Git下载驱动:https://github.com/RoboSense-LiDAR/rslidar_sdk

git clone https://github.com/RoboSense-LiDAR/rslidar_sdk.git
cd rslidar_sdk
git submodule init
git submodule update

[2] 安装Pcap

sudo apt-get install -y  libpcap-dev

[3] 参数配置,打开config.yaml,安装提示配置;

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
                                                        #4: packet message comes from Protobuf-UDP
                                                        #5: point cloud comes from Protobuf-UDP
  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
  send_packet_proto: false                              #true: Send packets through Protobuf-UDP
  send_point_cloud_proto: false                         #true: Send point cloud through Protobuf-UDP
  pcap_path: /media/holden/JIANQIN2/RS-Bpearl_v2_RoadTest_update-20200312/RS-Bpearl_TunnelTest_Data.pcap                 #The path of pcap file

lidar:
  - driver:
      lidar_type: RS16            #LiDAR type - RS16, RS32, RSBP, RS128, RS80, RSM1, RSHELIOS
      frame_id: /rslidar           #Frame id of message
      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 
      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  
    ros:
      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
    proto:
      point_cloud_recv_port: 60021                     #Port number used for receiving point cloud 
      point_cloud_send_port: 60021                     #Port number which the point cloud will be send to
      msop_recv_port: 60022                            #Port number used for receiving lidar msop packets
      msop_send_port: 60022                            #Port number which the msop packets will be send to 
      difop_recv_port: 60023                           #Port number used for receiving lidar difop packets
      difop_send_port: 60023                           #Port number which the difop packets will be send to 
      point_cloud_send_ip: 127.0.0.1                   #Ip address which the point cloud will be send to 
      packet_send_ip: 127.0.0.1                        #Ip address which the lidar packets will be send to

[4] 驱动直接编译

​ 按照如下指令即可编译运行程序。 直接编译也可以使用ROS相关功能(不包括ROS2),但需要在程序启动前手动启动roscore,启动后手动打开rviz才能看到可视化点云结果。

cd rslidar_sdk
mkdir build && cd build
cmake .. && make -j4
./rslidar_sdk_node

4. rviz点云展示

​ 显示点云如下

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/m0_54792870/article/details/120722490
今日推荐