how to build /tf topic frame tree for hector_slam or gmapping

asked 2017-07-09 12:11:25 -0500

Bo gravatar image

I'm new to ROS, and I'm trying to apply the process given in the "How to build a Map Using Logged Data" (of hector_slam, but gmapping's requirement is similar) tutorial to a dataset of my own.

With some experiments (filter all topics leaving only two: /scan [sensor_msgs/LaserScan] and /tf [tf/tfMessage] in the bag) with the test bag given here in the tutorial, I know that hector_slam only requires two topics (/scan and /tf) to function correctly, at least in the case of the tutorial.

I have the /scan topic in my dataset, but not /tf. So my question is: How to build the /tf topic required by hector_slam/hector_mapping or gmapping?

After a bit of reading, and according to this illustration (below) provided on hector_slam's documentation here, I think what I need is to calculate the transformation between map, odom, base_footprint, base_link, base_stabilized and laser_link frames and record/play them through the /tf topic.

Furthermore, by executing the rosrun tf view_frames command, I get that the structure of these 'frames' in the /tf topic should look like this.

Without being an expert in ROS, I'm not quite sure how to do this. I tried to generate the transforms based on imu [sensor_msgs/Imu] data in my dataset, using the message_to_tf package here with the following launch file:

<launch>
  <param name="/use_sim_time" value="true"/>

  <node pkg="message_to_tf" type="message_to_tf" name="message_to_tf_node" output="screen">

    <param name="imu_topic" type="string" value="/imu/data" />
    <param name="frame_id" type="string" value="map" />
    <param name="footprint_frame_id" type="string" value="base_footprint" />

    <param name="stabilized_frame_id" type="string" value="base_stabilized" />

    <param name="publish_pose_topic" type="string"  value="tf_pose" />
    <param name="publish_euler_topic" type="string"  value="tf_euler" />
  </node>

</launch>

But all I get is the transform between base_stabilized and base_link as given here

I must be missing something here, please can anyone help me with this?

Many Thanks

edit retag flag offensive close merge delete

Comments

Hey, did you manage to figure out a way to do this? If so, please let me know.

Hemanth gravatar image Hemanth  ( 2019-02-17 23:43:04 -0500 )edit