0
$\begingroup$

Rosanswers logo

I need to create an application that subscribes to messages from topic A and publishes to topic B based on the message received from A. While waiting for messages from A, it should publish default messages on B in the meantime. So in short, the publishing action to B should work independent of whether messages are received on A or not..

Is using the nodelets a good idea for this application? If so, how do I make two nodelets that share the same variables so that B process the variables received from A?


Originally posted by devmax on ROS Answers with karma: 13 on 2012-09-22

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Unless you need to transfer a lot of data from one node to another there is basically no need to use nodelets.

The process you described is naturally organized by callback function specified as a parameter to subscribe method. By means of state variable in that callback you can modify published data in the main loop.


Originally posted by Boris with karma: 3060 on 2012-09-23

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

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