ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Coordinate transforms and reference frames of a mobile robot

asked 2018-07-10 21:12:53 -0600

TheMilkman gravatar image

I'm developing a vehicle that's fitted with a GPS, IMU and a lidar that will be able to make a map and localise itself in it. To do so various coordinate transforms need to take place, for instance a fixed 'map' frame where the map would be created, a body fixed frame (base_link) for the chassis of the vehicle and then various transforms from the body fixed frame for the IMU/GPS/Lidar to assist in the building of the point cloud map.

My question is, what tf or tf2 tool would I use where?

Are static transforms used for rigid links? For example the IMU/lidar to the base_link (vehicle) etc.

Are the broadcaster/listener combinations used for transforms that vary? For example from the map (world) frame to the base_link.

Thanks for any help, just getting alittle lost with the terminology.

edit retag flag offensive close merge delete



Have you seen the URDF tutorials, especially the Create your own URDF file and the ...

jayess gravatar image jayess  ( 2018-07-11 00:50:20 -0600 )edit
jayess gravatar image jayess  ( 2018-07-11 00:50:34 -0600 )edit

From what I've read it seemed like the URDF approach was more aligned with manipulator arms and visualizing them etc. Whereas our system should be quite straightforward in that regard

TheMilkman gravatar image TheMilkman  ( 2018-07-11 20:43:40 -0600 )edit

I would also suggest looking into URDF and xacro's for the model/TFs of your robot description. I guess you can technically describe your robots TFs with static transforms, but I see no real advantage to this approach in the long run.

Reamees gravatar image Reamees  ( 2018-07-17 04:37:06 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-07-11 02:50:09 -0600

pavel92 gravatar image

updated 2018-07-11 02:53:43 -0600

Yes, you can use static transforms for rigid links(chassis to sensors, chassis to sensor mounts then sensor mounts to senors etc..) and the broadcaster/listener combinations for the other transforms(like map/odom to base_link, map to odom...). This can be done with tf (I have used only tf for my mobile robot) but you can also use tf2 if you prefer. I have not looked into tf2 much but according to the description it should provide more efficiently the same feature set of tf as well as adding a few new features.

If you are interested more in the changes made between tf and tf2 you can read this.

edit flag offensive delete link more


Thanks for confirming my head was in roughly the right space. At the moment I've got the gps worling in NED for the world to base_link and it seems to be working really well. Though I'm having trouble using my IMU data to change the orientation of my rigid links (base_link), any pointers?

TheMilkman gravatar image TheMilkman  ( 2018-07-12 04:25:48 -0600 )edit

Ideally it would be something like this, where the orientation of the imu is translated through base_link from imu_link (static) altering base_links orientation.


br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "world", "imu_link"));

*q is imu quarterion

TheMilkman gravatar image TheMilkman  ( 2018-07-12 05:37:16 -0600 )edit

but this doesn't work like it does in my head. Thanks for you help!

TheMilkman gravatar image TheMilkman  ( 2018-07-12 05:38:45 -0600 )edit

Not sure if it will help but you can look into this method lookupTransform from tf and use to get the right transform between two frames.

pavel92 gravatar image pavel92  ( 2018-07-12 05:59:19 -0600 )edit

Question Tools

1 follower


Asked: 2018-07-10 21:12:53 -0600

Seen: 586 times

Last updated: Jul 11 '18