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

Message (ConstPtr) forwarding in ROS

asked 2013-06-14 09:22:48 -0500

Javier J. Salmerón García gravatar image

Hello everyone,

I am developing an application with several nodes: one receives a message (for example: ImageConstPtr&) that will be forwarded to another node in particular (via another topic), following a pool of workers approach. Can I create a publisher that use its function publish() with that ConstPtr& message, or should I transfer its contents to a new message object?

Thank you in advance

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2013-06-14 10:26:38 -0500

Mac gravatar image

Short version:

Yes, you can pass that ConstPtr to a call to publish(), and it will work.

Long answer: Can you explain the problem you're trying to solve in a bit more detail? I'm envisioning a sort of round-robin message dispatch, and that seems painful.

edit flag offensive delete link more

Question Tools


Asked: 2013-06-14 09:22:48 -0500

Seen: 1,436 times

Last updated: Jun 14 '13