# Option dribble-ball-vlc2 Dribbles the ball Parameters of that option:
Parameter | Measure | Range | Description
dribble-ball-vlc2.destination-angle | deg | -180..180 | The angle that the ball should be dribbled
## State Machine ## State dribble
If that state is active,
> | The option approach-and-turn is executed. Parameters:
| approach-and-turn.angle | = | ::dribble-ball-vlc2.destination-angle ;
| approach-and-turn.y-offset | = | (-50 * sin( ::dribble-ball-vlc2.destination-angle )) ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.search-for-ball
The decision tree:
Pseudo code of the decision tree:
if ( | abs( (robot-pose.angle - ::dribble-ball-vlc2.destination-angle) ) > 50 | ) | //
{
transition-to-state(rotate-to-angle);
}
else
{
transition-to-state(dribble);
}
## 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( (robot-pose.angle - ::dribble-ball-vlc2.destination-angle) ) ;
| 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 ( | abs( (robot-pose.angle - ::dribble-ball-vlc2.destination-angle) ) < 40 | ) | //
{
transition-to-state(dribble);
}
else if ( | ball.seen.distance > 500 | ) | //
{
transition-to-state(go-to-ball-far);
}
else
{
transition-to-state(rotate-to-angle);
}
## 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.known-or-near.distance < 350 | ) | //
{
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 | = | 150 ;
| 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-for-ball
The decision tree:
Pseudo code of the decision tree:
if ( | ball.known-or-near.distance > 400 | ) | //
{
transition-to-state(go-to-ball-far);
}
else if ( |
( | abs( ball.seen.distance-y ) < 60 | )
&& |
( | ball.known-or-near.distance < 300 | )
| ) | //
{
if ( | abs( (robot-pose.angle - ::dribble-ball-vlc2.destination-angle) ) < 40 | ) | //
{
transition-to-state(dribble);
}
else
{
transition-to-state(rotate-to-angle);
}
}
else
{
transition-to-state(go-to-ball-near);
}