Option turn_to_ball

Turn towards the last seen ball position. Do not turn if ball is very close.

State Machine

This browser can't display the SVG file svg/option_turn_to_ball.svg.



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

State turn

If that state is active,
 >  This enumerated output symbol is set:
    head.control_mode  = 
head.control_mode.search_for_ball
 >  This enumerated output symbol is set:
    motion.type  = 
motion.type.walk
 >  This enumerated output symbol is set:
    motion.walk_type  = 
motion.walk_type.normal
 >  This decimal output symbol is set:
    motion.walk_speed.x  = 
0
 >  This decimal output symbol is set:
    motion.walk_speed.y  = 
0
 >  This decimal output symbol is set:
    motion.walk_speed.rot  = 
ball.angle()
 >  This decimal output symbol is set:
    strategy.destination.x  = 
robot_pose.x()
 >  This decimal output symbol is set:
    strategy.destination.y  = 
robot_pose.y()
 
The decision tree:
  This browser can't display the SVG file svg/option_turn_to_ball_state_turn.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 ( abs( ball.angle() ) < 15)
{
  
goto finished;
}
else
{
  
/** */
if ( ball.distance() < 200)
{
  
goto finished;
}
else
{
  
/** */
if ( true)
{
  
goto turn;
}
else
{
  
stay;
}
}
}

State finished

This state is a target state.



If that state is active,
 >  This enumerated output symbol is set:
    motion.type  = 
motion.type.stand
 
The decision tree:
  This browser can't display the SVG file svg/option_turn_to_ball_state_finished.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 ( abs( ball.angle() ) < 15)
{
  
goto finished;
}
else
{
  
/** */
if ( ball.distance() < 200)
{
  
goto finished;
}
else
{
  
/** */
if ( true)
{
  
goto turn;
}
else
{
  
stay;
}
}
}