Write your own behavior tree plugin

To write a new plugin for Giskard's behavior tree you need to:

  1. Create a new file in giskardpy/src/giskardpy
  2. In that file create a class which inherits from GiskardBehavior

The GiskardBehavior is essentially a py_trees behavior with some convenience functions, like get_god_map(), get_world() and get_robot(). Otherwise, follow the advice given here: https://py-trees.readthedocs.io/en/devel/behaviours.html#. When modifying the tree in garden.py, be careful to return a reasonable status. Plugins added to planning IIII need to return running, otherwise they will stop the planning process. You should also keep in mind that since plugins in planning IIII will stay in the running state until the planning has finished, the initialize method of such plugins will only be called once per planning. Additionally, py_trees wrapper functions like running_is_success do not work on plugins added to planning IIII.

There are only two useful things your plugin can do:

  1. Make changes to the Godmap. Usually by adding new data, which is referenced by symbols in your own constraints. When doing so, it makes sense to add new paths to identifier.py.
  2. Do ROS stuff.

It is a good idea to have multiple short plugins which only do one thing. This will also make debugging easier. There is a ROS tool to look at the behavior tree during runtime Troubleshooting. However, it is not able to look into the multi threading behavior planning IIII.