Option turn-and-release

Catches the ball with the head only and turns then to the requested angle and realeases the ball.

Parameters of that option:
ParameterMeasureRangeDescription
turn-and-release.angle-180..180The desired absolute angle of the robot on the field

State Machine

This browser can't display the SVG file svg/option_turn-and-release.svg.



The Adobe SVG Viewer 3.0 can be downloaded from http://www.adobe.com/svg/viewer/install/main.html

State grab

If that state is active,
 >  The option grab-ball-with-head is executed.
 
The decision tree:
  This browser can't display the SVG file svg/option_turn-and-release_state_grab.svg.



The Adobe SVG Viewer 3.0 can be downloaded from http://www.adobe.com/svg/viewer/install/main.html
 
Pseudo code of the decision tree:
 
if (
(
(ball.ball-was-seen)
&& 
(ball.number-of-images-with-ball-percept > 4)
&& 
(ball.seen.distance > 200)
&& 
(ball.seen.distance < 800)
)
|| 
(robot-state.time-since-something-was-in-front-of-chest > 450)
)   // ball distance greater than 200 mm or not 'seen' by PSD-sensor
{
  
transition-to-state(grab);
}
else
{
  
if (subsequent-option-reached-target-state)   // grabbed
{
  
if (::turn-and-release.angle < 0)   // turn right is better
{
  
transition-to-state(turn-right);
}
else
{
  
transition-to-state(turn-left);
}
}
else
{
  
transition-to-state(grab);
}
}

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  =  140 ;
 
 >  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:
  This browser can't display the SVG file svg/option_turn-and-release_state_turn-left.svg.



The Adobe SVG Viewer 3.0 can be downloaded from http://www.adobe.com/svg/viewer/install/main.html
 
Pseudo code of the decision tree:
 
if (
(
(ball.ball-was-seen)
&& 
(ball.number-of-images-with-ball-percept > 4)
&& 
(ball.seen.distance > 200)
&& 
(ball.seen.distance < 800)
)
|| 
(robot-state.time-since-something-was-in-front-of-chest > 450)
)   // ball distance greater than 200 mm or not 'seen' by PSD-sensor
{
  
transition-to-state(grab);
}
else
{
  
if (
(time-of-state-execution > 500)
&& 
(ball.time-since-last-seen < 300)
&& 
(ball.seen.distance > 150)
)   // not caught
{
  
transition-to-state(release-ball-left);
}
else if (time-of-state-execution > 2500)   // ball caught too long
{
  
transition-to-state(release-ball-left);
}
else if (
(::turn-and-release.angle < 110)
&& 
(::turn-and-release.angle > -110)
)   // reached target angle
{
  
transition-to-state(release-ball-left);
}
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  =  -140 ;
 
 >  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:
  This browser can't display the SVG file svg/option_turn-and-release_state_turn-right.svg.



The Adobe SVG Viewer 3.0 can be downloaded from http://www.adobe.com/svg/viewer/install/main.html
 
Pseudo code of the decision tree:
 
if (
(
(ball.ball-was-seen)
&& 
(ball.number-of-images-with-ball-percept > 4)
&& 
(ball.seen.distance > 200)
&& 
(ball.seen.distance < 800)
)
|| 
(robot-state.time-since-something-was-in-front-of-chest > 450)
)   // ball distance greater than 200 mm or not 'seen' by PSD-sensor
{
  
transition-to-state(grab);
}
else
{
  
if (
(time-of-state-execution > 500)
&& 
(ball.time-since-last-seen < 300)
&& 
(ball.seen.distance > 150)
)   // not caught
{
  
transition-to-state(release-ball-right);
}
else if (time-of-state-execution > 2500)   // ball caught too long
{
  
transition-to-state(release-ball-right);
}
else if (
(::turn-and-release.angle < 110)
&& 
(::turn-and-release.angle > -110)
)   // reached target angle
{
  
transition-to-state(release-ball-right);
}
else
{
  
transition-to-state(turn-right);
}
}

State find-ball-again

If that state is active,
 >  The basic behavior walk is executed. Parameters:
 
    walk.speed-x  =  100 ;
    walk.speed-y  =  0 ;
    walk.rotation-speed  =  0 ;
    walk.type  =  walk-type.normal ;
 
 >  These output symbols are set:
 
    head-control-mode  =  head-control-mode.search-for-ball
    strategy.ball-handling  =  handling-the-ball
 
The decision tree:
  This browser can't display the SVG file svg/option_turn-and-release_state_find-ball-again.svg.



The Adobe SVG Viewer 3.0 can be downloaded from http://www.adobe.com/svg/viewer/install/main.html
 
Pseudo code of the decision tree:
 
if (
(
(ball.ball-was-seen)
&& 
(ball.number-of-images-with-ball-percept > 4)
&& 
(ball.seen.distance > 200)
&& 
(ball.seen.distance < 800)
)
|| 
(robot-state.time-since-something-was-in-front-of-chest > 450)
)   // ball distance greater than 200 mm or not 'seen' by PSD-sensor
{
  
transition-to-state(grab);
}
else
{
  
if (ball.just-seen)   // ball seen again
{
  
transition-to-state(grab);
}
else if (time-of-state-execution < 500)   // state running less than 0,5 seconds
{
  
transition-to-state(find-ball-again);
}
else
{
  
transition-to-state(grab);
}
}

State release-ball-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  =  140 ;
 
 >  These output symbols are set:
 
    head-control-mode  =  head-control-mode.release-caught-ball-when-turning-left
    strategy.ball-handling  =  performing-a-kick
    team-message  =  team-message.performing-a-kick
 
The decision tree:
  This browser can't display the SVG file svg/option_turn-and-release_state_release-ball-left.svg.



The Adobe SVG Viewer 3.0 can be downloaded from http://www.adobe.com/svg/viewer/install/main.html
 
Pseudo code of the decision tree:
 
if (
(
(ball.ball-was-seen)
&& 
(ball.number-of-images-with-ball-percept > 4)
&& 
(ball.seen.distance > 200)
&& 
(ball.seen.distance < 800)
)
|| 
(robot-state.time-since-something-was-in-front-of-chest > 450)
)   // ball distance greater than 200 mm or not 'seen' by PSD-sensor
{
  
transition-to-state(grab);
}
else
{
  
if (
(ball.just-seen)
&& 
(ball.seen.distance > 600)
)   // ball seen far away
{
  
transition-to-state(grab);
}
else if (time-of-state-execution > 2000)   // state running more than 1000 ms
{
  
transition-to-state(find-ball-again);
}
else
{
  
transition-to-state(release-ball-left);
}
}

State release-ball-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  =  -140 ;
 
 >  These output symbols are set:
 
    head-control-mode  =  head-control-mode.release-caught-ball-when-turning-right
    strategy.ball-handling  =  performing-a-kick
    team-message  =  team-message.performing-a-kick
 
The decision tree:
  This browser can't display the SVG file svg/option_turn-and-release_state_release-ball-right.svg.



The Adobe SVG Viewer 3.0 can be downloaded from http://www.adobe.com/svg/viewer/install/main.html
 
Pseudo code of the decision tree:
 
if (
(
(ball.ball-was-seen)
&& 
(ball.number-of-images-with-ball-percept > 4)
&& 
(ball.seen.distance > 200)
&& 
(ball.seen.distance < 800)
)
|| 
(robot-state.time-since-something-was-in-front-of-chest > 450)
)   // ball distance greater than 200 mm or not 'seen' by PSD-sensor
{
  
transition-to-state(grab);
}
else
{
  
if (
(ball.just-seen)
&& 
(ball.seen.distance > 600)
)   // ball seen far away
{
  
transition-to-state(grab);
}
else if (time-of-state-execution > 2000)   // state running more than 1000 ms
{
  
transition-to-state(find-ball-again);
}
else
{
  
transition-to-state(release-ball-right);
}
}