ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Unfortunately keeping two copies of the sate is not something which the system was designed for.
I have two work arounds, a selective relay or inverting one of the transforms.
I'll start with inverting one of the transforms. To allow multiple odometry frames for a while we would publish the the odom frame as a child instead of a parent, such that it would not conflict with the "odom_combined" frame. To do this you could either modify gmapping or amcl to publish with a different frame_id as a child instead of as a parent. This will provide both frames in a running system but with different names.
If you want to be able to swap them while running I believe what you will need is a selective relay. It will need to listen to the caller_id and forward all messages from /tf to /other_tf except those originating from the localization node on /other_tf. And have a node which is passing back the localization information on /other_tf and pass it back on /tf. You can then turn on and off the pass back capability. To do this you will need a version of relay which relays all messages execept for ones with a specific caller id. And a 2nd one which only forwards a specific caller_id. If you end up doing this I'd suggest providing patches to topic_tools relay/mux which add these as parameters if possible. I'm sure others would find it useful too.