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

Nodelets and intraprocess communication

asked 2012-05-24 00:42:38 -0500

Ted gravatar image

updated 2012-05-24 05:48:37 -0500

joq gravatar image

Hi there! ;)

I'm working on a communication between two Nodelets by making use of the intraprocess communication with shared pointers as mentioned here.

I got three questions and hope you can help:

  1. Is it possible to use the shared pointer kind communication with services/requests, too? How?

  2. If you send out a message as shared pointer you must take care of that the sender doesn't write to this message again after sending it out. If there are a lot of subscribers, who is responsible for freeing the used memory if the message isn't used any longer AND how can the sender check if this is the case?

  3. Regarding to this the Nodelets don't have to care about there callbacks to be called as Nodes do. It is simply neccessary to subscribe for the messages at a (MT)NodeHandle and there is NO NEED to call ros::spin_once() or ros::spin() in an self created thread. Is that correct?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
5

answered 2012-05-24 05:51:46 -0500

joq gravatar image
  1. I don't know. Maybe. You could try sending the request as a boost::shared_ptr. I don't see how the reply would work, though.

  2. The boost::shared_ptr does that automatically, using a reference count which is decremented when the pointer deconstructor runs.

  3. Yes. The nodelet manager handles the spin logic.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-05-24 00:42:38 -0500

Seen: 1,567 times

Last updated: May 24 '12