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

Revision history [back]

click to hide/show revision 1
initial version

I am finding trouble in using shared_memory access to access the original servo data across multiple processes.

This is not possible. If the publisher and subscriber run in different processes, i.e., nodes, the subscriber will receive a copy of the published Message Data. The value will be the same, but it won't point the same memory. If you Change anything in the received Message, the publisher won't​ bei effected.

In case of nodelets no copy ist done, i.e., Publisher and subscriber use shared memory, if shared pointers are Usedom. However, modifying the ptr in the callback, Reading after publish is not allowed/intended and may result in undefined behavior.

If you need to share Information From the subscribing node to the publishing node, you will need a different architecture, e.g., publishing Back the modified Message or Set Up a service call...