Re: How to use nodelets in ROS

Posted by Megacephalo on
URL: http://official-rtab-map-forum.206.s1.nabble.com/How-to-use-nodelets-in-ROS-tp671p677.html

Hi Mathieu,

Thank you for your reply. About your answer to the second question, may I ask you one more question.
So, as I understood, if all nodes or processes are arranged in the manner as shown in Figure 1,

                                                                    Fig 1.


That is to say, if there are N threads registering to a single driver, then there are 1 serialization and N deserialization. However, if we arrange all threads into a single nodelet, then we can effectively reduce the number of deserialization, as shown in Figure 2

                                                                   Fig 2.


with one manager registering to the driver, then we only have one serialization and one deserialization from driver to the manager, and the latter would give N copies to every subscribed thread. And here my question is, according to what you mentioned, Is the kind of copy a "call by value", then how can it reduce copy cost? If it is so, is each copy independent from each other? i.e. Thread A receives a copy from manager, process the copy and pass down to thread B, then B would not receive the very same copy as A does from the manager.

Thank you so much !