Option approach-ball

Approaches the close ball

Parameters of that option:
ParameterMeasureRangeDescription
approach-ball.look-at-ball-distanceint0..The distance when the robot looks to the ball only
approach-ball.slow-down-distanceint0..The distance when the robot slows down
approach-ball.slow-speedint1..The speed for the state look-at-ball
approach-ball.y-offsetmm-1000...1000The y offset the robot is approaching the ball with.

State Machine

This browser can't display the SVG file svg/option_approach-ball.svg.



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

State search-auto

If that state is active,
 >  The option approach-ball-set-walk-speed is executed. Parameters:
 
    approach-ball-set-walk-speed.slow-down-distance  =  ::approach-ball.slow-down-distance ;
    approach-ball-set-walk-speed.slow-speed  =  ::approach-ball.slow-speed ;
    approach-ball-set-walk-speed.y-offset  =  ::approach-ball.y-offset ;
 
 >  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_approach-ball_state_search-auto.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 > 1300)   // ball not seen for 1300 ms
{
  
transition-to-state(ball-not-seen);
}
else if (ball.seen.distance < (::approach-ball.look-at-ball-distance - 25))   // search for ball
{
  
transition-to-state(search-for-ball);
}
else
{
  
transition-to-state(search-auto);
}

State search-for-ball

If that state is active,
 >  The option approach-ball-set-walk-speed is executed. Parameters:
 
    approach-ball-set-walk-speed.slow-down-distance  =  ::approach-ball.slow-down-distance ;
    approach-ball-set-walk-speed.slow-speed  =  ::approach-ball.slow-speed ;
    approach-ball-set-walk-speed.y-offset  =  ::approach-ball.y-offset ;
 
 >  These output symbols are set:
 
    head-control-mode  =  head-control-mode.search-for-ball
 
The decision tree:
  This browser can't display the SVG file svg/option_approach-ball_state_search-for-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 > 400)   // ball not seen for 400 ms
{
  
transition-to-state(ball-not-seen);
}
else if (ball.seen.distance > (::approach-ball.look-at-ball-distance + 25))   // walk fast and search auto
{
  
transition-to-state(search-auto);
}
else
{
  
transition-to-state(search-for-ball);
}

State ball-just-found

If that state is active,
 >  The option approach-ball-set-walk-speed is executed. Parameters:
 
    approach-ball-set-walk-speed.slow-down-distance  =  ::approach-ball.slow-down-distance ;
    approach-ball-set-walk-speed.slow-speed  =  ::approach-ball.slow-speed ;
    approach-ball-set-walk-speed.y-offset  =  ::approach-ball.y-offset ;
 
 >  These output symbols are set:
 
    head-control-mode  =  head-control-mode.search-for-ball
 
The decision tree:
  This browser can't display the SVG file svg/option_approach-ball_state_ball-just-found.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 > 500)   // ball not seen for 400 ms
{
  
transition-to-state(ball-not-seen);
}
else if (time-of-state-execution > 2000)   // state-runs-long-enough
{
  
transition-to-state(search-for-ball);
}
else
{
  
transition-to-state(ball-just-found);
}

State ball-not-seen

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_approach-ball_state_ball-not-seen.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
{
  
transition-to-state(ball-just-found);
}
else
{
  
transition-to-state(ball-not-seen);
}

State draw-back-left

If that state is active,
 >  The basic behavior walk is executed. Parameters:
 
    walk.type  =  walk-type.normal ;
    walk.speed-x  =  -150 ;
    walk.speed-y  =  75 ;
    walk.rotation-speed  =  0 ;
 
 >  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_approach-ball_state_draw-back-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 (time-of-state-execution > 2000)   // state running long enough
{
  
transition-to-state(search-for-ball);
}
else
{
  
transition-to-state(draw-back-left);
}

State draw-back-right

If that state is active,
 >  The basic behavior walk is executed. Parameters:
 
    walk.type  =  walk-type.normal ;
    walk.speed-x  =  -150 ;
    walk.speed-y  =  -75 ;
    walk.rotation-speed  =  0 ;
 
 >  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_approach-ball_state_draw-back-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 (time-of-state-execution > 2000)   // state running long enough
{
  
transition-to-state(search-for-ball);
}
else
{
  
transition-to-state(draw-back-right);
}