当前位置:   article > 正文

robosense16 点云信息转2D雷达信息 pointcloud_to_laserscan包的配置和测试_robosense 2d

robosense 2d

本人的小目标是使用这个robosense16多线雷达+turtlebot+进行熟悉的2d建图+amcl定位+movebase导航。所以没有深究有关3d雷达数据的建图。

通过查阅资料发现,其实这个多线雷达可以通过已有的代码包,进行3d转2d的操作,可以直接把它当成一个更强大一点的2d雷达来用。

所以本文讲解如何通过robosense16多线雷达进行建图的操作。通过hector算法。

将多条扫描线合成一条2d雷达扫描线。使用pointcloud_to_laserscan包可以很方便地实现第二种办法,第二种方法因为使用了多条扫描线,因此可以输出更高质量的2d雷达数据。

下面先安装pointcloud_to_laserscan包

  • 下载其源码包
  1. cd ~/catkin_ws/src
  2. git clone https://github.com/ros-perception/pointcloud_to_laserscan.git
  3. cd ~/catkin_ws
  4. catkin_make
  • 创建launch文件(注意:这里的文件名最好不要改动,因为在其他的比如turbot_slam包中,其实有文件会和下面创建的launch文件挂钩,直接默认调用这样一个文件,而且还是官方的包。所以这里直接cv大法就好,尽量不要根据自己的喜好修改launch文件的位置和名字)
  1. cd ~/catkin_ws/src/pointcloud_to_laserscan/launch
  2. gedit point_to_scan.launch

在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. <rosparam>
  7. # target_frame: rslidar # Leave disabled to output scan in pointcloud frame
  8. transform_tolerance: 0.01
  9. min_height: -0.4
  10. max_height: 1.0
  11. angle_min: -3.1415926 # -M_PI
  12. angle_max: 3.1415926 # M_PI
  13. angle_increment: 0.003 # 0.17degree
  14. scan_time: 0.1
  15. range_min: 0.2
  16. range_max: 100
  17. use_inf: true
  18. inf_epsilon: 1.0
  19. # Concurrency level, affects number of pointclouds queued for processing and number of threads used
  20. # 0 : Detect number of cores
  21. # 1 : Single threaded
  22. # 2->inf : Parallelism level
  23. concurrency_level: 1
  24. </rosparam>
  25. </node>
  26. </launch>

根据网上资料的说法,这里进行了一次remap将默认的订阅点云信息的话题转向rslidar节点发布的话题。

  • 测试3d转2d信息是否正常发布
  1. roslaunch rslidar_pointcloud rs_lidar_16.launch
  2. roslaunch pointcloud_to_laserscan point_to_scan.launch

rs_lidar_16会默认打开一个rviz,但是里面缺少2d雷达的订阅。相信大家都会自己打开吧。

总结一下,同样的,这里下载的3d转2d的包和上一篇文章所说的rslidar_ros包相同,所以可以放在同一个工作空间内,不会产生冲突的,大家放心~

贴一个新的rviz的截图。不过这里我稍微改了一下点云话题和scan话题的颜色,让他们的对比稍微明显一点,途中白色的就是点云信息了,红色的是转化以后的2d scan信息。如果仔细观察,会发现这样转化出来的scan会浓一点,心里感觉上会比较稳,哈哈哈。

345

贴一张工作空间的截图。444444

里面的pointcloud_to_laserscan就是新安装的包了。

再贴一个rviz的图给大家参考一下

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/981189
推荐阅读
相关标签
  

闽ICP备14008679号