Option vlc2-shooter

The VLC-shooter (2.version)

State Machine

This browser can't display the SVG file svg/option_vlc2-shooter.svg.



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

State init

If that state is active,
 >  The basic behavior stand is executed.
 
 >  These output symbols are set:
 
    head-control-mode  =  head-control-mode.search-auto
 
The decision tree:
  This browser can't display the SVG file svg/option_vlc2-shooter_state_init.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 (
(time-of-state-execution > 1000)
&& 
(
(robot-state.head-button-pressed-short)
|| 
(robot-state.fore-back-button-pressed-short)
|| 
(robot-state.middle-back-button-pressed-short)
|| 
(robot-state.hind-back-button-pressed-short)
)
)   // any button pressed short
{
  
transition-to-state(kickoff);
}
else
{
  
transition-to-state(init);
}

State kickoff

If that state is active,
 >  The option get-to-position-and-avoid-obstacles is executed. Parameters:
 
    get-to-position-and-avoid-obstacles.x  =  -200 ;
    get-to-position-and-avoid-obstacles.y  =  0 ;
    get-to-position-and-avoid-obstacles.destination-angle  =  0 ;
    get-to-position-and-avoid-obstacles.max-speed  =  450 ;
    get-to-position-and-avoid-obstacles.no-obstacle-avoidance-distance  =  600 ;
    get-to-position-and-avoid-obstacles.avoid-penalty-areas  =  0 ;
    get-to-position-and-avoid-obstacles.avoidance-level  =  1 ;
 
 >  These output symbols are set:
 
    head-control-mode  =  head-control-mode.search-for-landmarks
 
The decision tree:
  This browser can't display the SVG file svg/option_vlc2-shooter_state_kickoff.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 (
(time-of-state-execution > 1000)
&& 
(robot-state.head-button-pressed-short)
)   // head button pressed for 3 sec
{
  
transition-to-state(pauseAndBarking);
}
else if (
(ball.just-seen)
|| 
(distance-to( -200 , 0 ) < 500)
)   //
{
  
transition-to-state(playing);
}
else
{
  
transition-to-state(kickoff);
}

State pauseAndBarking

If that state is active,
 >  The basic behavior stand is executed.
 
 >  These output symbols are set:
 
    sound-request  =  sound-request.bark1
    head-control-mode  =  head-control-mode.look-between-feet
 
The decision tree:
  This browser can't display the SVG file svg/option_vlc2-shooter_state_pauseAndBarking.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 (time-of-state-execution > 1200)   //
{
  
transition-to-state(pause);
}
else
{
  
transition-to-state(pauseAndBarking);
}

State pause

If that state is active,
 >  The basic behavior stand is executed.
 
 >  These output symbols are set:
 
    sound-request  =  sound-request.bing01
    head-control-mode  =  head-control-mode.search-auto
 
The decision tree:
  This browser can't display the SVG file svg/option_vlc2-shooter_state_pause.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 (
(time-of-state-execution > 500)
&& 
(
(robot-state.head-button-pressed-short)
|| 
(robot-state.fore-back-button-pressed-short)
|| 
(robot-state.middle-back-button-pressed-short)
|| 
(robot-state.hind-back-button-pressed-short)
)
)   // any button pressed short
{
  
transition-to-state(playing);
}
else
{
  
transition-to-state(pause);
}

State playing

If that state is active,
 >  The option handle-ball-vlc2-shooter is executed.
 
 >  These output symbols are set:
 
    ball.precision  =  precision.penalty-shooter
    head-control-mode  =  head-control-mode.search-auto
 
The decision tree:
  This browser can't display the SVG file svg/option_vlc2-shooter_state_playing.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 (
(time-of-state-execution > 1000)
&& 
(robot-state.head-button-pressed-short)
)   // head button pressed for 3 sec
{
  
transition-to-state(pauseAndBarking);
}
else if (
(time-of-state-execution > 1000)
&& 
(
(robot-state.fore-back-button-pressed-short)
|| 
(robot-state.middle-back-button-pressed-short)
|| 
(robot-state.hind-back-button-pressed-short)
)
)   // one of the back buttons was pressed as an indication for a goal
{
  
transition-to-state(kickoff);
}
else if (ball.time-since-last-seen > 3500)   // ball not seen for a long time
{
  
transition-to-state(search);
}
else
{
  
transition-to-state(playing);
}
If that state is active,
 >  The option vlc2-search-for-ball is executed.
 
The decision tree:
  This browser can't display the SVG file svg/option_vlc2-shooter_state_search.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 (
(time-of-state-execution > 100)
&& 
(robot-state.head-button-pressed-short)
)   // head button pressed for 3 sec
{
  
transition-to-state(pauseAndBarking);
}
else if (
(time-of-state-execution > 100)
&& 
(
(robot-state.fore-back-button-pressed-short)
|| 
(robot-state.middle-back-button-pressed-short)
|| 
(robot-state.hind-back-button-pressed-short)
)
)   // one of the back buttons was pressed as an indication for a goal
{
  
transition-to-state(kickoff);
}
else if (ball.just-seen)   // ball was just seen
{
  
transition-to-state(playing);
}
else if (
(time-of-state-execution > 7000)
&& 
(save-value( 123 , (-1300 + (random * 2600)) ) == 0)
)   // ball wasn't seen for a very long time (use the save/get hack to fix a random number for the positioning
{
  
transition-to-state(confusedRepositioning);
}
else
{
  
transition-to-state(search);
}

State confusedRepositioning

If that state is active,
 >  The option get-to-position-and-avoid-obstacles is executed. Parameters:
 
    get-to-position-and-avoid-obstacles.x  =  500 ;
    get-to-position-and-avoid-obstacles.y  =  get-value( 123 ) ;
    get-to-position-and-avoid-obstacles.destination-angle  =  0 ;
    get-to-position-and-avoid-obstacles.max-speed  =  450 ;
    get-to-position-and-avoid-obstacles.no-obstacle-avoidance-distance  =  700 ;
    get-to-position-and-avoid-obstacles.avoid-penalty-areas  =  0 ;
    get-to-position-and-avoid-obstacles.avoidance-level  =  1 ;
 
 >  These output symbols are set:
 
    head-control-mode  =  head-control-mode.search-auto
 
The decision tree:
  This browser can't display the SVG file svg/option_vlc2-shooter_state_confusedRepositioning.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 (
(time-of-state-execution > 100)
&& 
(robot-state.head-button-pressed-short)
)   // head button pressed for 3 sec
{
  
transition-to-state(pauseAndBarking);
}
else if (
(time-of-state-execution > 100)
&& 
(
(robot-state.fore-back-button-pressed-short)
|| 
(robot-state.middle-back-button-pressed-short)
|| 
(robot-state.hind-back-button-pressed-short)
)
)   // one of the back buttons was pressed as an indication for a goal
{
  
transition-to-state(kickoff);
}
else if (ball.just-seen)   // ball was seen
{
  
transition-to-state(playing);
}
else if (distance-to( 500 , get-value( 123 ) ) < 300)   // reached the target position
{
  
transition-to-state(search);
}
else
{
  
transition-to-state(confusedRepositioning);
}

State vlc2-timeout-kick

If that state is active,
 >  The option kick-vlc2 is executed.
 
 >  These output symbols are set:
 
    ball.precision  =  precision.penalty-shooter
    head-control-mode  =  head-control-mode.search-for-ball
 
The decision tree:
  This browser can't display the SVG file svg/option_vlc2-shooter_state_vlc2-timeout-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 (
(
(robot-state.head-button-pressed-short)
|| 
(robot-state.fore-back-button-pressed-short)
|| 
(robot-state.middle-back-button-pressed-short)
|| 
(robot-state.hind-back-button-pressed-short)
)
&& 
(time-of-state-execution > 1000)
)   // any button pressed short
{
  
transition-to-state(pauseAndBarking);
}
else
{
  
transition-to-state(vlc2-timeout-kick);
}