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

Multiple nodelets?

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

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
2

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

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

Question Tools

Stats

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

Seen: 632 times

Last updated: Sep 23 '12