Closed delihus closed 8 months ago
You can already do this remapping:
ros2 run robot_state_publisher robot_state_publisher --ros-args -r /tf_static:=/foo/tf_static -p robot_description:='<robot name="foo"><link name="link1"/></robot>'
So I don't think we need to take this. But I'll leave it open for a little while longer to get more comments.
I'll give a concrete example as to why it would be very nice to have this system over using tf_prefixes: I have an avatar robot and an operator robot. I publish their respective tf trees on separate tf topics /avatar/tf and /operator/tf for clarity and to make debugging with rviz easier by reducing the total number of frames within the tree. Within one node, I want to have two transform listeners, one for /avatar/tf and one for /operator/tf so that I can see how the operator transforms have changed and then apply that change to the avatar's transforms so that the avatar replicates the operator's motion. Currently this is impossible, instead I have to use prefixes for each published tf and my listener subscribes to /tf. While this allows my avatar to replicate operator movement, it's undesirable as my tf-tree is flooded with frames making it harder to see what's going on on each side.
Thank you for the explanation. Solving my issue I used cli_args
in rclpy.
Node(
name,
namespace=namespace,
cli_args=["--ros-args", "-r", "/tf:=tf", "-r", "/tf_static:=tf_static"],
)
Related with https://github.com/ros2/geometry2/issues/433 and https://github.com/ros2/geometry2/issues/389 It gives the compatibility with nav2 (https://github.com/ros-planning/navigation2/blob/main/nav2_bringup/launch/navigation_launch.py#L60) architecture which gives every tf topic for every robot e. g.: robot1:
/robot1/tf
robot2:/robot2/tf
Added test passes: