ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Multiple nodelets?

asked 2012-09-22 22:13:27 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-09-23 01:24:58 -0500

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-09-22 22:13:27 -0500

Seen: 481 times

Last updated: Sep 23 '12