Multiple nodes and nodelets in a single process
I'm trying to include ros into an existing application, which is able to load extensions. Therefore I wrote my own extension (using roscpp library) containing a rosnode. Everything works as it is supposed to be. I'm able to publish and subscripe to messages.
Now I'm used to append more than only one ROS-based extensions into that application. Each extension creates a node by calling ros::init(argc, argv, name)
where name is a unique identifier.
My problem is, that besides multiple nodes have been created (at least their topics are all listed), rosnode list
lists only the first created node. After reading a little bit, my understanding right now is, that only one node will reside per process. Is this correct?
After that it found the nodelet package, which seems to be the solution for my problem. But it's a windows application and it's not possible to use catkin to rebuild the whole software. Moreover, I don't want to call any other executables out of a extension. Therefore, I tried to understand the idea behind nodelets and it's functionality.
My understanding right now is, that I have to write a nodelet_manager, which loads nodelets dynamically and all my extensions have to be derived from class nodelet::Nodelet
. Am I right?
Furthermore, it seems that nodelets uses one process and multiple threads for each nodelet. If so, could I just move my existing nodes into different threads?
Are my sugestions right and would there be a better solution. I would be happy to receive some feedback.