使用 rplidar测试hector_mapping

rplidar包安装

安装并编译

cd ~/catkin_ws/src
git clone https://github.com/robopeak/rplidar_ros.git
cd ~/catkin_ws
catkin_make --pkg rplidar_ros

hector_mapping包安装

安装方式如下:

sudo apt-get install ros-indigo-hector-slam 

测试

在rplidar_ros/launch/目录下添加hector_mapping_demo.launch文件,内容如下:

<launch>

<node pkg="hector_mapping" type="hector_mapping" name="hector_mapping" output="screen">

<param name="pub_map_odom_transform" value="true"/>
<param name="map_frame" value="map" />
<param name="base_frame" value="base_link" />
<param name="odom_frame" value="base_link" />


<param name="use_tf_scan_transformation" value="true"/>
<param name="use_tf_pose_start_estimate" value="false"/>


<param name="map_resolution" value="0.05"/>
<param name="map_size" value="2048"/>
<param name="map_start_x" value="0.5"/>
<param name="map_start_y" value="0.5" />
<param name="laser_z_min_value" value = "-1.0" />
<param name="laser_z_max_value" value = "1.0" />
<param name="map_multi_res_levels" value="2" />

<param name="map_pub_period" value="2" />
<param name="laser_min_dist" value="0.4" />
<param name="laser_max_dist" value="5.5" />
<param name="output_timing" value="false" />
<param name="pub_map_scanmatch_transform" value="true" />



<param name="update_factor_free" value="0.4"/>
<param name="update_factor_occupied" value="0.7" />    
<param name="map_update_distance_thresh" value="0.2"/>
<param name="map_update_angle_thresh" value="0.06" />

 
<param name="advertise_map_service" value="true"/>
<param name="scan_subscriber_queue_size" value="5"/>
<param name="scan_topic" value="scan"/>
node>

<node pkg="tf" type="static_transform_publisher" name="base_to_laser_broadcaster" args="0 0 0 0 0 0 /base_link /laser 100"/>

  <node pkg="rviz" type="rviz" name="rviz"
    args="-d $(find hector_slam_launch)/rviz_cfg/mapping_demo.rviz"/>

launch>

然后运行下面两个launch,命令如下:

roslaunch rplidar_ros hector_mapping_demo.launch
roslaunch rplidar_ros rplidar.launch

存在的问题:

问题1:

经常出现“SearchDir angle change too large”报错。
原因:
rplidar出现剧烈移动或抖动,又或者周边环境在发生大的变化。

更多详细的信息,请看EAI官方网站www.eaibot.com。或者关注EAI官方微信公众号:EAI。也可以添加微信,由本人拉您进群一起探讨ros,slam相关技术问题。
本人的微信二维码是:
欢迎添加本人微信讨论

你可能感兴趣的:(ROS杂谈,SLAM杂谈,hector,rplidar,ros,slam)