Hector_slam transform issues
Hello Everybody,
I have been working at this for sometime now and i have run out of ideas. I don't know if maybe I'm just not understanding something correctly or what. Here is what I am trying to do: I have an XV-11 neato lidar that I am trying to use to build a map using hector_slam. The issue is i receive the following message every time i run hector_slam:
No transform between frames /map and /base_link available after 20.002274 seconds of waiting. This warning only prints once.
I have followed the tutorial here and have it setup exactly as the tutorial says. My tf frames look exactly like this.
My hector_mapping mapping_default.launch
<?xml version="1.0"?>
<launch>
<arg name="tf_map_scanmatch_transform_frame_name" default="/scanmatcher_frame"/>
<arg name="base_frame" default="base_link"/>
<arg name="odom_frame" default="base_link"/>
<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="pub_map_odom_transform" value="$(arg pub_map_odom_transform)"/>
<param name="map_frame" value="map" />
<param name="base_frame" value="$(arg base_frame)" />
<param name="odom_frame" value="$(arg base_frame)" />
<!-- Tf use -->
<param name="use_tf_scan_transformation" value="true"/>
<param name="use_tf_pose_start_estimate" value="false"/>
<!-- 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_pub_period" value="1.0" />
<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.7" />
<param name="map_update_distance_thresh" value="0.2"/>
<param name="map_update_angle_thresh" value="0.9" />
<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)"/>
<!-- Debug parameters -->
<!--
<param name="output_timing" value="false"/>
<param name="pub_drawings" value="true"/>
<param name="pub_debug_output" value="true"/>
-->
<param name="tf_map_scanmatch_transform_frame_name" value="$(arg tf_map_scanmatch_transform_frame_name)" />
</node>
</launch>
My neato.launch file in hector_slam_launch
<?xml version="1.0"?>
<launch>
<!-- Starts the laser scan node capture thingy -->
<node pkg="tf" type="static_transform_publisher" name="odom_to_base_frame" args="0.0 0.0 0.0 0 0 0.0 /odom /base_link 10"/>
<node pkg="tf" type="static_transform_publisher" name="base_frame_laser" args="0 0 0 0 0 0 /base_link /laser 10"/>
<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"/>
<!-- <node pkg="rviz" type="rviz" name="rviz" args="-d rviz_cfg.rviz"/> -->
<include file="$(find hector_geotiff)/launch/geotiff_mapper.launch"/>
</launch>
Any help would be greatly appreciated!
When I used that same tutorial with the neato I got the same message while building maps. But the maps came out just fine. Are you sure the map isn't being built? That message alone isn't enough to convince me.
I think the 3rd arg in the default hector launch file <arg name="odom_frame" default="base_link"/> may be an issue involved in the failure to get the TF but I never followed it up because the mapping works fine with that message being displayed
It does start mapping and everything runs, however, the location of the lidar jumps around and doesn't match the scans properly. The reason I think it is a transform error is because when I look at the laser scan in rviz, with map as the fixed frame, it is all over the place...
But when the fixed frame is laser the scan looks perfect. So I know it's not a hardware issue. And all I can think of is the transform between the map and laser isn't working properly so hector-slam doesn't really know what to do.
To get it work for me I had to limit the rotation speed. It is very sensitive to rotation so try it at 10% your current max rotation speed and see if that fixes it. It is also sensitive to linear speed, but not nearly as much.
You are a life saver. I had it set to the lowest speed 200 rpms but as i increased the speed it actually worked a lot better so at max speed, 300 rpms, it is actually creating a map and i can move it pretty vigorously in x,y,z and it keeps the map. Thank you for your help!!