O'Reilly logo

Robot Operating System Cookbook by Kumar Bipin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building and running nodelets

We will make the entry for the source code files in CMakeLists.txt, so that we can build a nodelet package:

## Declare a cpp library 
 add_library(nodelet_hello_ros 
   src/hello_ros.cpp 
 ) 
 
## Specify libraries to link a library or executable target against 
 target_link_libraries(nodelet_hello_ros 
   ${catkin_LIBRARIES} 
 ) 

Consequently, we could build the package using catkin_make and, if the build is successful, it would generate a shared object libnodelet_hello_world.so file, which is indeed a plugin.

The following commands can be used to start the nodelet manager:

$ roscore
$ rosrun nodelet nodelet manager __name:=nodelet_manager

If nodelet manager runs successfully, we will see a message as shown in the following screenshot: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required