[Documentation] [TitleIndex] [WordIndex

Rules:

Coordinate frames in ROS are identified by a string frame_id in the format /[tf_prefix/]frame_name This string has to be unique in the system. All data produced can simply identify it's frame_id to state where it is in the world. All frame_ids sent over the system should be fully resolved using the tf_prefix policy outlined below.

tf_prefix

To support multiple "similar" robots tf uses a tf_prefix parameter. Without a tf_prefix parameter the frame name "base_link" will resolve to frame_id "/base_link".

If the tf_prefix parameter is set to "a_tf_prefix" "base_link" will resolve to "/a_tf_prefix/base_link". This is most useful when running two similar robots which otherwise would have name collisions in their frame_ids.

tf_prefix is determined by doing a searchParam, if it is not found a single '/' is prepended to the frame_name.

tf_prefix for data sources

All sources of data should apply the tf_prefix resolution to their frame_id before publishing.

tf_prefix for data processors

All nodes using frame_ids should use fully resolved frame_ids, resolving the tf_prefix from the parameter.

The only exception is nodes which are explicitly designed to work between multiple robots. In which case they should know all fully resolved frame_ids.

Multi Robot Support

tf_prefix is designed for operating multiple similar robots in the same environment. The tf_prefix parameter allows two robots to have base_link frames, for they will become /robot1/base_link and /robot2/base_link if all nodes for robot1 are run in robot1 as their tf_prefix parameter. And likewise for robot2. This means that a node running with parameter tf_prefix="robot1" can lookup "base_link" which will resolve to /robot1/base_link, but if it wants to know where robot2 is it can lookup /robot2/base_link explicitly.

Rules of thumb when developing multi robot safe software


2024-11-23 14:39