Option kst-test

test the kst

Parameters of that option:
ParameterMeasureRangeDescription
kst-test.angledeg-180..180The angle where to kick relative to the robot
kst-test.angle-widthdeg-180..180The width of the kick angle range
kst-test.y-offsetint-1000..1000The y offset the robot is approaching the ball with.
kst-test.table-idint0..The id of the kick selction table to be used
kst-test.action-idint0..action to test
kst-test.starttimeint0..maxwaittime for test

State Machine

This browser can't display the SVG file svg/option_kst-test.svg.



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

State wait

If that state is active,
 >  The basic behavior stand is executed.
 
 >  These output symbols are set:
 
    head-control-mode  =  head-control-mode.stay-as-forced
 
The decision tree:
  This browser can't display the SVG file svg/option_kst-test_state_wait.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 (
(robot-state.head-button-pressed-short)
&& 
(time-of-state-execution > 1000)
)   // kick possible
{
  
transition-to-state(approach-ball);
}
else if (
(::kst-test.starttime > 0)
&& 
(time-of-state-execution > ::kst-test.starttime)
)   //
{
  
transition-to-state(approach-ball);
}
else
{
  
transition-to-state(wait);
}

State approach-ball

If that state is active,
 >  The option approach-ball is executed. Parameters:
 
    approach-ball.look-at-ball-distance  =  500 ;
    approach-ball.slow-down-distance  =  ( ball.play-ball-precisely ? 330 : 300 ) ;
    approach-ball.slow-speed  =  ( ball.play-ball-precisely ? 150 : 250 ) ;
    approach-ball.y-offset  =  ::kst-test.y-offset ;
 
The decision tree:
  This browser can't display the SVG file svg/option_kst-test_state_approach-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.just-seen)
&& 
(abs( ball.seen.relative-speed.y ) < 150)
&& 
(ball.seen.relative-speed.x < 150)
&& 
(retrieve-kick( ::kst-test.angle , ::kst-test.angle-width , ::kst-test.table-id ) == ::kst-test.action-id)
&& 
(save-value( 0 , ball.seen.relative-x ) == 0)
&& 
(save-value( 1 , ball.seen.relative-y ) == 0)
)   // kick possible
{
  
transition-to-state(kick);
}
else
{
  
transition-to-state(approach-ball);
}

State kick

If that state is active,
 >  The option kst-execute-kick is executed. Parameters:
 
    kst-execute-kick.action  =  retrieve-kick( ::kst-test.angle , ::kst-test.angle-width , ::kst-test.table-id ) ;
 
 >  These output symbols are set:
 
    strategy.ball-handling  =  performing-a-kick
 
The decision tree:
  This browser can't display the SVG file svg/option_kst-test_state_kick.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 (subsequent-option-reached-target-state)   // kick finished
{
  
transition-to-state(record);
}
else
{
  
transition-to-state(kick);
}

State record

If that state is active,
 >  The basic behavior stand is executed.
 
 >  These output symbols are set:
 
    head-control-mode  =  head-control-mode.search-for-ball
 
The decision tree:
  This browser can't display the SVG file svg/option_kst-test_state_record.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 (
(robot-state.head-button-pressed-short)
&& 
(kst.sendRecord( get-value( 2 ) , get-value( 0 ) , get-value( 1 ) , get-value( 0 ) , get-value( 1 ) , ball.seen.relative-x , ball.seen.relative-y ) == 0)
)   // kick finished
{
  
transition-to-state(approach-ball);
}
else if (robot-state.any-back-button-pressed-short-and-released)   //
{
  
transition-to-state(approach-ball);
}
else
{
  
transition-to-state(record);
}