Skip to Content
Robot Operating System Cookbook
book

Robot Operating System Cookbook

by Kumar Bipin
June 2018
Intermediate to advanced
484 pages
11h 36m
English
Packt Publishing
Content preview from Robot Operating System Cookbook

Plugins registration

In the preceding subsection, we created standard C++ classes. Now, we will discuss pluginlib-specific work as a declaration of the Triangle and Square classes as plugins. Let's look at the source code in the src/polygon_plugins.cpp file:

#include <pluginlib/class_list_macros.h> 
#include <pluginlib_tutorials_/polygon_base.h> 
#include <pluginlib_tutorials_/polygon_plugins.h> 
 
PLUGINLIB_EXPORT_CLASS(polygon_plugins::Triangle, polygon_base::RegularPolygon) 
PLUGINLIB_EXPORT_CLASS(polygon_plugins::Square, polygon_base::RegularPolygon) 

Here, we have registered the Triangle and Square classes as plugins using the PLUGINLIB_EXPORT_CLASS macro.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mobile Intelligent Autonomous Systems

Mobile Intelligent Autonomous Systems

Jitendra R. Raol, Ajith K. Gopal
Wheeled Mobile Robotics

Wheeled Mobile Robotics

Gregor Klancar, Andrej Zdesar, Saso Blazic, Igor Skrjanc

Publisher Resources

ISBN: 9781783987443Supplemental Content