I'm not aware of any standard convention for Transform Frame names. The frame names are simple strings, with no concept of hierarchy. You can use "/" character if you like, but it will have no special meaning. It is best to avoid using a "/" as the first character, as internally the ros code strips it off for historical reasons.
Use whatever convention you think looks best.
Note: that there is a parameter named tf_prefix
, but it is deprecated. Do not assume this feature works at all.
Originally posted by Mike Scheutzow with karma: 4903 on 2021-08-03
This answer was ACCEPTED on the original site
Post score: 0
Original comments
Comment by gvdhoorn on 2021-08-03:\
Use whatever convention you think looks best.
If this is the question the OP wanted to ask, I'd actually suggest to use /
. TF2 doesn't care at all, but humans will. Parsing frames with embedded /
is much easier than with _
, if only for the fact that _
is already used as a replacement for whitespace.
Comment by hwil292 on 2021-08-03:
This is exactly what the question was. I know it sounds basic, but I really could not find a standard and since I have two answers with alternate suggestions I am happy I didn't just miss something obvious.
I am leaning towards "/" as it makes it easier to align with namespaces from a readability standpoint as well.
@mike I saw tf_prefix is deprecated generally but within the urdfs people still rely on a "prefix" or "tf_prefix" parameter to set the frame ID of a robot when launching multiple robots (or in my case two UR5s on the same robot). Because the namespace doesn't auto-magically align with frame-ids you still need some way to set a frame-id for a topic pushed to another namespace.
As an example here (https://github.com/fmauch/universal_robot/blob/calibration_devel/ur_description/urdf/inc/ur_macro.xacro) takes in the prefix parameter and sets the tf tree with it. Given it just does ${prefix}base_link - it appears you need to add the "_" or "/", or whatever, manually.
Comment by gvdhoorn on 2021-08-04:
To clarify: ${prefix}
is not related to tf_prefix
(the parameter to robot_state_publisher
) at all.
It's likely many setups will assign the same value to them, but that's essentially a "coincidence". There's no direct relationship or coupling (in the code fi).
Comment by hwil292 on 2021-08-04:
ahh yup, confusing but I see that.
I have gone with "/" just because it makes more sense in my mind, but easy enough to swap within the launch files etc.
Thanks all