# Option kick-vlc2 ## State Machine ## State grabball
If that state is active,
> | The option grab-ball-with-vlc2-head is executed.
The decision tree:
Pseudo code of the decision tree:
if ( | subsequent-option-reached-target-state | ) | // ball grabbed
{
if ( | angle.best-angle-to-opponent-goal-no-obstacles < -40 | ) | //
{
transition-to-state(turnforheadkick);
}
else if ( | angle.best-angle-to-opponent-goal-no-obstacles < 40 | ) | //
{
transition-to-state(turn);
}
else
{
transition-to-state(turnforheadkick);
}
}
else
{
transition-to-state(grabball);
}
## State turn
If that state is active,
> | The basic behavior walk is executed. Parameters:
| walk.type | = | walk-type.turn-with-ball ;
| walk.speed-x | = | 0 ;
| walk.speed-y | = | 0 ;
| walk.rotation-speed | = | ((sgn( ((angle.best-angle-to-opponent-goal + angle.best-angle-to-opponent-goal-no-obstacles) / 2) ) * 100) + ((angle.best-angle-to-opponent-goal + angle.best-angle-to-opponent-goal-no-obstacles) / 2)) ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.hold-ball
| strategy.ball-handling | = | dribble-the-ball
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution > 3000 | ) | //
{
transition-to-state(standbevorkick);
}
else if ( | abs( ((angle.best-angle-to-opponent-goal + angle.best-angle-to-opponent-goal-no-obstacles) / 2) ) < 7 | ) | //
{
transition-to-state(bevorstandbevorkick);
}
else
{
transition-to-state(turn);
}
## State bevorstandbevorkick
If that state is active,
> | The basic behavior walk is executed. Parameters:
| walk.type | = | walk-type.turn-with-ball ;
| walk.speed-x | = | 0 ;
| walk.speed-y | = | 0 ;
| walk.rotation-speed | = | 0 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.hold-ball
| strategy.ball-handling | = | dribble-the-ball
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution > 500 | ) | //
{
transition-to-state(standbevorkick);
}
else
{
transition-to-state(bevorstandbevorkick);
}
## State standbevorkick
If that state is active,
> | The basic behavior walk is executed. Parameters:
| walk.type | = | walk-type.turn-with-ball ;
| walk.speed-x | = | 0 ;
| walk.speed-y | = | 0 ;
| walk.rotation-speed | = | 0 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.look-parallel-to-ground
| strategy.ball-handling | = | dribble-the-ball
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution > 500 | ) | //
{
if ( | abs( ((angle.best-angle-to-opponent-goal + angle.best-angle-to-opponent-goal-no-obstacles) / 2) ) < 15 | ) | //
{
transition-to-state(kickformstand);
}
else
{
transition-to-state(turn2);
}
}
else
{
transition-to-state(standbevorkick);
}
## State turn2
If that state is active,
> | The basic behavior walk is executed. Parameters:
| walk.type | = | walk-type.walk-with-ball ;
| walk.speed-x | = | -250 ;
| walk.speed-y | = | 0 ;
| walk.rotation-speed | = | 0 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.look-straight-ahead
| strategy.ball-handling | = | dribble-the-ball
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution > 1000 | ) | //
{
transition-to-state(grabball);
}
else
{
transition-to-state(turn2);
}
## State standbevorkick2
If that state is active,
> | The basic behavior walk is executed. Parameters:
| walk.type | = | walk-type.walk-with-ball ;
| walk.speed-x | = | 0 ;
| walk.speed-y | = | 0 ;
| walk.rotation-speed | = | 0 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.look-parallel-to-ground
| strategy.ball-handling | = | dribble-the-ball
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution > 500 | ) | //
{
transition-to-state(kickformstand);
}
else
{
transition-to-state(standbevorkick2);
}
## State kickformstand
If that state is active,
> | The basic behavior walk is executed. Parameters:
| walk.type | = | walk-type.normal ;
| walk.speed-x | = | -100 ;
| walk.speed-y | = | 0 ;
| walk.rotation-speed | = | 0 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.look-parallel-to-ground
| strategy.ball-handling | = | handling-the-ball
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution < 250 | ) | //
{
transition-to-state(realykickformstand);
}
else
{
transition-to-state(kickformstand);
}
## State realykickformstand
If that state is active,
> | The option do-special-action is executed. Parameters:
| do-special-action.special-action-id | = | special-action.forward-kick-hard ;
| do-special-action.target-action-id | = | 0 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.search-for-ball
| strategy.ball-handling | = | handling-the-ball
The decision tree:
Pseudo code of the decision tree:
if ( | subsequent-option-reached-target-state | ) | //
{
transition-to-state(standandlook);
}
else
{
transition-to-state(realykickformstand);
}
## State turnforheadkick
If that state is active,
> | The basic behavior walk is executed. Parameters:
| walk.type | = | walk-type.turn-with-ball ;
| walk.speed-x | = | 0 ;
| walk.speed-y | = | 0 ;
| walk.rotation-speed | = | (sgn( angle.best-angle-to-opponent-goal-no-obstacles ) * 100) ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.hold-ball
| strategy.ball-handling | = | dribble-the-ball
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution > 2500 | ) | //
{
transition-to-state(standbevorkick2);
}
else if ( | abs( (angle.best-angle-to-opponent-goal-no-obstacles - 40) ) < 10 | ) | //
{
transition-to-state(headkicktoleft);
}
else if ( | abs( (angle.best-angle-to-opponent-goal-no-obstacles + 40) ) < 10 | ) | //
{
transition-to-state(headkicktorigth);
}
else if ( | abs( angle.best-angle-to-opponent-goal-no-obstacles ) < 30 | ) | //
{
transition-to-state(turn2);
}
else
{
transition-to-state(turnforheadkick);
}
## State headkicktorigth
If that state is active,
> | The option do-special-action is executed. Parameters:
| do-special-action.special-action-id | = | special-action.head-right ;
| do-special-action.target-action-id | = | 0 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.hold-ball
| strategy.ball-handling | = | handling-the-ball
The decision tree:
Pseudo code of the decision tree:
if ( | subsequent-option-reached-target-state | ) | //
{
transition-to-state(standandlook);
}
else
{
transition-to-state(headkicktorigth);
}
## State headkicktoleft
If that state is active,
> | The option do-special-action is executed. Parameters:
| do-special-action.special-action-id | = | special-action.head-left ;
| do-special-action.target-action-id | = | 0 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.hold-ball
| strategy.ball-handling | = | handling-the-ball
The decision tree:
Pseudo code of the decision tree:
if ( | subsequent-option-reached-target-state | ) | //
{
transition-to-state(standandlook);
}
else
{
transition-to-state(headkicktoleft);
}
## State kick
If that state is active,
> | The option do-special-action is executed. Parameters:
| do-special-action.special-action-id | = | special-action.bash-from-grab ;
| do-special-action.target-action-id | = | 0 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.hold-ball
| strategy.ball-handling | = | handling-the-ball
The decision tree:
Pseudo code of the decision tree:
if ( | subsequent-option-reached-target-state | ) | //
{
transition-to-state(standandlook);
}
else
{
transition-to-state(kick);
}
## State standandlook
This state is a target state.
If that state is active,
> | The basic behavior stand is executed.
> | These output symbols are set:
| head-control-mode | = | head-control-mode.search-for-ball
| strategy.ball-handling | = | handling-the-ball
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution > 1000 | ) | //
{
if ( | ball.seen.x > field.opponent-penalty-area.x | ) | //
{
if ( | time-of-state-execution > 4000 | ) | //
{
transition-to-state(grabball);
}
else
{
transition-to-state(standandlook);
}
}
else
{
transition-to-state(grabball);
}
}
else
{
transition-to-state(standandlook);
}