# Option handle-with-old-flags Selects gamestate according to buttons. ## State Machine ## State localize
If that state is active,
> | The basic behavior stand is executed.
> | These output symbols are set:
| head-control-mode | = | head-control-mode.search-for-landmarks
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution < 5000 | ) | //
{
transition-to-state(localize);
}
else
{
transition-to-state(check-localisation);
}
## State check-localisation
If that state is active,
> | The basic behavior do-nothing is executed.
The decision tree:
Pseudo code of the decision tree:
if ( | robot-pose.validity > 0.4 | ) | //
{
transition-to-state(approach-center-circle);
}
else
{
transition-to-state(turn);
}
## State turn
If that state is active,
> | The basic behavior walk is executed. Parameters:
| walk.type | = | walk-type.normal ;
| walk.speed-x | = | 0 ;
| walk.speed-y | = | 0 ;
| walk.rotation-speed | = | 120 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.search-for-landmarks
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution > 1400 | ) | // the robot turned for 180 degrees
{
transition-to-state(localize);
}
else
{
transition-to-state(turn);
}
## State approach-center-circle
If that state is active,
> | The basic behavior go-to-point is executed. Parameters:
| go-to-point.x | = | 0 ;
| go-to-point.y | = | 0 ;
| go-to-point.distance-remain | = | 200 ;
| go-to-point.walk-type | = | 0 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.search-for-landmarks
The decision tree:
Pseudo code of the decision tree:
if ( |
( | abs( robot-pose.x ) < 200 | )
&& |
( | abs( robot-pose.y ) < 200 | )
| ) | //
{
transition-to-state(learn-new-flags);
}
else
{
transition-to-state(approach-center-circle);
}
## State learn-new-flags
If that state is active,
> | The basic behavior do-nothing is executed.
> | These output symbols are set:
| head-control-mode | = | head-control-mode.search-for-landmarks
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution < 5000 | ) | //
{
transition-to-state(learn-new-flags);
}
else
{
transition-to-state(goto-wait-point);
}
## State goto-wait-point
If that state is active,
> | The basic behavior do-nothing is executed.
> | These output symbols are set:
| head-control-mode | = | head-control-mode.search-for-landmarks
The decision tree:
Pseudo code of the decision tree:
transition-to-state(goto-wait-point);