# Option get-to-position-and-avoid-obstacles Gets to a position and avoids obstacles on the way there Parameters of that option:
Parameter | Measure | Range | Description
get-to-position-and-avoid-obstacles.x | mm | -2500..2500 | The destination x position
get-to-position-and-avoid-obstacles.y | mm | -2000..2000 | The destination y position
get-to-position-and-avoid-obstacles.destination-angle | deg | -180..180 | The angle at the destination
get-to-position-and-avoid-obstacles.max-speed | mm/s | 0..300 | The maximum walk speed that is used
get-to-position-and-avoid-obstacles.no-obstacle-avoidance-distance | mm | 0..2000 | If closer to the destination than this distance, no obstacles are avoided
get-to-position-and-avoid-obstacles.avoid-penalty-areas | boolean | 0,1 | If 1, the penalty areas shall be avoided
get-to-position-and-avoid-obstacles.avoidance-level | int | 0|1|2 | 0 for weak avoidance, 2 for strong avoidance
## State Machine ## State near-destination
If that state is active,
> | The basic behavior go-to-point is executed. Parameters:
| go-to-point.x | = | ::get-to-position-and-avoid-obstacles.x ;
| go-to-point.y | = | ::get-to-position-and-avoid-obstacles.y ;
| go-to-point.destination-angle | = | ::get-to-position-and-avoid-obstacles.destination-angle ;
| go-to-point.distance-remain | = | 80 ;
| go-to-point.angle-remain | = | 10 ;
| go-to-point.max-speed | = | ::get-to-position-and-avoid-obstacles.max-speed ;
The decision tree:
Pseudo code of the decision tree:
if ( | distance-to( ::get-to-position-and-avoid-obstacles.x , ::get-to-position-and-avoid-obstacles.y ) > (::get-to-position-and-avoid-obstacles.no-obstacle-avoidance-distance + 250) | ) | // far from destination
{
transition-to-state(far-from-destination);
}
else if ( |
( | robot-pose.validity > 0.4 | )
&& |
( | distance-to( ::get-to-position-and-avoid-obstacles.x , ::get-to-position-and-avoid-obstacles.y ) < 80 | )
&& |
( | robot-pose.angle < (::get-to-position-and-avoid-obstacles.destination-angle + 10) | )
&& |
( | robot-pose.angle > (::get-to-position-and-avoid-obstacles.destination-angle - 10) | )
| ) | // arrrived at position
{
transition-to-state(at-destination);
}
else
{
transition-to-state(near-destination);
}
## State far-from-destination
If that state is active,
> | The basic behavior go-to-point-and-avoid-obstacles is executed. Parameters:
| go-to-point-and-avoid-obstacles.x | = | ::get-to-position-and-avoid-obstacles.x ;
| go-to-point-and-avoid-obstacles.y | = | ::get-to-position-and-avoid-obstacles.y ;
| go-to-point-and-avoid-obstacles.max-speed | = | ::get-to-position-and-avoid-obstacles.max-speed ;
| go-to-point-and-avoid-obstacles.avoidance-level | = | ::get-to-position-and-avoid-obstacles.avoidance-level ;
The decision tree:
Pseudo code of the decision tree:
if ( | distance-to( ::get-to-position-and-avoid-obstacles.x , ::get-to-position-and-avoid-obstacles.y ) < ::get-to-position-and-avoid-obstacles.no-obstacle-avoidance-distance | ) | // near destination
{
transition-to-state(near-destination);
}
else
{
transition-to-state(far-from-destination);
}
## State at-destination
This state is a target state.
If that state is active,
> | The basic behavior stand is executed.
The decision tree:
Pseudo code of the decision tree:
if ( |
( | distance-to( ::get-to-position-and-avoid-obstacles.x , ::get-to-position-and-avoid-obstacles.y ) > 50 | )
( | robot-pose.angle > (::get-to-position-and-avoid-obstacles.destination-angle + 6) | )
( | robot-pose.angle < (::get-to-position-and-avoid-obstacles.destination-angle - 6) | )
| ) | // not at position
{
transition-to-state(near-destination);
}
else
{
transition-to-state(at-destination);
}