Removing/Deleting/Ignoring odom tf data
I've built a custom diff drive robot in gazebo. Everything works great. However, the real version of the simulated robot doesn't have odometry. I get around this by using laser_scan_matcher to simulate odometry, and this also works great.
However, I have issues with the diff drive plugin in gazebo. It pubishes a tf odom frame (gazebo_odom is what I call it), and I can't seem to get rid of it! I try to rename it, but it still has the tf tree connection (gazebo_odom -> base_footprint). If this connection exists, my laser_scan_matcher odom tf frame does't show up when I visualize the tf tree. If I delete the diff drive plugin, my tf tree is built correctly (laser_scan_odom -> base_footprint).
When I run amcl subscribing to my laser_scan_odom tf frame (gazebo_odom ->base_footprint still exists), it localizes correctly, and creates a map -> laser_scan_odom connection in a separate tf tree. Unsure how to connect these trees. A static_transform didn't quite work because the laser_scan_odom tf and gazebo_odom would be connected to base_footprint and conflict with each other. Localization then breaks.
So two questions, one about ROS in general and one about my problem.
In ROS, does the first tf frame created (in this case gazebo_odom), take priority over all other similar tf frames? In other words, why does my laser_scan_odom not appear when gazebo_odom exists, but DOES appear when I remove the gazebo plugin?
How can you get rid of a tf frame? Or completely replace one?
Possible bad or potentially impossible solutions:
Subscribe to the tf tree, erase the tf frame you don't want, and republish?
Re-write the diff drive controller. This seems overkill for making it just not publish a odom tf frame.