Option grab_and_dribble

* grab the ball and dribble it in a given direction

Parameters of that option:
ParameterTypeMeasureRangeDescription
grab_and_dribble.angledecimaldeg-180..180The angle where to dribble the ball to relative to the robot
grab_and_dribble.angle_widthdecimaldeg-180..180The width of the angle where to dribble the ball to
grab_and_dribble.time_limitdecimalms* The time limit for dribbling the ball, * if 0, a rule conformant default value is applied * if negative, time is unlimited
grab_and_dribble.left_rightdecimal* Turn direction * > 0 left * < 0 right * == 0 dont care
grab_and_dribble.forward_kickbooleantrue/ falsekick the ball forward when the correct angle is reached
grab_and_dribble.dribble_forwardbooleantrue/ falsedribble the ball forward for the remaining time when the correct angle is reached
grab_and_dribble.always_stopbooleantrue/ falsealways stop the ball after dribbling
grab_and_dribble.regrabbooleantrue/ falsetrue for regrabbing directl after stop

State Machine

This browser can't display the SVG file svg/option_grab_and_dribble.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_ball is executed.
 >  This decimal output symbol is set:
    strategy.last_grab_angle  = 
robot_pose.angle()
 >  This boolean output symbol is set:
    strategy.ball_was_kicked  = 
false
 
The decision tree:
  This browser can't display the SVG file svg/option_grab_and_dribble_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:
 
/** */
if ( action_done)
{
  
goto dribble;
}
else
{
  
stay;
}

State dribble

If that state is active,
 >  The option dribble is executed. Parameters:
    dribble.angle  =  @grab_and_dribble.angle ;
    dribble.angle_width  =  @grab_and_dribble.angle_width ;
    dribble.left_right  =  @grab_and_dribble.left_right ;
    dribble.dribble_forward  =  @grab_and_dribble.dribble_forward ;
    dribble.forward_kick  = 
(@grab_and_dribble.forward_kick)
&& 
(
(@grab_and_dribble.time_limit < 0)
|| 
(state_time < 1000)
)
;
 
The decision tree:
  This browser can't display the SVG file svg/option_grab_and_dribble_state_dribble.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:
 
/** dribble option done */
if ( action_done)
{
  
/** dribble is finished and ball is still grabbed */
if ( strategy.ball_is_grabbed)
{
  
goto after_dribble;
}
else
{
  
goto grab;
}
}
else
{
  
/** */
if ( state_time < 600)
{
  
stay;
}
else
{
  
/** if ball is currently being kicked then do not abort */
if (
(executed_motion.type() == motion.type.special_action)
|| 
(strategy.ball_was_kicked)
)
{
  
stay;
}
else
{
  
/** ball lost, check psd */
if (
(sensor.time_since_something_was_in_front_of_chest() > 200)
|| 
(ball.was_seen() )
)
{
  
goto ball_lost;
}
else
{
  
/** time is up */
if (
(
(@grab_and_dribble.time_limit > 0)
&& 
(state_time > @grab_and_dribble.time_limit)
)
|| 
(
(@grab_and_dribble.time_limit == 0)
&& 
(state_time > 1500)
)
)
{
  
goto after_dribble;
}
else
{
  
stay;
}
}
}
}
}

State ball_lost

If that state is active,
 >  This boolean output symbol is set:
    strategy.ball_was_kicked  = 
true
 >  This boolean output symbol is set:
    strategy.ball_is_grabbed  = 
false
 >  This enumerated output symbol is set:
    head.control_mode  = 
head.control_mode.look_down
 >  This enumerated output symbol is set:
    motion.type  = 
motion.type.walk
 >  This enumerated output symbol is set:
    motion.walk_type  = 
motion.walk_type.walk_with_ball
 >  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  = 
0
 
The decision tree:
  This browser can't display the SVG file svg/option_grab_and_dribble_state_ball_lost.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 grab;
}
else
{
  
/** */
if ( state_time > 500)
{
  
goto turn_back;
}
else
{
  
stay;
}
}

State turn_back

If that state is active,
 >  This boolean output symbol is set:
    strategy.ball_was_kicked  = 
true
 >  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  = 
normalize( (strategy.last_grab_angle - robot_pose.angle() ) )
 
The decision tree:
  This browser can't display the SVG file svg/option_grab_and_dribble_state_turn_back.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 grab;
}
else
{
  
/** */
if ( state_time > 2000)
{
  
goto grab;
}
else
{
  
stay;
}
}

State after_dribble

If that state is active,
 >  The option after_dribble is executed. Parameters:
    after_dribble.stop_ball  = 
(abs( @grab_and_dribble.angle ) > (@grab_and_dribble.angle_width + 60))
|| 
(@grab_and_dribble.always_stop)
;
    after_dribble.regrab  =  @grab_and_dribble.regrab ;
 >  This decimal output symbol is set:
    strategy.last_grab_angle  = 
robot_pose.angle()
 
The decision tree:
  This browser can't display the SVG file svg/option_grab_and_dribble_state_after_dribble.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 ( action_done)
{
  
/** */
if ( strategy.ball_is_grabbed)
{
  
goto dribble;
}
else
{
  
goto finished;
}
}
else
{
  
stay;
}

State finished

This state is a target state.



If that state is active,
 >  The option grab_ball is executed.
 
The decision tree:
  This browser can't display the SVG file svg/option_grab_and_dribble_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:
 
goto grab;