[ros-users] Nodelets and thread safety

Daniel Stonier d.stonier at gmail.com
Tue Oct 26 07:58:35 UTC 2010


One of the lovely things about ros - where there's a will, there's a way :)

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.

On 26 October 2010 02:44, Josh Faust <jfaust at willowgarage.com> wrote:

>
> 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?
>>
>>
>
> 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.
>
> 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:
> template<typename M>
> class MutexedMessage
> {
>   boost::mutex mutex;
>   boost::shared_ptr<M const> msg;
> };
>
> If this was adapted as a roscpp message (
> http://www.ros.org/wiki/roscpp/Overview/MessagesSerializationAndAdaptingTypes),
> 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.
>
> Josh
>
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
>


-- 
Phone : +82-10-5400-3296 (010-5400-3296)
Home: http://snorriheim.dnsdojo.com/
Yujin Robot: http://www.yujinrobot.com/
Embedded Ros : http://www.ros.org/wiki/eros
Embedded Control Libraries: http://snorriheim.dnsdojo.com/redmine/wiki/ecl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20101026/7dd482d8/attachment-0003.html>


More information about the ros-users mailing list