# Option vlc-turn-and-release Catches the ball with the head only and turns then to the requested angle, stops and realeases the ball. Parameters of that option:
Parameter | Measure | Range | Description
vlc-turn-and-release.angle |  | -180..180 | The desired absolute angle of the robot on the field
## State Machine ## State grabbed
If that state is active,
> | The basic behavior do-nothing is executed.
> | These output symbols are set:
| head-control-mode | = | head-control-mode.catch-ball
| strategy.ball-handling | = | dribble-the-ball
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution > 100 | ) | // wait some time to make sure the ball is really grabbed
{
if ( | ::vlc-turn-and-release.angle < 0 | ) | // turn right is better
{
transition-to-state(turn-right);
}
else
{
transition-to-state(turn-left);
}
}
else
{
transition-to-state(grabbed);
}
## State turn-left
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 | = | 200 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.catch-ball
| strategy.ball-handling | = | dribble-the-ball
| team-message | = | team-message.performing-a-kick
The decision tree:
Pseudo code of the decision tree:
if ( |
( | time-of-state-execution > 500 | )
&& |
( | ball.time-since-last-seen < 300 | )
&& |
( | ball.known-or-near.distance > 150 | )
| ) | // not caught
{
transition-to-state(stop);
}
else if ( | time-of-state-execution > 2000 | ) | // ball caught too long
{
transition-to-state(stop);
}
else if ( |
( | ::vlc-turn-and-release.angle < 20 | )
&& |
( | ::vlc-turn-and-release.angle > -20 | )
| ) | // reached target angle
{
transition-to-state(stop);
}
else
{
transition-to-state(turn-left);
}
## State turn-right
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 | = | -200 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.catch-ball
| strategy.ball-handling | = | dribble-the-ball
| team-message | = | team-message.performing-a-kick
The decision tree:
Pseudo code of the decision tree:
if ( |
( | time-of-state-execution > 500 | )
&& |
( | ball.time-since-last-seen < 300 | )
&& |
( | ball.known-or-near.distance > 150 | )
| ) | // not caught
{
transition-to-state(stop);
}
else if ( | time-of-state-execution > 2000 | ) | // ball caught too long
{
transition-to-state(stop);
}
else if ( |
( | ::vlc-turn-and-release.angle < 20 | )
&& |
( | ::vlc-turn-and-release.angle > -20 | )
| ) | // reached target angle
{
transition-to-state(stop);
}
else
{
transition-to-state(turn-right);
}
## State stop
If that state is active,
> | The basic behavior stand is executed.
> | These output symbols are set:
| head-control-mode | = | head-control-mode.catch-ball
| strategy.ball-handling | = | dribble-the-ball
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution > 500 | ) | // ball seen far away
{
transition-to-state(release);
}
else
{
transition-to-state(stop);
}
## State release
If that state is active,
> | The basic behavior stand is executed.
> | These output symbols are set:
| strategy.ball-handling | = | handling-the-ball
| head-control-mode | = | head-control-mode.look-straight-ahead
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution > 800 | ) | // ball seen far away
{
transition-to-state(finished);
}
else
{
transition-to-state(release);
}
## 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
| strategy.ball-handling | = | not-handling-the-ball
The decision tree:
Pseudo code of the decision tree:
transition-to-state(finished);