Option position_defender

Positions a defensive supporter

Parameters of that option:
ParameterTypeMeasureRangeDescription
position_defender.y_offsetdecimalmm

State Machine

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



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

State position_ball_seen

If that state is active,
 >  This enumerated output symbol is set:
    head.control_mode  = 
(
(ball.time_since_last_seen() < 800)
&& 
(ball.distance() > 300)
? head.control_mode.defender_head_control : head.control_mode.search_for_ball )
 >  The option go_to_point_avoid_collisions is executed. Parameters:
    go_to_point_avoid_collisions.x  =  selfloc.defensive_supporter_position.x( 1500 ) ;
    go_to_point_avoid_collisions.y  =  (selfloc.defensive_supporter_position.y( 1500 ) + @position_defender.y_offset) ;
    go_to_point_avoid_collisions.angle  =  (robot_pose.angle() + ball.angle() ) ;
    go_to_point_avoid_collisions.always_turn_to_angle  =  true ;
 
The decision tree:
  This browser can't display the SVG file svg/option_position_defender_state_position_ball_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.time_since_last_seen() > 2000)
{
  
goto turn_to_last_ball_position;
}
else
{
  
/** ball seen inside own penalty area */
if (
(ball.was_seen() )
&& 
(selfloc.distance_to_own_penalty_area( ball.position.field.x() , ball.position.field.y() ) < 100)
)
{
  
goto ball_in_own_penalty_area;
}
else
{
  
/** */
if ( selfloc.distance_to( selfloc.defensive_supporter_position.x( 1500 ) , (selfloc.defensive_supporter_position.y( 1500 ) + @position_defender.y_offset) ) > 750)
{
  
goto far_away_from_position;
}
else
{
  
stay;
}
}
}

State far_away_from_position

If that state is active,
 >  This enumerated output symbol is set:
    head.control_mode  = 
(
(ball.time_since_last_seen() < 800)
&& 
(ball.distance() > 300)
? head.control_mode.search_for_landmarks : head.control_mode.search_for_ball )
 >  The option go_to_point_smart_avoid_collisions is executed. Parameters:
    go_to_point_smart_avoid_collisions.x  =  selfloc.defensive_supporter_position.x( 1500 ) ;
    go_to_point_smart_avoid_collisions.y  =  (selfloc.defensive_supporter_position.y( 1500 ) + @position_defender.y_offset) ;
    go_to_point_smart_avoid_collisions.angle  =  (robot_pose.angle() + ball.angle() ) ;
 
The decision tree:
  This browser can't display the SVG file svg/option_position_defender_state_far_away_from_position.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() > 2000)
{
  
goto turn_to_last_ball_position;
}
else
{
  
/** */
if (
(ball.was_seen() )
&& 
(selfloc.distance_to_own_penalty_area( ball.position.field.x() , ball.position.field.y() ) < 100)
)
{
  
goto ball_in_own_penalty_area;
}
else
{
  
/** */
if ( selfloc.distance_to( selfloc.defensive_supporter_position.x( 1500 ) , (selfloc.defensive_supporter_position.y( 1500 ) + @position_defender.y_offset) ) < 500)
{
  
goto position_ball_seen;
}
else
{
  
stay;
}
}
}

State ball_in_own_penalty_area

If that state is active,
 >  This enumerated output symbol is set:
    head.control_mode  = 
(
(ball.time_since_last_seen() < 800)
&& 
(ball.distance() > 300)
? head.control_mode.defender_head_control : head.control_mode.search_for_ball )
 >  The option go_to_point_avoid_collisions is executed. Parameters:
    go_to_point_avoid_collisions.x  =  (field.own_penalty_area.x() + 300) ;
    go_to_point_avoid_collisions.y  =  ( robot_pose.y() > 0 ? 500 : -500 ) ;
    go_to_point_avoid_collisions.angle  =  (robot_pose.angle() + ball.angle() ) ;
    go_to_point_avoid_collisions.always_turn_to_angle  =  true ;
 
The decision tree:
  This browser can't display the SVG file svg/option_position_defender_state_ball_in_own_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:
 
/** */
if ( ball.time_since_last_seen() > 800)
{
  
goto turn_to_last_ball_position;
}
else
{
  
/** ball seen outside opponent penalty area */
if (
(ball.was_seen() )
&& 
(selfloc.distance_to_own_penalty_area( ball.position.field.x() , ball.position.field.y() ) > 300)
)
{
  
goto position_ball_seen;
}
else
{
  
stay;
}
}

State turn_to_last_ball_position

If that state is active,
 >  The option turn_to_ball is executed.
 
The decision tree:
  This browser can't display the SVG file svg/option_position_defender_state_turn_to_last_ball_position.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() )
{
  
goto position_ball_seen;
}
else
{
  
/** */
if ( action_done)
{
  
goto search_ball;
}
else
{
  
stay;
}
}

State search_ball

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.stand
 
The decision tree:
  This browser can't display the SVG file svg/option_position_defender_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() )
{
  
goto position_ball_seen;
}
else
{
  
/** */
if ( state_time > 2000)
{
  
goto position_ball_not_seen;
}
else
{
  
stay;
}
}

State position_ball_not_seen

If that state is active,
 >  This enumerated output symbol is set:
    head.control_mode  = 
head.control_mode.search_for_landmarks_and_ball
 >  The option go_to_point_avoid_collisions is executed. Parameters:
    go_to_point_avoid_collisions.x  =  (field.own_ground_line.x() + 1200) ;
    go_to_point_avoid_collisions.y  =  @position_defender.y_offset ;
    go_to_point_avoid_collisions.angle  =  0 ;
 
The decision tree:
  This browser can't display the SVG file svg/option_position_defender_state_position_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.was_seen() )
{
  
goto position_ball_seen;
}
else
{
  
/** Didn't see the ball for a long time and teammember saw it in own half */
if (
(selfloc.distance_to( (field.own_ground_line.x() + 1200) , @position_defender.y_offset ) < 500)
&& 
(ball.time_since_last_seen() > 3000)
&& 
(ball.team_position.field.x() < -1000)
&& 
(ball.team_was_seen() )
)
{
  
/** */
if ( ball.team_angle() > 0)
{
  
goto turn_ball_not_seen_left;
}
else
{
  
goto turn_ball_not_seen_right;
}
}
else
{
  
stay;
}
}

State turn_ball_not_seen_left

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  = 
90
 >  This enumerated output symbol is set:
    head.control_mode  = 
head.control_mode.none
 >  This enumerated output symbol is set:
    head.motion_type  = 
head.motion_type.move_to_point
 >  This enumerated output symbol is set:
    head.pid_setting  = 
head.pid_setting.normal
 >  This decimal output symbol is set:
    head.neck_tilt  = 
-30
 >  This decimal output symbol is set:
    head.head_pan  = 
70
 >  This decimal output symbol is set:
    head.head_tilt  = 
0
 >  This decimal output symbol is set:
    head.mouth  = 
0
 
The decision tree:
  This browser can't display the SVG file svg/option_position_defender_state_turn_ball_not_seen_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 ( ball.was_seen() )
{
  
goto position_ball_seen;
}
else
{
  
/** teammember saw ball in other half */
if (
(ball.team_was_seen() )
&& 
(ball.team_position.field.x() > 100)
)
{
  
goto position_ball_not_seen;
}
else
{
  
/** */
if ( selfloc.distance_to( (field.own_ground_line.x() + 1200) , @position_defender.y_offset ) > 1000)
{
  
goto position_ball_not_seen;
}
else
{
  
stay;
}
}
}

State turn_ball_not_seen_right

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  = 
-90
 >  This enumerated output symbol is set:
    head.control_mode  = 
head.control_mode.none
 >  This enumerated output symbol is set:
    head.motion_type  = 
head.motion_type.move_to_point
 >  This enumerated output symbol is set:
    head.pid_setting  = 
head.pid_setting.normal
 >  This decimal output symbol is set:
    head.neck_tilt  = 
-30
 >  This decimal output symbol is set:
    head.head_pan  = 
-70
 >  This decimal output symbol is set:
    head.head_tilt  = 
0
 >  This decimal output symbol is set:
    head.mouth  = 
0
 
The decision tree:
  This browser can't display the SVG file svg/option_position_defender_state_turn_ball_not_seen_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 ( ball.was_seen() )
{
  
goto position_ball_seen;
}
else
{
  
/** teammember saw ball in other half */
if (
(ball.team_was_seen() )
&& 
(ball.team_position.field.x() > 100)
)
{
  
goto position_ball_not_seen;
}
else
{
  
/** */
if ( selfloc.distance_to( (field.own_ground_line.x() + 1200) , @position_defender.y_offset ) > 1000)
{
  
goto position_ball_not_seen;
}
else
{
  
stay;
}
}
}