Option get-to-ball-and-avoid-obstacles

Walks to a ball that is far away and avoids obstacles on the way there

State Machine

This browser can't display the SVG file svg/option_get-to-ball-and-avoid-obstacles.svg.



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

State ball-not-known

If that state is active,
 >  The option turn-for-ball is executed.
 
The decision tree:
  This browser can't display the SVG file svg/option_get-to-ball-and-avoid-obstacles_state_ball-not-known.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.just-seen)   // ball seen again
{
  
transition-to-state(near-seen-ball);
}
else if (ball.time-since-last-known < 100)   // ball known again
{
  
transition-to-state(near-known-ball);
}
else
{
  
transition-to-state(ball-not-known);
}

State far-from-seen-ball

If that state is active,
 >  The option get-to-position-and-avoid-obstacles is executed. Parameters:
 
    get-to-position-and-avoid-obstacles.x  =  ball.known.x ;
    get-to-position-and-avoid-obstacles.y  =  ball.known.y ;
    get-to-position-and-avoid-obstacles.destination-angle  =  (ball.seen.angle + robot-pose.angle) ;
    get-to-position-and-avoid-obstacles.max-speed  =  450 ;
    get-to-position-and-avoid-obstacles.no-obstacle-avoidance-distance  =  100 ;
    get-to-position-and-avoid-obstacles.avoid-penalty-areas  =  1 ;
 
 >  These output symbols are set:
 
    head-control-mode  =  head-control-mode.search-auto
 
The decision tree:
  This browser can't display the SVG file svg/option_get-to-ball-and-avoid-obstacles_state_far-from-seen-ball.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.time-since-last-seen > 1500)   // ball not seen
{
  
transition-to-state(ball-not-known);
}
else if (ball.seen.distance < 700)   // near ball
{
  
transition-to-state(near-seen-ball);
}
else
{
  
transition-to-state(far-from-seen-ball);
}

State near-seen-ball

If that state is active,
 >  The option approach-ball is executed. Parameters:
 
    approach-ball.look-at-ball-distance  =  400 ;
    approach-ball.slow-down-distance  =  250 ;
    approach-ball.slow-speed  =  250 ;
 
The decision tree:
  This browser can't display the SVG file svg/option_get-to-ball-and-avoid-obstacles_state_near-seen-ball.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.time-since-last-seen > 1000)   // ball not seen
{
  
transition-to-state(ball-not-known);
}
else if (ball.seen.distance > 900)   // far from ball
{
  
transition-to-state(far-from-seen-ball);
}
else
{
  
transition-to-state(near-seen-ball);
}

State far-from-known-ball

If that state is active,
 >  The option get-to-position-and-avoid-obstacles is executed. Parameters:
 
    get-to-position-and-avoid-obstacles.x  =  ball.known.x ;
    get-to-position-and-avoid-obstacles.y  =  ball.known.y ;
    get-to-position-and-avoid-obstacles.destination-angle  =  (ball.known.angle + robot-pose.angle) ;
    get-to-position-and-avoid-obstacles.max-speed  =  600 ;
    get-to-position-and-avoid-obstacles.no-obstacle-avoidance-distance  =  100 ;
    get-to-position-and-avoid-obstacles.avoid-penalty-areas  =  1 ;
 
 >  These output symbols are set:
 
    head-control-mode  =  head-control-mode.search-auto
 
The decision tree:
  This browser can't display the SVG file svg/option_get-to-ball-and-avoid-obstacles_state_far-from-known-ball.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.time-since-last-known > 2500)   // ball not known
{
  
transition-to-state(ball-not-known);
}
else if (ball.just-seen)   // ball seen again
{
  
transition-to-state(near-seen-ball);
}
else if (ball.known.distance < 400)   // near ball
{
  
transition-to-state(near-known-ball);
}
else
{
  
transition-to-state(far-from-known-ball);
}

State near-known-ball

If that state is active,
 >  The option turn-for-ball is executed.
 
The decision tree:
  This browser can't display the SVG file svg/option_get-to-ball-and-avoid-obstacles_state_near-known-ball.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.time-since-last-known > 1500)   // ball not known
{
  
transition-to-state(ball-not-known);
}
else if (ball.just-seen)   // ball seen again
{
  
transition-to-state(near-seen-ball);
}
else if (ball.known.distance > 600)   // far from ball
{
  
transition-to-state(far-from-known-ball);
}
else
{
  
transition-to-state(near-known-ball);
}