Namespace substitution in tf2 frame names
Description
Similar to the substitution in ROS 2 topic names, I would like to replace the ~ with the namespace in frame names. This would make multi-robot configuration much easier, without needing to change existing nodes or require support from the node maintainer for namespaces.
Motivation
When running multi-robot systems with many different namespaces, we currently have host-specific config files that override the frame parameters for each node and replace them with the properly namespaced ones. This would all be gone. Instead, it would just be a "~/odom" in the general config to get the odom frame of a robot.
Design / Implementation Considerations
When doing a tf2_lookup / transform etc..., it would check for a ~ as the first character and substitute it with the namespace.
Additional Information
I didn't know about the name substitution in topic names until I looked at the source code, and now the only missing part is the TF frame names.
I would be more than happy to implement it myself, but ideally, you guys could give me a hint in the right direction as to where to implement it, so that all components use it.
https://discourse.ros.org/t/proposal-namespace-shorthand-support-in-ros-2-parameter-values/43295
I believe the best way to do it is to make feature parity between topic names and frame IDs.
Therefore reimplementing the ros topic and service substitution