I'm new to ROS, and I'm trying to apply the process given in the "[How to build a Map Using Logged Data](http://wiki.ros.org/hector_slam/Tutorials/MappingUsingLoggedData)" (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](https://code.google.com/archive/p/tu-darmstadt-ros-pkg/downloads) 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](http://wiki.ros.org/hector_slam/Tutorials/SettingUpForYourRobot), 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](https://github.com/bogaotory/misc/blob/master/frames_tutorial.pdf).
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](http://wiki.ros.org/message_to_tf) with the following launch file:
But all I get is the transform between `base_stabilized` and `base_link` as given [here](https://github.com/bogaotory/misc/blob/master/frames.pdf)
I must be missing something here, please can anyone help me with this?
Many Thanks
↧