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.