# Option go-to-kickoff-position Lets the robot walk to a specified kickoff position Parameters of that option:
Parameter | Measure | Range | Description
go-to-kickoff-position.x | mm | -2500..2500 | The destination x position on the field.
go-to-kickoff-position.y | mm | -1500..1500 | The destination y position on the field.
go-to-kickoff-position.angle | mm | -2500..2500 | The destination angle on the field.
## State Machine ## State localize
If that state is active,
> | The basic behavior stand is executed.
> | These output symbols are set:
| head-control-mode | = | head-control-mode.directed-scan-for-obstacles
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution < 3000 | ) | // state running less than 3 seconds
{
transition-to-state(localize);
}
else if ( | time-of-state-execution > 8000 | ) | // waited too long
{
transition-to-state(turn);
}
else if ( | robot-pose.validity < 0.4 | ) | // not localized
{
transition-to-state(localize);
}
else
{
transition-to-state(go);
}
## State turn
If that state is active,
> | The basic behavior walk is executed. Parameters:
| walk.type | = | walk-type.normal ;
| walk.speed-x | = | 0 ;
| walk.speed-y | = | 0 ;
| walk.rotation-speed | = | 90 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.look-straight-ahead
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution > 2000 | ) | // the robot turned for 180 degrees
{
transition-to-state(localize);
}
else
{
transition-to-state(turn);
}
## State runback
If that state is active,
> | The option get-to-position-and-avoid-obstacles is executed. Parameters:
| get-to-position-and-avoid-obstacles.x | = | ::go-to-kickoff-position.x ;
| get-to-position-and-avoid-obstacles.y | = | ::go-to-kickoff-position.y ;
| get-to-position-and-avoid-obstacles.destination-angle | = | ::go-to-kickoff-position.angle ;
| get-to-position-and-avoid-obstacles.max-speed | = | 600 ;
| 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 | = | 2 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.directed-scan-for-obstacles
The decision tree:
Pseudo code of the decision tree:
if ( | distance-to( ::go-to-kickoff-position.x , ::go-to-kickoff-position.y ) < 500 | ) | //
{
transition-to-state(go);
}
else if ( | robot-pose.validity < 0.2 | ) | //
{
transition-to-state(localize);
}
else if ( | time-of-state-execution < 2500 | ) | // state running less than 2 seconds
{
transition-to-state(runback);
}
else if ( |
( | obstacles.collision-aggregate | )
&& |
( | distance-to( ::go-to-kickoff-position.x , ::go-to-kickoff-position.y ) > 500 | )
| ) | // collosion?
{
transition-to-state(collision);
}
else
{
transition-to-state(runback);
}
## State go
If that state is active,
> | The option get-to-position-and-avoid-obstacles is executed. Parameters:
| get-to-position-and-avoid-obstacles.x | = | ::go-to-kickoff-position.x ;
| get-to-position-and-avoid-obstacles.y | = | ::go-to-kickoff-position.y ;
| get-to-position-and-avoid-obstacles.destination-angle | = | ::go-to-kickoff-position.angle ;
| get-to-position-and-avoid-obstacles.max-speed | = | ( distance-to( ::go-to-kickoff-position.x , ::go-to-kickoff-position.y ) < 300 ? 100 : 300 ) ;
| get-to-position-and-avoid-obstacles.no-obstacle-avoidance-distance | = | 500 ;
| get-to-position-and-avoid-obstacles.avoid-penalty-areas | = | 0 ;
| get-to-position-and-avoid-obstacles.avoidance-level | = | 0 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.directed-scan-for-obstacles
The decision tree:
Pseudo code of the decision tree:
if ( | distance-to( ::go-to-kickoff-position.x , ::go-to-kickoff-position.y ) > 1000 | ) | //
{
transition-to-state(runback);
}
else if ( | robot-pose.validity < 0.2 | ) | //
{
transition-to-state(localize);
}
else if ( |
( | kickoff.role == kickoff.role.kickoff-striker | )
&& |
( | distance-to( ::go-to-kickoff-position.x , ::go-to-kickoff-position.y ) < 350 | )
| ) | // striker near center of field
{
transition-to-state(position-exactly);
}
else if ( | time-of-state-execution < 2500 | ) | // state running less than 2 seconds
{
transition-to-state(go);
}
else if ( |
( | obstacles.collision-aggregate | )
&& |
( | distance-to( ::go-to-kickoff-position.x , ::go-to-kickoff-position.y ) > 500 | )
| ) | // collosion?
{
transition-to-state(collision);
}
else
{
transition-to-state(go);
}
## State collision
If that state is active,
> | The basic behavior do-nothing is executed.
> | These output symbols are set:
| head-control-mode | = | head-control-mode.directed-scan-for-obstacles
The decision tree:
Pseudo code of the decision tree:
if ( |
( | obstacles.consecutive-collision-time-front-left > 1000 | )
( | obstacles.consecutive-collision-time-hind-left > 1000 | )
| ) | //
{
transition-to-state(collision-left-move-right);
}
else if ( |
( | obstacles.consecutive-collision-time-front-right > 1000 | )
( | obstacles.consecutive-collision-time-hind-right > 1000 | )
| ) | //
{
transition-to-state(collision-right-move-left);
}
else
{
transition-to-state(go);
}
## State collision-left-move-right
If that state is active,
> | The basic behavior walk is executed. Parameters:
| walk.type | = | walk-type.normal ;
| walk.speed-x | = | 0 ;
| walk.speed-y | = | -250 ;
| walk.rotation-speed | = | 0 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.look-left
| sound-request | = | sound-request.growl2
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution < 250 | ) | //
{
transition-to-state(collision-left-move-right);
}
else if ( | time-of-state-execution > 750 | ) | //
{
transition-to-state(go);
}
else if ( |
( | obstacles.consecutive-collision-time-front-left > 500 | )
( | obstacles.consecutive-collision-time-hind-left > 500 | )
| ) | //
{
transition-to-state(collision-left-move-right);
}
else
{
transition-to-state(go);
}
## State collision-right-move-left
If that state is active,
> | The basic behavior walk is executed. Parameters:
| walk.type | = | walk-type.normal ;
| walk.speed-x | = | 0 ;
| walk.speed-y | = | 250 ;
| walk.rotation-speed | = | 0 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.look-right
| sound-request | = | sound-request.growl2
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution < 250 | ) | //
{
transition-to-state(collision-right-move-left);
}
else if ( | time-of-state-execution > 750 | ) | //
{
transition-to-state(go);
}
else if ( |
( | obstacles.consecutive-collision-time-front-right > 500 | )
( | obstacles.consecutive-collision-time-hind-right > 500 | )
| ) | //
{
transition-to-state(collision-right-move-left);
}
else
{
transition-to-state(go);
}
## State position-exactly
If that state is active,
> | The basic behavior go-to-point is executed. Parameters:
| go-to-point.x | = | ::go-to-kickoff-position.x ;
| go-to-point.y | = | ::go-to-kickoff-position.y ;
| go-to-point.destination-angle | = | ::go-to-kickoff-position.angle ;
| go-to-point.distance-remain | = | 10 ;
| go-to-point.angle-remain | = | 7 ;
| go-to-point.max-speed | = | 150 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.search-for-landmarks
The decision tree:
Pseudo code of the decision tree:
if ( |
( |
!( | kickoff.role == kickoff.role.kickoff-striker | )
| )
( | distance-to( ::go-to-kickoff-position.x , ::go-to-kickoff-position.y ) > 350 | )
| ) | // striker near center of field
{
transition-to-state(go);
}
else
{
transition-to-state(position-exactly);
}