app_manager_plugin.py
Go to the documentation of this file.
1 class AppManagerPlugin(object):
2 
3  """Base class for app_manager plugin
4 
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.
10 
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
15  # plugin module name
16 
17  Also, app_manager plugin yaml file is exported in package.xml as below;
18  <export>
19  <app_manager plugin="${prefix}/app_recorder_plugin.yaml" />
20  </export>
21 
22  In app file, you can add plugin to your app as below;
23  - plugins
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
27  - foo: bar
28  plugin_args: # arguments for plugin function arguments
29  - hoge: fuga
30 
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
37  and written as below;
38  """
39 
40  def __init__(self):
41  pass
42 
43  def app_manager_start_plugin(self, app, ctx, plugin_args):
44  """Start plugin for app_manager
45 
46  Args:
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
50  """
51 
52  return ctx
53 
54  def app_manager_stop_plugin(self, app, ctx, plugin_args):
55  """Stop plugin for app_manager
56 
57  Args:
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
61  """
62 
63  return ctx
def app_manager_start_plugin(self, app, ctx, plugin_args)
def app_manager_stop_plugin(self, app, ctx, plugin_args)


app_manager
Author(s): Jeremy Leibs, Ken Conley, Yuki Furuta
autogenerated on Thu Oct 13 2022 02:59:17