Mode Switching and Behavior Trees ================================= In this section, we will explain how we switch between different modes using Behavior Trees (BTs). CoHAN2.0 integrates BTs to switch between different planning modalities and facilitate more modular architecture. You can add new or remove existing modalities by using an xml file. CoHAN2.0 Behavior Tree ---------------------- The BT that integrates all modalities in CoHAN2.0 is shown below. .. image:: ./modes.png :width: 100% :alt: Modes diagram :align: center .. raw:: html
The BT looks for a goal update and as soon as it receives a new goal, it starts ticking the right branch to switch between different modes based on the conditions. At each instance, it looks for a passage detection and if a passage is detected, it activates the PassThrough mode for the given timeout (configurable). If no passage is detected or the PassThrough is done, it switches to the cycling mode sequence used by CoHAN (refer to paper for details on different modes). The switch from one mode to another happens when an exit condition is met. The default xml used by CoHAN2.0 is shown below: .. code-block:: xml These modes can be configured as needed and you can even add new modalities to CoHAN2.0 depending on your use case. Please have a look at code API for details on implementation.