Don't understand remapping
Could someone explain me in details what the remapping is doing? And how it is working?
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
From a really high-level: remapping makes the ROS middleware return a different resource when a graph participant asks for a resource with a certain name.
In other words: if there is a remap from name_a
to name_b
and node_x
asks for name_a
, it will actually be returned whatever is registered with name_b
.
To make it more concrete (with two examples):
node_x
wants to publish to topic chatter
, but there is a remap chatter->other_topic
, then it may advertise a chatter
publisher, but it will actually be publishing to topic other_topic
node_x
subscribes to chatter
, but there is a remap chatter->other_topic
, it will request a subscription to chatter
, but in reality it will subscribe to other_topic
These remaps are completely transparent (ie: invisible) to node_x
, they are processed by the ROS middleware.
The "only requirement" is of course that chatter
and other_topic
are of the same message type. Remapping is not magic, it changes names, not types (that would be message transformation).
The power here is that I can write a node_x
and you can write a node_y
and we can both hardcode the topic names we want to use.
If we used different topic names, but one of our users wants to "connect" our two nodes together, they only have to provide a remapping. Either:
node_x
use the topic name that node_y
expectsnode_y
use the topic name that node_x
expectsnode_x
and node_y
use internallyEdit: you've probably already seen it, but just for completeness: see the Remapping Arguments on the wiki for some more information.
And although it's an article about ROS 2, the Remapping Names article on the ROS2 design website might provide some additional background. It also has a section on ROS 1 remapping.
Asked: 2018-09-18 02:13:34 -0500
Seen: 739 times
Last updated: Oct 17 '18
Valgrind and GDB on same roslaunch File
No drop-down list of Fixed Frame in RViz
Load a urdf/xml file as rosparm from a c++ ros node
Any ready made Swerve drive controller available?
Issue with Rosserial Custom Message
while loop not updating global variable in cpp
How to create subscriber to get USB2 camera images