5.5.3. Transitions Between Behaviors

We have seen how to implement different Algorithmic Behaviors, but determining when to transition to different behaviors (states of the algorithm FSM) can actually be one of the more difficult tasks. It requires detailed testing and careful observation and analysis of the results. This is one reason why it might help to record and share videos of robot experiments.

We need to determine a FSM diagram to follow and determine the appropriate conditions and threshold values to invoke a transition to a new state. Here is one possible FSM diagram. Testing and experimentation will determine if the FSM will work or if it needs to be changed. Testing will also determine the desired transition conditions.

From initial testing, the following threshold values for transitions between states are used. These values are, of course, only for the exact implementation we are using and could even change for us if more testing shows a need for change.

Name Control Value
Max_{\alpha\_Hybrid} \alpha_{ao} 0.78
Max_{\alpha\_Wall} \alpha_{ao} 1.5

5.5.3.1. Hybrid FSM

../../_images/state_transitions_hybrid.png

Fig. 5.6 Finite State Machine Diagram for the Hybrid Avoid Obstacles and Go-to-Goal Algorithm

The conditions for the labeled transitions are as follows.

  1. |\alpha_{ao}| \geq Max_{\alpha\_Hybrid}
  2. |\alpha_{ao}| <  Max_{\alpha\_Hybrid}

5.5.3.2. Cul-de-sac FSM

To solve The Cul-de-sac Problem, we need to add the Wall Following behavior to the Hybrid FSM.

../../_images/state_transitions.png

Fig. 5.7 Finite State Machine Diagram for The Cul-de-sac Problem

The conditions for the labeled transitions are as follows.

Note

  1. Avoid Obstacle is integrated with both the Go-To-Goal and Wall Follow behavior using a weighted hybrid algorithm.
  2. In both the Go-To-Goal state and Wall Follow state, track the minimum distance to the goal. Lack of progress or making progress towards the goal is part of the state transition criteria.
  3. Three conditions must be satisfied to move from the Wall Following State to the Go-To-Goal state.

In the Hybrid Go-To-Goal State, track Min{Dist_g}, which is needed to test for transition number 3.

In the Hybrid Wall Follow State, track Min{Dist_g}, which is needed to test for transition number 4.

  1. |\alpha_{ao}| \geq Max_{\alpha\_Hybrid}

  2. |\alpha_{ao}| <  Max_{\alpha\_Hybrid}

  3. Dist_g > Min{Dist_g} + \epsilon – lack of progress towards goal

  4. |\alpha_{ao}| <  Max_{\alpha\_Hybrid} – clear of obstacles,

    |\alpha_g| <  Max_{\alpha\_Wall}, – clear path to goal,

    and Dist_g < Min{Dist_g} + \epsilon – progress towards goal

  5. |\alpha_{ao}| \geq Max_{\alpha\_Wall}

  6. |\alpha_{ao}| <  Max_{\alpha\_Wall}