3 """Base class for app_manager plugin
5 This is a base class for app_manager plugin.
6 app_manager plugin have two class methods;
7 app_manager_start_plugin and app_manager_stop_plugin.
8 app_manager_start_plugin runs before app starts,
9 and app_manager_stop_plugin runs after app stops.
11 app_manager plugin is defined in yaml format as below;
12 - name: app_recorder/rosbag_recorder_plugin # plugin name
13 launch: app_recorder/rosbag_recorder.launch # plugin launch name
14 module: app_recorder.rosbag_recorder_plugin.RosbagRecorderPlugin
17 Also, app_manager plugin yaml file is exported in package.xml as below;
19 <app_manager plugin="${prefix}/app_recorder_plugin.yaml" />
22 In app file, you can add plugin to your app as below;
24 - name: mail_notifier_plugin # name to identify this plugin
25 type: app_notifier/mail_notifier_plugin # plugin type
26 launch_args: # arguments for plugin launch file
28 plugin_args: # arguments for plugin function arguments
31 Both class methods have 3 arguments;
32 App definition, app context and app plugin arguments.
33 App definition is the definition of app.
34 App context is the shared information about app (app context)
35 between plugins, such as app results and plugin results.
36 App plugin arguments are the arguments for the module defined in app file
44 """Start plugin for app_manager
47 app (app_manager.AppDefinition): app definition
48 ctx (dict): app context shared between plugins
49 plugin_args (dict): arguments for plugin defined in app file
55 """Stop plugin for app_manager
58 app (app_manager.AppDefinition): app definition
59 ctx (dict): app context shared between plugins
60 plugin_args (dict): arguments for plugin defined in app file