roswtf Plugin API (Very Advanced)

NOTE: the plugin API is still very experimental and should only be used by advanced users of ROS.

You can write your own plugins for roswtf, which will be loaded and run whenever a user runs roswtf. For example, the widely used tf package implements a roswtf plugin to check for errors in the coordinate transform tree. In general, plugins can help catch common errors that users might make.

Implementing a plugin for roswtf should only be done with great care. Creating a plugin affects everyone who installs your package, and the performance of your plugin will affect every user of roswtf.

Here the necessary steps.

  1. Create your Python plugin file. Your Python plugin will need to be exported by your package, so it should go in the src/ directory of your package. For an example, you can look at tf/src/tf/ Your plugin should implement two API methods:

    def roswtf_plugin_online(ctx):
      # check for online conditions here
    def roswtf_plugin_static(ctx):
      # check for filesystem conditions here
    The "online" checks are only run if a ROS Graph is currently up. The static checks are intended to catch file-system issues, such as bad configuration files.
  2. Add a <depend package="roswtf" /> and <roswtf plugin="..." /> tag to your manifest. The value of the 'plugin' attribute should be the name of your Python module. For example, here is the export for tf's plugin:

        <roswtf plugin="tf.tfwtf" />
        ... other exports

Wiki: roswtf/Plugins (last edited 2018-03-14 07:39:14 by IsaacSaito)