雷达3D点云数据转2D激光数据

步骤:

1.安装:

  • 安装rslidar驱动,参考:https://www.ncnynl.com/archives/201807/2552.html

  • 编译pointcloud_to_laserscan源码

  • 假设工作空间为rslidar_ws

cd ~/rslidar_ws/src 
git clone https://github.com/ros-perception/pointcloud_to_laserscan
cd ~/rslidar_ws
catkin_make 
source ~/.bashrc #假设你已经把工作空间添加到bashrc文件
  • 新建rslidar.launch
cd ~/rslidar_ws/src/pointcloud_to_laserscan/launch
vim  rslidar.launch
  • 内容如下:
<?xml version="1.0"?>    
<launch>    
    <!-- run pointcloud_to_laserscan node -->
    <node pkg="pointcloud_to_laserscan" type="pointcloud_to_laserscan_node" name="pointcloud_to_laserscan">

        <remap from="cloud_in" to="/rslidar_points"/>
        <remap from="scan" to="/rslidar/scan"/>
        <rosparam>
            # target_frame: rslidar # Leave disabled to output scan in pointcloud frame
            transform_tolerance: 0.01
            min_height: -0.4
            max_height: 1.0

            angle_min: -3.1415926 # -M_PI
            angle_max: 3.1415926 # M_PI
            angle_increment: 0.003 # 0.17degree
            scan_time: 0.1
            range_min: 0.2
            range_max: 100
            use_inf: true
            inf_epsilon: 1.0

            # Concurrency level, affects number of pointclouds queued for processing and number of threads used
            # 0 : Detect number of cores
            # 1 : Single threaded
            # 2->inf : Parallelism level
            concurrency_level: 1
        </rosparam>
    </node>
</launch>
  • 参数说明:
min_height 、max_height #这两个参数用来指定这段z轴高度范围内的输入点云将参与转换,范围外的不参与
angle_min、angle_max #这两个参数用来指定这段yaw角度范围内的输入点云将参与转换,范围外的不参与
angle_increment #输出的2d雷达数据的角分辨率,即相邻扫描点的角度增量
scan_time #扫描时间,即话题的发布周期
range_min、range_max #这两个参数用来指定输出数据的有效距离,即2d雷达的有效测量范围

2.测试:

  • 新开终端,启动雷达
roslaunch rslidar_pointcloud rs_lidar_16.launch
  • 打开rviz,显示3D点云图

  • 如图:
    请输入图片描述

  • 新开终端,启动转换

roslaunch pointcloud_to_laserscan rslidar.launch
  • 在rviz中勾掉pointcloud2
  • 增加话题,/rslida/scan
  • 如图:
    请输入图片描述
  • 6
    点赞
  • 33
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值