0
$\begingroup$

Rosanswers logo

I have not found a clear answer to this, and reading code on Github has merely confused things further.

What is the standard naming convention for tf_trees that relate to a namespace for a robot? Reading into the UR robot package they pass down a "prefix" that is added to the tf tree names, but it adds it as ${prefix}base_link.

Is the convention to send either 1 or 2, and is it expected that you should add the "_" or "/" manually for the prefix value.

  1. robot_1/ for "robot_1/base_link/
  2. robot_1_ "robot_1_base_link"

It make sense to be "robot_1/" as it aligns a bit better with the namespace convention of "/" but I understand tf trees are meant to be treated separately.


Originally posted by hwil292 on ROS Answers with karma: 64 on 2021-08-02

Post score: 0


Original comments

Comment by gvdhoorn on 2021-08-03:
Is your question whether / or _ should be used, or something else? I'm not sure I understand the reference to the ur_description approach of using ${prefix}.

Comment by hwil292 on 2021-08-03:
That is exactly what I am asking

Reference to using ${prefix} within the UR arm urdf file - <link name="${prefix}base_link"/> as an example. Given this it implies I have to append prefix with either "/" or "_" manually.

https://github.com/fmauch/universal_robot/blob/calibration_devel/ur_description/urdf/inc/ur_macro.xacro

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.