赞
踩
本人的小目标是使用这个robosense16多线雷达+turtlebot+进行熟悉的2d建图+amcl定位+movebase导航。所以没有深究有关3d雷达数据的建图。
通过查阅资料发现,其实这个多线雷达可以通过已有的代码包,进行3d转2d的操作,可以直接把它当成一个更强大一点的2d雷达来用。
所以本文讲解如何通过robosense16多线雷达进行建图的操作。通过hector算法。
将多条扫描线合成一条2d雷达扫描线。使用pointcloud_to_laserscan包可以很方便地实现第二种办法,第二种方法因为使用了多条扫描线,因此可以输出更高质量的2d雷达数据。
下面先安装pointcloud_to_laserscan包
- cd ~/catkin_ws/src
- git clone https://github.com/ros-perception/pointcloud_to_laserscan.git
- cd ~/catkin_ws
- catkin_make
- cd ~/catkin_ws/src/pointcloud_to_laserscan/launch
- gedit point_to_scan.launch
在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"/>
-
- <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>

根据网上资料的说法,这里进行了一次remap将默认的订阅点云信息的话题转向rslidar节点发布的话题。
- roslaunch rslidar_pointcloud rs_lidar_16.launch
- roslaunch pointcloud_to_laserscan point_to_scan.launch
rs_lidar_16会默认打开一个rviz,但是里面缺少2d雷达的订阅。相信大家都会自己打开吧。
总结一下,同样的,这里下载的3d转2d的包和上一篇文章所说的rslidar_ros包相同,所以可以放在同一个工作空间内,不会产生冲突的,大家放心~
贴一个新的rviz的截图。不过这里我稍微改了一下点云话题和scan话题的颜色,让他们的对比稍微明显一点,途中白色的就是点云信息了,红色的是转化以后的2d scan信息。如果仔细观察,会发现这样转化出来的scan会浓一点,心里感觉上会比较稳,哈哈哈。
贴一张工作空间的截图。
里面的pointcloud_to_laserscan就是新安装的包了。
再贴一个rviz的图给大家参考一下
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。