Understanding ROS nodelets
Nodelets are specific ROS nodes designed to run multiple algorithms within the same process in an efficient way, executing each process as threads. The threaded nodes can communicate with each other efficiently without overloading the network, with zero copy transport between two nodes. These threaded nodes can communicate with external nodes too.
As we did using pluginlib, in nodelets, we can also dynamically load each class as a plugin, which has a separate namespace. Each loaded class can act as separate nodes, which are on a single process called nodelet.
Nodelets are used when the volume of data transferred between nodes are very high; for example, in transferring data from 3D sensors or cameras.
Next, we will look at how to create a nodelet.
Creating a nodelet
In this section, we are going to create a basic nodelet that can subscribe a string topic called /msg_in
and publish the same string (std_msgs/String
) on the topic /msg_out
.