ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
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.
2 | No.2 Revision |
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.