# How to solve tf problem for hector slam

Hi,

I am using hokuyo UTM-30lx to do mapping using hector slam and i am facing a problem when running the hector slam. It shows the following message below:

[INFO][1389574162.6000311161]: lookupTransform base_stabilized to laser timed out. Could not transform laser scan into base_frame.


"Trajectory Server: Transform from /map to /base_link failed: Frame id /map does not exist! Frames (4): Frame /base_link exists with parent /base_stabilized. Frame /base_stabilized exists with parent NO_PARENT. Frame /laser exists with parent /base_link."

rostopic:
/diagnostics
/hokuyo/parameter_descriptions
/imu
/initialpose
/map
/pose2D
/poseupdate
/rosout
/rosout_agg
/scan
/slam_cloud
/slam_out_pose
/syscommand
/tf
/tf/tfMessage
/trajectory


edited: laser scan cannot be seen if fixed frame is set to base_stabilized in rviz can be seen if fixed frame is set to base_link. target frame: laser

<launch>
<node name="hokuyo" pkg="hokuyo_node" type="hokuyo_node" respawn="false" output="screen">

<param name="calibrate_time" type="bool" value="true"/>

<!-- Set the port to connect to here -->
<param name="port" type="string" value="/dev/ttyACM0"/>

<param name="intensity" type="bool" value="false"/>
<param name="min_ang" value="-2.356194437"/>
<param name="max_ang" value="2.35619443"/>
<param name="cluster" value="1"/>
</node>

#### publish an example base_link -> laser transform ###########

args="0.0 0.0 0.0 0.0 0.0 0.0 /base_link /laser 40" />
<node pkg="hector_imu_attitude_to_tf" type="imu_attitude_to_tf_node" name="imu_attitude_to_tf_node" output="screen">
<remap from="imu_topic" to="thumper_imu" />
<param name="base_stabilized_frame" type="string" value="base_stabilized" />
</node>

<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_stabilized" />
<param name="odom_frame" value="base_stabilized" />
<param name="output_timing" value="false"/>
<param name="use_tf_scan_transformation" value="true"/>
<param name="use_tf_pose_start_estimate" value="false"/>
<param name="scan_topic" value="scan"/>
<!-- Map size / start point -->
<param name="map_resolution" value="0.025"/>
<param name="map_size" value="2048"/>
<param name="map_start_x" value="0.5"/>
<param name="map_start_y" value="0.5" />
<param name="map_update_distance_thresh" value="0.1" />
<param name="map_update_angle_tresh" value="0.3" />
<param name="laser_z_min_value" value="-1.0" />
<param name="laser_z_max_value" value="1.5" />
<!-- 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.06" />
<param name="pub_map_odom_transform" value="true"/>
<!--
<param name="pub_drawings" value="true"/>
<param name="pub_debug_output" value="true"/>
-->
</node>
<param name="hector_mapping/pub_map_odom_transform" value="true"/>
<include file="\$(find hector_geotiff)/launch/geotiff_mapper.launch" />

</launch>


How do i solve this problem? Thanks in advance

edit retag close merge delete

Sort by » oldest newest most voted

If this is happening only once or twice shortly after startup, this should not be a problem (and I´ll have to look into suppressing the message, as a few people got confused by this already, for example here). If the problem persists and you don´t get a map out of the system, your tf setup most likely is not correct. It seems you try to use the "/thumper_imu" topic to publish the roll and pitch angle of the robot to tf (a setup that I used on one of our robots some time ago). Is that intended? If not, you should have a look at the hector_slam setup tutorial and the links there to see how a proper tf setup can be done.

more

Hi, i am not sure what does the "<remap from="imu_topic" to="thumper_imu">" does but whether i include it or not the problem still persist. I understand that the tf relation as (map->odom->base_footprint->base_stabilized->base_link->laser). For my case i am using hector slam for quadrotor which does not have any odometry thus i presume that the tf relation is (map->base_stabilized->base_link->laser).

( 2014-01-07 13:22:31 -0500 )edit

You have to have some way of providing the roll/pitch angles of your platform via tf. I did that in the example launch file by publishing IMU data on the "thumper_imu" topic. This probably is not published on your system.

( 2014-01-08 04:29:43 -0500 )edit

For the imu data, i am using the imu_attitude_to_tf_node. The problem i have is that i my imu data does not contain linear_acceleration_covariance and angular_velocity_covariance as my imu provides the euler angle x,y,z. What i did is i convert it to quaternion in order for me to use the imu_attitude_to_tf_node. So the imu data is a "customized" imu data but i had no idea what do i need to do for the angular_velocity_covariance and linear_acceleration_covariance so i basically set the first index of the two arrays to -1. Could that be the source of the problem?

( 2014-01-08 13:40:19 -0500 )edit

No the imu_attitude_to_tf just uses the quaternion and publishes roll/pitch to tf, see code: http://docs.ros.org/hydro/api/hector_imu_attitude_to_tf/html/imu__attitude__to__tf__node_8cpp_source.html

( 2014-01-08 21:27:39 -0500 )edit

I did manage to get the imu_attitude_to_tf_node working and it successfully publish the base_stabilized. Since i am using hector mapping for odom and mapping itself, according to the setup the base_frame and odom_frame will be base_stabilized right? if it is correct i have no idea why hector mapping itself is not running correctly.

( 2014-01-09 15:29:23 -0500 )edit

Yes, that should be correct. Can you update the original post with more information on what is not working?

( 2014-01-09 19:55:18 -0500 )edit

From tf viewframe it shows "base_stabilized->base_link->laser" It seems that the problem lies between the transform from map to base_stabilized.

( 2014-01-14 13:14:32 -0500 )edit

So you are still getting the original error message posted in the original question, or something else?

( 2014-01-14 20:42:04 -0500 )edit