What is the correct way to connect two tf trees?
I have a setup in which two separate tf trees are published, and I'd like to define one with regard to the other, but not from the base link/root node.
For instance two trees one with a tf_prefix, one without such that you might see:
/baseLink
/link0
/linkA0
/linkB0
and
/ghost/baseLink
/ghost/link0
/ghost/linkA0
/ghost/linkB0
And I want to define /ghost/linkB0
as having an identity transformation from /linkB0
.
However, since tf is set up with child and parent relationships as a tree and not as a free network, the correct way to do this is unclear.
The only way I can think to do it would be to rebuild the KDL::Tree that the sub-ordinate tree's RobotStatePublisher uses to originate at the desired link, but this would be non-trivial, and not offer a way to easily select a different link at will without doing the same thing for each desired combination.
Is there a better way to do this? Is it even possible given the current architecture?