Hector slam with turtlebot in Gazebo
Hello,
I'm trying to properly use Hector slam in simulation using a turtlebot. I'm using ROS hydro and Gazebo 1.9 on ubuntu 12.04. Once I spawned in Gazebo the turtlebot and the world I created, I use this launch file to start hector slam:
<launch>
<param name="/use_sim_time" value="true"/>
<node pkg="rviz" type="rviz" name="rviz"
args="-d $(find hector_slam_launch)/rviz_cfg/mapping_demo.rviz"/>
<include file="$(find hector_mapping)/launch/mapping_default.launch">
<arg name="odom_frame" value="odom"/>
</include>
<arg name="trajectory_source_frame_name" value="scanmatcher_frame"/>
<arg name="trajectory_update_rate" default="4"/>
<arg name="trajectory_publish_rate" default="0.25"/>
<node pkg="hector_trajectory_server" type="hector_trajectory_server" name="hector_trajectory_server" output="screen">
<param name="target_frame_name" type="string" value="map" />
<param name="source_frame_name" type="string" value="$(arg trajectory_source_frame_name)" />
<param name="trajectory_update_rate" type="double" value="$(arg trajectory_update_rate)" />
<param name="trajectory_publish_rate" type="double" value="$(arg trajectory_publish_rate)" />
</node>
<node pkg="hector_geotiff" type="geotiff_node" name="hector_geotiff_node" output="screen" launch-prefix="nice -n 15">
<remap from="map" to="/dynamic_map" />
<param name="map_file_path" type="string" value="$(find hector_geotiff)/maps" />
<param name="map_file_base_name" type="string" value="hector_slam_map" />
<param name="geotiff_save_period" type="double" value="0" />
<param name="draw_background_checkerboard" type="bool" value="true" />
<param name="draw_free_space_grid" type="bool" value="true" />
</node>
</launch>
The slam seems to work when I navigate the robot around, but I'm very surprised by the bad result compared to gmapping. It get lost very easily and the map is very bad. I would like to know if I set up something in the wrong way, or if it depends from the fact that I'm using a fake laser from kinect or maybe that the world in gazebo I created is challenging for hector slam.
EDIT:
If I move the robot only forward/backward the map is correctly reconstructed, but if I make the robot rotate on itself it prints 'SearchDir angle change too large' and it gets totally lost (sometimes it makes position jumps up to 1 meter and more!!).
This is the world I'm using in gazebo:
Many thanks!!