hector_slam simulation has impredictable result
Hi everyone !
I am quite new to ROS and I'm trying to simulate hector_slam witout odom (only with laser scan). So I have this launch file:
<?xml version="1.0"?>
<launch>
<arg name="geotiff_map_file_path" default="$(find hector_geotiff)/maps"/>
<param name="/use_sim_time" value="true"/>
<node name="static_tf0" pkg="tf" type="static_transform_publisher" args="1 0 0 0 0 0 /world /map 100"/>
<node pkg="tf" type="static_transform_publisher" name="base_frame_to_laser"
args="0.0 0.0 0.0 0.0 0.0 0.0 /base_footprint /laser 10" />
<!-- hector_mapping part -->
<arg name="tf_map_scanmatch_transform_frame_name" default="scanmatcher_frame"/>
<arg name="base_frame" default="base_footprint"/>
<arg name="odom_frame" default="base_footprint"/>
<arg name="pub_map_odom_transform" default="true"/>
<arg name="scan_subscriber_queue_size" default="5"/>
<arg name="scan_topic" default="scan"/>
<arg name="map_size" default="2048"/>
<node pkg="hector_mapping" type="hector_mapping" name="hector_mapping" output="screen">
<!-- Frame names -->
<param name="map_frame" value="map" />
<param name="base_frame" value="$(arg base_frame)" />
<param name="odom_frame" value="$(arg odom_frame)" />
<!-- Tf use -->
<param name="use_tf_scan_transformation" value="true"/>
<param name="use_tf_pose_start_estimate" value="false"/>
<param name="pub_map_odom_transform" value="$(arg pub_map_odom_transform)"/>
<!-- Map size / start point -->
<param name="map_resolution" value="0.050"/>
<param name="map_size" value="$(arg map_size)"/>
<param name="map_start_x" value="0.5"/>
<param name="map_start_y" value="0.5" />
<param name="map_multi_res_levels" value="2" />
<!-- Map update parameters -->
<param name="update_factor_free" value="0.4"/>
<param name="update_factor_occupied" value="0.9" />
<param name="map_update_distance_thresh" value="0.4"/>
<param name="map_update_angle_thresh" value="0.06" />
<param name="laser_z_min_value" value = "-1.0" />
<param name="laser_z_max_value" value = "1.0" />
<!-- Advertising config -->
<param name="advertise_map_service" value="true"/>
<param name="scan_subscriber_queue_size" value="$(arg scan_subscriber_queue_size)"/>
<param name="scan_topic" value="$(arg scan_topic)"/>
<param name="tf_map_scanmatch_transform_frame_name" value="$(arg tf_map_scanmatch_transform_frame_name)" />
</node>
<include file="$(find hector_geotiff)/launch/geotiff_mapper.launch">
<arg name="trajectory_source_frame_name" value="scanmatcher_frame"/>
<arg name="map_file_path" value="$(arg geotiff_map_file_path)"/>
</include>
<node pkg="rviz" type="rviz" name="rviz"
args="-d $(find hector_slam_launch)/rviz_cfg/mapping_demo.rviz"/>
</launch>
After launching, I replay this bagfile https://github.com/mlab-upenn/f1_10_code_public/tree/master/Week%203 .
First of all, I always get a couple of errors/warning:
[ INFO] [1526551583.253319323, 1458504886.633710874]: lookupTransform base_footprint to laser timed out. Could not transform laser scan into base_frame.
[ WARN] [1526551583.527549687, 1458504886.905373068]: No transform between frames /map and scanmatcher_frame available after 1458504886.905373 seconds of waiting. This warning only prints once.
[ INFO] [1526551583.756732086, 1458504887.136855208]: lookupTransform base_footprint to laser timed out. Could not transform laser scan into base_frame.
[ INFO] [1526551584.527718873, 1458504887.901146949]: Finished waiting for tf, waited 1458504887.901147 seconds
1) Is there anything I should worry about ?
During the replay, the result on rviz can be impredictable: sometimes, the base return to its starting position but sometimes it gets completely lost. 2) Why is that ? Is is related to the errors on tf ?
Finally, I noticed that no tf is broadcasted before I replay my bag file. I am able to see a tf tree only after, which look like this:
3) Why no tf tree is available before playing my bag file ?
Asked by erenaud on 2018-05-17 06:35:02 UTC
Answers
How are you starting the bag file? Make sure you use the --clock option:
rosbag play Lecture3SLAM_Tutorial.bag --clock
Asked by DavidPortugal on 2018-05-22 04:32:52 UTC
Comments
Thanks for replyng. Yes I used this option. I gave up hector and went back to gmapping eventually.
Asked by erenaud on 2018-06-13 08:04:18 UTC
Comments
Your google drive link requires me to sign in, but could I ask you to please attach images to your question instead? If it's a PDF, just make a screenshot.
Asked by gvdhoorn on 2018-05-17 08:08:26 UTC
Sorry I messed up access right on my google drive and I didn't realize I was able to upload images now :)
Asked by erenaud on 2018-05-17 08:37:41 UTC