ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

When should I remap topic and parameter names?

asked 2011-11-07 11:44:36 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

  • When launching nodes?
  • Parameters in namespaces?

Please help in writing up a ROS best practice.

edit retag flag offensive close merge delete



@Thomas answered the topic remapping question. I suggest creating a separate question for parameters.

joq gravatar image joq  ( 2012-07-07 04:43:44 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2012-07-07 04:18:26 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

You should remap arguments when:

  • a name clash occurs (you launch twice the same node for instance)
  • you must connect the topic "out" of node A (the publisher) to the topic "in" of node B (the subscriber). The communication model requires you in that case that both A and B communicates via the same topic. A topic is fully defined by its name, as long as the resolved topic name is the same on both nodes and given that both nodes are communicating with the same roscore, the nodes will be able to communicate with each other.

Another point of view is the component writer point of view, he should not try to build himself complex topic names inside the node he develops so that it matches the topic names of some other nodes. Very simple names (which are likely to create a name clash) are better as they will be renamed anyway... This is something I understood long after beginning using ROS :) It makes the whole ROS interface of a node much easier to understand.

There is however some limitations to this approach. For instance tf supports only tf_prefix as a way to avoid name clashes. This is why, on the opposite, you see a large portion of tf enabled nodes having a parameter to set the tf frame name "manually".

edit flag offensive delete link more


Question Tools

1 follower


Asked: 2011-11-07 11:44:36 -0500

Seen: 2,435 times

Last updated: Jul 07 '12