Option goalie_head_control

Head control for the goalie. Will look for landmarks if ball is in opponent half, for ball and landmarks if ball is in own half but not too near or only at the ball if the ball is "dangerous"

State Machine

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



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

State ball_in_opponent_half

If that state is active,
 >  This enumerated output symbol is set:
    leds.head_white  = 
leds.blink.oooo
 >  The option goalie_look_at_ball_and_L is executed. Parameters:
    goalie_look_at_ball_and_L.look_at_L_frequency  =  1000 ;
 
The decision tree:
  This browser can't display the SVG file svg/option_goalie_head_control_state_ball_in_opponent_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:
 
/** */
if ( ball.time_since_last_seen() > 3500)
{
  
goto ball_not_seen_for_long_time;
}
else
{
  
/** */
if ( ball.time_since_last_seen() > 1500)
{
  
goto ball_not_seen_shortly;
}
else
{
  
/** Ball in own half an moving fast towards us */
if (
(ball.position.field.x() < 0)
&& 
(ball.speed.robot.x() < -400)
)
{
  
goto ball_dangerous;
}
else
{
  
/** Ball veeery near to own goal */
if (
(ball.position.field.x() < (field.own_penalty_area.x() + 100))
&& 
(
(ball.position.field.y() < (field.left_penalty_area.y() + 100))
|| 
(ball.position.field.y() > (field.right_penalty_area.y() - 100))
)
)
{
  
goto ball_dangerous;
}
else
{
  
/** */
if ( ball.position.field.x() > 100)
{
  
goto ball_in_opponent_half;
}
else
{
  
/** */
if ( ball.position.field.y() < -100)
{
  
goto ball_in_own_half;
}
else
{
  
stay;
}
}
}
}
}
}

State ball_in_own_half

If that state is active,
 >  This enumerated output symbol is set:
    leds.head_white  = 
leds.blink.oooo
 >  The option goalie_look_at_ball_and_L is executed. Parameters:
    goalie_look_at_ball_and_L.look_at_L_frequency  =  2000 ;
 
The decision tree:
  This browser can't display the SVG file svg/option_goalie_head_control_state_ball_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:
 
/** */
if ( ball.time_since_last_seen() > 3500)
{
  
goto ball_not_seen_for_long_time;
}
else
{
  
/** */
if ( ball.time_since_last_seen() > 1500)
{
  
goto ball_not_seen_shortly;
}
else
{
  
/** Ball in own half an moving fast towards us */
if (
(ball.position.field.x() < 0)
&& 
(ball.speed.robot.x() < -400)
)
{
  
goto ball_dangerous;
}
else
{
  
/** Ball veeery near to own goal */
if (
(ball.position.field.x() < (field.own_penalty_area.x() + 100))
&& 
(
(ball.position.field.y() < (field.left_penalty_area.y() + 100))
|| 
(ball.position.field.y() > (field.right_penalty_area.y() - 100))
)
)
{
  
goto ball_dangerous;
}
else
{
  
/** */
if ( ball.position.field.x() > 100)
{
  
goto ball_in_opponent_half;
}
else
{
  
/** */
if ( ball.position.field.y() < -100)
{
  
goto ball_in_own_half;
}
else
{
  
stay;
}
}
}
}
}
}

State ball_dangerous

If that state is active,
 >  This enumerated output symbol is set:
    leds.head_white  = 
leds.blink.llll
 >  The option search_for_ball is executed.
 
The decision tree:
  This browser can't display the SVG file svg/option_goalie_head_control_state_ball_dangerous.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() > 3500)
{
  
goto ball_not_seen_for_long_time;
}
else
{
  
/** */
if ( ball.time_since_last_seen() > 1500)
{
  
goto ball_not_seen_shortly;
}
else
{
  
/** Ball in own half an moving fast towards us */
if (
(ball.position.field.x() < 0)
&& 
(ball.speed.robot.x() < -400)
)
{
  
goto ball_dangerous;
}
else
{
  
/** Ball veeery near to own goal */
if (
(ball.position.field.x() < (field.own_penalty_area.x() + 100))
&& 
(
(ball.position.field.y() < (field.left_penalty_area.y() + 100))
|| 
(ball.position.field.y() > (field.right_penalty_area.y() - 100))
)
)
{
  
goto ball_dangerous;
}
else
{
  
/** */
if ( ball.position.field.x() > 100)
{
  
goto ball_in_opponent_half;
}
else
{
  
/** */
if ( ball.position.field.y() < -100)
{
  
goto ball_in_own_half;
}
else
{
  
stay;
}
}
}
}
}
}

State ball_not_seen_shortly

If that state is active,
 >  This enumerated output symbol is set:
    leds.head_white  = 
leds.blink.oooo
 >  The option search_for_ball is executed.
 
The decision tree:
  This browser can't display the SVG file svg/option_goalie_head_control_state_ball_not_seen_shortly.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() > 3500)
{
  
goto ball_not_seen_for_long_time;
}
else
{
  
/** */
if ( ball.time_since_last_seen() > 1500)
{
  
goto ball_not_seen_shortly;
}
else
{
  
/** Ball in own half an moving fast towards us */
if (
(ball.position.field.x() < 0)
&& 
(ball.speed.robot.x() < -400)
)
{
  
goto ball_dangerous;
}
else
{
  
/** Ball veeery near to own goal */
if (
(ball.position.field.x() < (field.own_penalty_area.x() + 100))
&& 
(
(ball.position.field.y() < (field.left_penalty_area.y() + 100))
|| 
(ball.position.field.y() > (field.right_penalty_area.y() - 100))
)
)
{
  
goto ball_dangerous;
}
else
{
  
/** */
if ( ball.position.field.x() > 100)
{
  
goto ball_in_opponent_half;
}
else
{
  
/** */
if ( ball.position.field.y() < -100)
{
  
goto ball_in_own_half;
}
else
{
  
stay;
}
}
}
}
}
}

State ball_not_seen_for_long_time

If that state is active,
 >  This enumerated output symbol is set:
    leds.head_white  = 
leds.blink.oooo
 >  The option search_for_ball is executed.
 
The decision tree:
  This browser can't display the SVG file svg/option_goalie_head_control_state_ball_not_seen_for_long_time.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() > 3500)
{
  
goto ball_not_seen_for_long_time;
}
else
{
  
/** */
if ( ball.time_since_last_seen() > 1500)
{
  
goto ball_not_seen_shortly;
}
else
{
  
/** Ball in own half an moving fast towards us */
if (
(ball.position.field.x() < 0)
&& 
(ball.speed.robot.x() < -400)
)
{
  
goto ball_dangerous;
}
else
{
  
/** Ball veeery near to own goal */
if (
(ball.position.field.x() < (field.own_penalty_area.x() + 100))
&& 
(
(ball.position.field.y() < (field.left_penalty_area.y() + 100))
|| 
(ball.position.field.y() > (field.right_penalty_area.y() - 100))
)
)
{
  
goto ball_dangerous;
}
else
{
  
/** */
if ( ball.position.field.x() > 100)
{
  
goto ball_in_opponent_half;
}
else
{
  
/** */
if ( ball.position.field.y() < -100)
{
  
goto ball_in_own_half;
}
else
{
  
stay;
}
}
}
}
}
}