Robotics StackExchange | Archived questions

Using tf2 to generate a permanent map transform

So I am currently developing a simulation to test various SLAM and planning algorithms for Differential Drive Robots. I have a first occupancy grid node for map generation nearly working, but I am getting a bit confused with the transforms and tf2 package.

I expected that I could declare a frame in the node one time and it to just be constantly saved, but this is not appearing to be the case. In my map_generation package main's node I am declaring a Transform Broadcaster that when it is created broadcasts the transform from the robot to the map once, and no more times after that, although the ones of the wheels and sensors are correctly calculated. I expected that it would stay and be updated automatically every time (I am working in simulation) without me needing to calculate any new transform. Now I expect that I will need to get the reading of the sensor of odometry,etc. and estimate the transformation from the new point to the original point and keep updating it.

This makes me think, how does tf2 actually work? Is it storing the transforms each time there is a broadcast (does not seem to be the case)? What transforms is it able to actually automatize? Some of them clearly are found, as I mentioned before.

P.D. How could I actually include a fixed frame in the gazebo simulation? I thought on creating a link that has 6DoF respect to the robot, but it seems it does not work anymore according to what I have been reading in various forums.

Asked by pablo.arandarod on 2022-07-07 19:02:21 UTC

Comments

Answers

  1. You should use StaticTransformBroadcaster instead of TransfromBroadcaster.
  2. If you are using URDF to create links, add following tag to your model:

    <gazebo reference="joint_name"> <preserveFixedJoint>true</preserveFixedJoint> </gazebo>

Asked by standmit on 2022-07-11 09:13:55 UTC

Comments

With that, I generate a transform that is always at the same reference from the robot, instead of having a reference frame that is static and has a different transformation towards the robot. I think I will use the p3d sensor transform output as the definition of the transform. Once I implement it in a real case I will just use the estimate of the Filter for the pose as the transformation (and maybe find some offline estimation method to improve the accuracy.

Asked by pablo.arandarod on 2022-07-19 16:26:31 UTC