February 2018
Beginner
580 pages
13h 20m
English
To load the class of plugins dynamically, we must export each class using a special macro called PLUGINLIB_EXPORT_CLASS. This macro must be present in any CPP file that consists of plugin classes. We have already defined the plugin class, and, in this file, we are going to define the macro statement only.
Locate the calculator_plugins.cpp file from the pluginlib_calculator/src folder. Here is how we export each plugin:
#include <pluginlib/class_list_macros.h> #include <pluginlib_calculator/calculator_base.h> #include <pluginlib_calculator/calculator_plugins.h> PLUGINLIB_EXPORT_CLASS(calculator_plugins::Add, calculator_base::calc_functions);
Inside PLUGINLIB_EXPORT_CLASS, we need ...