Option position_for_grab_optimization

State Machine

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



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

State go_home

If that state is active,
 >  This enumerated output symbol is set:
    head.control_mode  = 
head.control_mode.search_for_landmarks
 >  The option go_to_point is executed. Parameters:
    go_to_point.x  =  0 ;
    go_to_point.y  =  0 ;
    go_to_point.angle  =  (ball.angle() + robot_pose.angle() ) ;
    go_to_point.always_turn_to_angle  =  true ;
 
The decision tree:
  This browser can't display the SVG file svg/option_position_for_grab_optimization_state_go_home.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.was_seen() )
&& 
(abs( (ball.distance() - 1000) ) < 100)
&& 
(abs( ball.angle() ) < 15)
)
{
  
goto finished;
}
else
{
  
/** */
if (
(ball.was_seen() )
&& 
(abs( (ball.distance() - 1000) ) < 100)
)
{
  
goto turn_for_ball;
}
else
{
  
/** */
if ( (abs( robot_pose.x() ) + abs( robot_pose.x() ) ) < 300)
{
  
goto search_ball;
}
else
{
  
stay;
}
}
}

State search_ball

If that state is active,
 >  The option search_ball is executed.
 
The decision tree:
  This browser can't display the SVG file svg/option_position_for_grab_optimization_state_search_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.was_seen() )
&& 
(abs( (ball.distance() - 1000) ) < 100)
&& 
(abs( ball.angle() ) < 15)
)
{
  
goto finished;
}
else
{
  
/** */
if (
(ball.was_seen() )
&& 
(abs( (ball.distance() - 1000) ) < 100)
)
{
  
goto turn_for_ball;
}
else
{
  
/** */
if (
(ball.was_seen() )
&& 
(ball.distance() > 1000)
)
{
  
goto approach;
}
else
{
  
/** */
if (
(ball.was_seen() )
&& 
(ball.distance() < 1000)
)
{
  
goto turn_for_ball;
}
else
{
  
stay;
}
}
}
}

State approach

If that state is active,
 >  The option go_to_ball is executed.
 
The decision tree:
  This browser can't display the SVG file svg/option_position_for_grab_optimization_state_approach.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.was_seen() )
&& 
(abs( (ball.distance() - 1000) ) < 100)
&& 
(abs( ball.angle() ) < 15)
)
{
  
goto finished;
}
else
{
  
/** */
if (
(ball.was_seen() )
&& 
(abs( (ball.distance() - 1000) ) < 100)
)
{
  
goto turn_for_ball;
}
else
{
  
/** */
if ( ball.time_since_last_seen() > 500)
{
  
goto search_ball;
}
else
{
  
stay;
}
}
}

State turn_for_ball

If that state is active,
 >  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()
 
The decision tree:
  This browser can't display the SVG file svg/option_position_for_grab_optimization_state_turn_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.was_seen() )
&& 
(abs( (ball.distance() - 1000) ) < 100)
&& 
(abs( ball.angle() ) < 15)
)
{
  
goto finished;
}
else
{
  
/** */
if (
(ball.was_seen() )
&& 
(abs( (ball.distance() - 1000) ) < 100)
)
{
  
goto turn_for_ball;
}
else
{
  
/** */
if (
(abs( ball.angle() ) < 10)
&& 
(ball.was_seen() )
&& 
(ball.distance() < 1000)
)
{
  
goto backwards;
}
else
{
  
/** */
if (
(abs( ball.angle() ) < 10)
&& 
(ball.was_seen() )
&& 
(ball.distance() > 1000)
)
{
  
goto approach;
}
else
{
  
stay;
}
}
}
}

State backwards

If that state is active,
 >  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  = 
-240
 >  This decimal output symbol is set:
    motion.walk_speed.y  = 
0
 >  This decimal output symbol is set:
    motion.walk_speed.rot  = 
0
 
The decision tree:
  This browser can't display the SVG file svg/option_position_for_grab_optimization_state_backwards.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.was_seen() )
&& 
(abs( (ball.distance() - 1000) ) < 100)
&& 
(abs( ball.angle() ) < 15)
)
{
  
goto finished;
}
else
{
  
/** */
if (
(ball.was_seen() )
&& 
(abs( (ball.distance() - 1000) ) < 100)
)
{
  
goto turn_for_ball;
}
else
{
  
/** */
if ( ball.time_since_last_seen() > 500)
{
  
goto search_ball;
}
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_position_for_grab_optimization_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 (
(ball.was_seen() )
&& 
(abs( (ball.distance() - 1000) ) < 100)
&& 
(abs( ball.angle() ) < 15)
)
{
  
goto finished;
}
else
{
  
/** */
if (
(ball.was_seen() )
&& 
(abs( (ball.distance() - 1000) ) < 100)
)
{
  
goto turn_for_ball;
}
else
{
  
stay;
}
}