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

Revision history [back]

This is simple (assuming there is no other publisher to this topic).

Subscribed topics get handled in callbacks, so if you publishe the first message in node 1 (e.g. from the main loop, make sure to only send it once), node 2 receives it and it is handled in the callback. In this callback, adapt what you want and publish it again, so that node 1 can receive it. There, do the same thing in the callback.

How to write publishers and subscribers is documented in detail on the wiki for C++ and Python.

This is simple (assuming there is no other publisher to this topic).topic and you do take care of timing).

Subscribed topics get handled in callbacks, so if you publishe the first message in node 1 (e.g. from the main loop, make sure to only send it once), node 2 receives it and it is handled in the callback. In this callback, adapt what you want and publish it again, so that node 1 can receive it. There, do the same thing in the callback.

How to write publishers and subscribers is documented in detail on the wiki for C++ and Python.