Option handle_ball_penalty_shooter

Penalty-shooter for the RoboCup2005

State Machine

This browser can't display the SVG file svg/option_handle_ball_penalty_shooter.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_and_dribble is executed. Parameters:
    grab_and_dribble.angle  =  selfloc.opponent_goal.angle() ;
    grab_and_dribble.angle_width  =  selfloc.opponent_goal.angle_width() ;
    grab_and_dribble.forward_kick  = 
(abs( selfloc.opponent_goal.angle() ) < selfloc.opponent_goal.angle_width() )
&& 
(
(
(selfloc.opponent_goal.grubby_seen() )
&& 
(abs( selfloc.opponent_goal.grubby_angle() ) < selfloc.opponent_goal.grubby_angle_width() )
)
|| 
(selfloc.freePartOfOpponentGoalInFront() )
)
;
    grab_and_dribble.dribble_forward  =  false ;
    grab_and_dribble.always_stop  =  true ;
 
The decision tree:
  This browser can't display the SVG file svg/option_handle_ball_penalty_shooter_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:
 
/** ball seen inside opponent penalty area */
if (
(ball.was_seen() )
&& 
(ball.position.field.x() > (field.opponent_penalty_area.x() + 200))
&& 
(abs( ball.position.field.y() ) < (field.left_penalty_area.y() - 200))
)
{
  
goto ball_in_opponent_penalty_area;
}
else
{
  
/** just shoot when time is running out */
if (
(game.remaining_time() < 10)
&& 
(game.remaining_time() > 0)
)
{
  
stay;
}
else
{
  
/** ball seen in own half */
if (
(ball.was_seen() )
&& 
(ball.position.field.x() < -500)
)
{
  
goto play_in_own_half;
}
else
{
  
stay;
}
}
}

State play_in_own_half

If that state is active,
 >  The option play_to_angle is executed. Parameters:
    play_to_angle.angle  =  selfloc.opponent_goal.angle() ;
    play_to_angle.angle_width  =  (selfloc.opponent_goal.angle_width() / 2) ;
    play_to_angle.precise  =  false ;
    play_to_angle.forward_kick  =  false ;
    play_to_angle.dribble_forward  =  false ;
 
The decision tree:
  This browser can't display the SVG file svg/option_handle_ball_penalty_shooter_state_play_in_own_half.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:
 
/** ball seen in opponent half */
if (
(ball.was_seen() )
&& 
(ball.position.field.x() > 0)
)
{
  
goto grab;
}
else
{
  
/** */
if (
(game.remaining_time() < 10)
&& 
(game.remaining_time() > 0)
)
{
  
goto grab;
}
else
{
  
stay;
}
}

State ball_in_opponent_penalty_area

If that state is active,
 >  This enumerated output symbol is set:
    head.control_mode  = 
head.control_mode.search_for_ball
 >  The option go_to_point is executed. Parameters:
    go_to_point.x  =  (field.opponent_penalty_area.x() - 400) ;
    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_handle_ball_penalty_shooter_state_ball_in_opponent_penalty_area.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:
 
/** ball seen outside opponent penalty area */
if (
(ball.was_seen() )
&& 
(
(ball.position.field.x() < field.opponent_penalty_area.x() )
|| 
(abs( ball.position.field.y() ) > field.left_penalty_area.y() )
)
)
{
  
goto grab;
}
else
{
  
stay;
}