Step 7 – Updating CMakeLists.txt

After doing all these things, we can compose CMakeLists.txt of the package:

## my_controller_file library 
add_library(my_controller_lib src/my_controller.cpp) 
target_link_libraries(my_controller_lib ${catkin_LIBRARIES}) 

Get Mastering ROS for Robotics Programming - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.