# Option kick-vlc this option positions the robot and performs a kick ## State Machine ## State go-to-ball-far
If that state is active,
> | The basic behavior go-to-ball is executed. Parameters:
| go-to-ball.distance | = | 0 ;
| go-to-ball.max-speed | = | 300 ;
| go-to-ball.max-speed.y | = | 0 ;
| go-to-ball.max-turn-speed | = | 150 ;
| go-to-ball.target-angle-to-ball | = | 0 ;
| go-to-ball.walk-type | = | walk-type.gt2004mode ;
| go-to-ball.y-offset | = | 0 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.search-auto
The decision tree:
Pseudo code of the decision tree:
if ( | ball.seen.distance < 400 | ) | //
{
transition-to-state(go-to-ball-near);
}
else
{
transition-to-state(go-to-ball-far);
}
## State go-to-ball-near
If that state is active,
> | The basic behavior go-to-ball is executed. Parameters:
| go-to-ball.distance | = | 80 ;
| go-to-ball.max-speed | = | 130 ;
| go-to-ball.max-speed.y | = | 0 ;
| go-to-ball.max-turn-speed | = | 150 ;
| go-to-ball.target-angle-to-ball | = | 0 ;
| go-to-ball.walk-type | = | walk-type.gt2004mode ;
| go-to-ball.y-offset | = | 0 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.search-auto
The decision tree:
Pseudo code of the decision tree:
if ( |
( | time-of-state-execution > 2500 | )
&& |
( | robot-pose.validity < 0.7 | )
| ) | //
{
transition-to-state(relocalize);
}
else if ( | ball.seen.distance > 450 | ) | //
{
transition-to-state(go-to-ball-far);
}
else if ( | ball.seen.distance < 300 | ) | //
{
transition-to-state(rotate-to-angle);
}
else
{
transition-to-state(go-to-ball-near);
}
## State rotate-to-angle
If that state is active,
> | The basic behavior turn-around-point is executed. Parameters:
| turn-around-point.x | = | ball.propagated.x ;
| turn-around-point.y | = | ball.propagated.y ;
| turn-around-point.radius | = | ball.propagated.distance ;
| turn-around-point.left-right | = | sgn( ((-1 * (angle.best-angle-to-opponent-goal + angle.best-angle-to-opponent-goal-no-obstacles)) / 2) ) ;
| turn-around-point.forward-component | = | 100 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.search-for-ball
The decision tree:
Pseudo code of the decision tree:
if ( | ball.seen.distance > 500 | ) | //
{
transition-to-state(go-to-ball-far);
}
else if ( | abs( ((angle.best-angle-to-opponent-goal + angle.best-angle-to-opponent-goal-no-obstacles) / 2) ) < 5 | ) | //
{
transition-to-state(relocalize);
}
else
{
transition-to-state(rotate-to-angle);
}
## State relocalize
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 < 1000 | ) | //
{
transition-to-state(relocalize);
}
else
{
transition-to-state(focus-ball);
}
## State focus-ball
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
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution < 700 | ) | //
{
transition-to-state(focus-ball);
}
else if ( |
( | abs( ((angle.best-angle-to-opponent-goal + angle.best-angle-to-opponent-goal-no-obstacles) / 2) ) < 8 | )
( |
( | robot-pose.distance-to-opponent-goal < 700 | )
&& |
( | abs( ((angle.best-angle-to-opponent-goal + angle.best-angle-to-opponent-goal-no-obstacles) / 2) ) < 20 | )
| )
| ) | //
{
if ( |
( | ball.known-or-near.distance < 210 | )
&& |
( | abs( ball.known-or-near.angle ) < 25 | )
| ) | //
{
transition-to-state(kick);
}
else
{
transition-to-state(get-closer-for-kick);
}
}
else
{
transition-to-state(go-to-ball-near);
}
## State get-closer-for-kick
If that state is active,
> | The basic behavior walk is executed. Parameters:
| walk.type | = | walk-type.gt2004mode ;
| walk.speed-x | = | (ball.propagated.distance / 2) ;
| walk.speed-y | = | ball.propagated.angle ;
| walk.rotation-speed | = | 0 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.search-for-ball
The decision tree:
Pseudo code of the decision tree:
if ( |
( | ball.propagated.distance > 310 | )
( | abs( ball.propagated.angle ) > 40 | )
| ) | //
{
transition-to-state(go-to-ball-near);
}
else if ( |
( | ball.propagated.distance < 180 | )
&& |
( | abs( ball.propagated.angle ) < 20 | )
| ) | //
{
transition-to-state(relocalize);
}
else
{
transition-to-state(get-closer-for-kick);
}
## State kick
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
The decision tree:
Pseudo code of the decision tree:
if ( | subsequent-option-reached-target-state | ) | //
{
transition-to-state(go-to-ball-near);
}
else
{
transition-to-state(kick);
}
## State finished
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
The decision tree:
Pseudo code of the decision tree:
transition-to-state(finished);