ROS2-humble驱动RoboSense16线激光雷达

  1. 连接激光雷达电源线和接口
  2. 驱动安装
    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

  3. 修改配置文件并编译

 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

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值