<div>One of the lovely things about ros - where there's a will, there's a way :)<br></div><div><br></div><div>We also did think about going back to using our ros-style sigslots to do it, but that starts hammering at the same concept that you were talking about earlier. So we'll reimplement some pluginlibs and keep that unit of modules together in a formal way. </div>
<br><div class="gmail_quote">On 26 October 2010 02:44, Josh Faust <span dir="ltr"><<a href="mailto:jfaust@willowgarage.com">jfaust@willowgarage.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div>Yes, exactly. i.e. sharing a large object between publisher and subscriber(s) and you want to avoid any copying or recreation of the object. The publisher is continually updating the large object and the subscribers don't want to get caught by an update in the middle of reading. Is there perhaps a better approach to this? How do the guys in the image pipeline handle the sending of big objects - they simply recreate a new object every time they want to send one?</div>



<div> </div></div></blockquote><div><br></div></div><div>If you actually want the subscribers reading from a shared store, I'd say pub/sub is not really the way to go.  If you want each message to be able to be processed by part of your pipeline (like with images, point clouds, etc.), you need to allocate a new message for each set of new data.</div>


<div><br></div><div>That said, if you really wanted to do it that way, it's possible you could write a templated wrapper class that you adapted as a ROS message, something like:</div><div>template<typename M></div>


<div>class MutexedMessage</div><div>{</div><div>  boost::mutex mutex;</div><div>  boost::shared_ptr<M const> msg;</div><div>};</div><div><br></div><div>If this was adapted as a roscpp message (<a href="http://www.ros.org/wiki/roscpp/Overview/MessagesSerializationAndAdaptingTypes" target="_blank">http://www.ros.org/wiki/roscpp/Overview/MessagesSerializationAndAdaptingTypes</a>), and you published/subscribed with shared_ptrs to it you'd get essentially what you're asking.  I don't recommend it as a solution though.</div>


<div><br></div><font color="#888888"><div>Josh</div></font></div>
<br>_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Phone : +82-10-5400-3296 (010-5400-3296)<br>Home: <a href="http://snorriheim.dnsdojo.com/" target="_blank">http://snorriheim.dnsdojo.com/</a><br><div>Yujin Robot: <a href="http://www.yujinrobot.com/" target="_blank">http://www.yujinrobot.com/</a><br>
</div><div>Embedded Ros : <a href="http://www.ros.org/wiki/eros" target="_blank">http://www.ros.org/wiki/eros</a></div>Embedded Control Libraries: <a href="http://snorriheim.dnsdojo.com/redmine/wiki/ecl" target="_blank">http://snorriheim.dnsdojo.com/redmine/wiki/ecl</a><br>