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.
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/tfwtf.py. Your plugin should implement two API methods:
def roswtf_plugin_online(ctx): # check for online conditions here pass def roswtf_plugin_static(ctx): # check for filesystem conditions here passThe "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.
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:
<export> <roswtf plugin="tf.tfwtf" /> ... other exports </export>