当前位置:   article > 正文

雷达3D点云数据转2D激光数据_rslidar 三维点云转换为二维激光雷达

rslidar 三维点云转换为二维激光雷达

步骤:

1.安装:

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

  • 编译pointcloud_to_laserscan源码

  • 假设工作空间为rslidar_ws

  1. cd ~/rslidar_ws/src
  2. git clone https://github.com/ros-perception/pointcloud_to_laserscan
  3. cd ~/rslidar_ws
  4. catkin_make
  5. source ~/.bashrc #假设你已经把工作空间添加到bashrc文件
  • 新建rslidar.launch
  1. cd ~/rslidar_ws/src/pointcloud_to_laserscan/launch
  2. vim rslidar.launch
  • 内容如下:
  1. <?xml version="1.0"?>
  2. <launch>
  3. <!-- run pointcloud_to_laserscan node -->
  4. <node pkg="pointcloud_to_laserscan" type="pointcloud_to_laserscan_node" name="pointcloud_to_laserscan">
  5. <remap from="cloud_in" to="/rslidar_points"/>
  6. <remap from="scan" to="/rslidar/scan"/>
  7. <rosparam>
  8. # target_frame: rslidar # Leave disabled to output scan in pointcloud frame
  9. transform_tolerance: 0.01
  10. min_height: -0.4
  11. max_height: 1.0
  12. angle_min: -3.1415926 # -M_PI
  13. angle_max: 3.1415926 # M_PI
  14. angle_increment: 0.003 # 0.17degree
  15. scan_time: 0.1
  16. range_min: 0.2
  17. range_max: 100
  18. use_inf: true
  19. inf_epsilon: 1.0
  20. # Concurrency level, affects number of pointclouds queued for processing and number of threads used
  21. # 0 : Detect number of cores
  22. # 1 : Single threaded
  23. # 2->inf : Parallelism level
  24. concurrency_level: 1
  25. </rosparam>
  26. </node>
  27. </launch>
  • 参数说明:
  1. min_height 、max_height #这两个参数用来指定这段z轴高度范围内的输入点云将参与转换,范围外的不参与
  2. angle_min、angle_max #这两个参数用来指定这段yaw角度范围内的输入点云将参与转换,范围外的不参与
  3. angle_increment #输出的2d雷达数据的角分辨率,即相邻扫描点的角度增量
  4. scan_time #扫描时间,即话题的发布周期
  5. 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
  • 如图:
    请输入图片描述
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/96215
推荐阅读
相关标签
  

闽ICP备14008679号