# Option kicklogger-walkandkick ## State Machine ## State set-before
If that state is active,
> | The basic behavior stand is executed.
> | These output symbols are set:
| head-control-mode | = | head-control-mode.search-auto
| leds.top-red | = | top.both-fast-blink
The decision tree:
Pseudo code of the decision tree:
if ( | kicklogger.set-before-state | ) | // call successful
{
transition-to-state(goto-ball);
}
else
{
transition-to-state(set-before);
}
## State goto-ball
If that state is active,
> | The basic behavior go-forward-to-point is executed. Parameters:
| go-forward-to-point.x | = | kicklogger.walktoTargetX ;
| go-forward-to-point.y | = | kicklogger.walktoTargetY ;
| go-forward-to-point.max-speed | = | 450 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.search-auto
| leds.top-red | = | top.both-on
| sound-request | = | sound-request.okay
The decision tree:
Pseudo code of the decision tree:
if ( | (kicklogger.ball-relative.x - 200) < kicklogger.trigger-relative.x | ) | // kick is set
{
transition-to-state(goto-ball-near);
}
else
{
transition-to-state(goto-ball);
}
## State goto-ball-near
If that state is active,
> | The basic behavior go-forward-to-point is executed. Parameters:
| go-forward-to-point.x | = | kicklogger.walktoTargetX ;
| go-forward-to-point.y | = | kicklogger.walktoTargetY ;
| go-forward-to-point.max-speed | = | 350 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.search-for-ball
| leds.top-red | = | top.both-on
| sound-request | = | sound-request.okay
The decision tree:
Pseudo code of the decision tree:
if ( | kicklogger.ball-relative.x < kicklogger.trigger-relative.x | ) | // kick is set
{
transition-to-state(set-execute);
}
else if ( | (kicklogger.ball-relative.x - 300) > kicklogger.trigger-relative.x | ) | //
{
transition-to-state(goto-ball);
}
else
{
transition-to-state(goto-ball-near);
}
## State set-execute
If that state is active,
> | The basic behavior stand is executed.
> | These output symbols are set:
| head-control-mode | = | head-control-mode.search-auto
| leds.bottom-red | = | bottom.both-fast-blink
The decision tree:
Pseudo code of the decision tree:
if ( | kicklogger.setExecuteState | ) | // state is running more than 0.5s and ball is seen
{
transition-to-state(execute-kick);
}
else
{
transition-to-state(set-execute);
}
## State execute-kick
If that state is active,
> | The basic behavior special-action is executed. Parameters:
| special-action-id | = | kicklogger.kick ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.search-auto
| leds.top-red | = | top.both-on
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution > 700 | ) | // state is running more than 0.5s
{
transition-to-state(wait-until-ball-stopped);
}
else
{
transition-to-state(execute-kick);
}
## State wait-until-ball-stopped
If that state is active,
> | The basic behavior stand is executed.
> | These output symbols are set:
| head-control-mode | = | head-control-mode.look-to-stars
| leds.bottom-red | = | bottom.left
The decision tree:
Pseudo code of the decision tree:
if ( | kicklogger.ball-has-stopped | ) | // state is running more than 5s
{
transition-to-state(wait-until-ball-stop-confirmed);
}
else
{
transition-to-state(wait-until-ball-stopped);
}
## State wait-until-ball-stop-confirmed
If that state is active,
> | The basic behavior stand is executed.
> | These output symbols are set:
| head-control-mode | = | head-control-mode.look-to-stars
| leds.bottom-red | = | bottom.left
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution > 1000 | ) | // state is running more than 5s
{
transition-to-state(set-after);
}
else if ( |
!( | kicklogger.ball-has-stopped | )
| ) | // Ball running again
{
transition-to-state(wait-until-ball-stopped);
}
else
{
transition-to-state(wait-until-ball-stop-confirmed);
}
## State set-after
If that state is active,
> | The basic behavior stand is executed.
> | These output symbols are set:
| head-control-mode | = | head-control-mode.search-auto
| leds.bottom-red | = | bottom.both-fast-blink
The decision tree:
Pseudo code of the decision tree:
if ( | kicklogger.setAfterStateAndCommit | ) | // state is running more than 0.5s and ball is seen
{
transition-to-state(done);
}
else
{
transition-to-state(set-after);
}
## State done
This state is a target state.
If that state is active,
> | The basic behavior stand is executed.
The decision tree:
Pseudo code of the decision tree:
transition-to-state(done);