CLIPS Plugins
The ROS2 CLIPS-Executive can dynamically load pluginlib plugins, which act as an interface for users to apply the CLIPS C++ API (See the Advanced Programming Guide (PDF)), e.g., to inject user-defined functions into CLIPS environments.
- Plugins are specializations of of the cx_plugin base class and are handled as follows:
Each plugin is initialized exactly once before it is loaded into environments by calling it’s
initialize()function.When an environment is loaded, all specified plugins are loaded in order of the respective plugins parameter.
Whenever an environment needs to load a plugin, it’s
clips_env_init()function is called once. Loading the same plugin again before unloading it first, results in an error (and the function is not called again).Whenever an environment needs to unload a plugin, it’s
clips_env_destroyed()is called once. Unloading the same plugin again before loading it first, results in an error (and the function is not called again).Before an environment is destroyed, all plugins are unloaded in reverse order of loading.
On destruction of a plugin, the finalize() function is called exactly once.
Before a plugin is destroyed, it is unloaded from all environments.
See also the tutorial on Writing a Plugin to learn how to write your own plugins.
The ROS2 CLIPS-Executive provides several plugins out-of-the-box that are described here.