0
$\begingroup$

Rosanswers logo

  • When launching nodes?
  • Parameters in namespaces?

Please help in writing up a ROS best practice.


Originally posted by mmwise on ROS Answers with karma: 8372 on 2011-11-07

Post score: 7


Original comments

Comment by joq on 2012-07-07:
@Thomas answered the topic remapping question. I suggest creating a separate question for parameters.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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".


Originally posted by Thomas with karma: 4478 on 2012-07-07

This answer was ACCEPTED on the original site

Post score: 8


Original comments

Comment by jbohren on 2013-07-02:
Added here: http://www.ros.org/wiki/ROS/Patterns/Communication#When_Topics_Should_be_Remapped

$\endgroup$

Your Answer

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