Option go_to_point

Go to a specific position on the field

Parameters of that option:
ParameterTypeMeasureRangeDescription
go_to_point.xdecimalmm-3000..3000x position of the point to walk to on the field
go_to_point.ydecimalmm-2000..2000y position of the point to walk to on the field
go_to_point.angledecimaldeg-180..180desired angle at position
go_to_point.speeddecimalmm/swalking speed, defaults to max speed
go_to_point.always_turn_to_anglebooleantrue/ falsealways turn to the desired angle instead of turning to the point
go_to_point.avoid_obstaclesbooleantrue/ falseuse obstacle avoidance when far from destination

State Machine

This browser can't display the SVG file svg/option_go_to_point.svg.



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

State walk

If that state is active,
 >  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  = 
(cos( selfloc.angle_to( @go_to_point.x , @go_to_point.y ) ) * ( @go_to_point.speed == 0 ? 400 : @go_to_point.speed ))
 >  This decimal output symbol is set:
    motion.walk_speed.y  = 
(sin( selfloc.angle_to( @go_to_point.x , @go_to_point.y ) ) * ( @go_to_point.speed == 0 ? 400 : @go_to_point.speed ))
 >  This decimal output symbol is set:
    motion.walk_speed.rot  = 
normalize( (@go_to_point.angle - robot_pose.angle() ) )
 >  This decimal output symbol is set:
    strategy.destination.x  = 
@go_to_point.x
 >  This decimal output symbol is set:
    strategy.destination.y  = 
@go_to_point.y
 
The decision tree:
  This browser can't display the SVG file svg/option_go_to_point_state_walk.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 (
(selfloc.distance_to( @go_to_point.x , @go_to_point.y ) < 100)
&& 
(abs( normalize( (@go_to_point.angle - robot_pose.angle() ) ) ) < 10)
)
{
  
goto stop;
}
else
{
  
/** */
if (
(
!(@go_to_point.always_turn_to_angle)
)
&& 
(selfloc.distance_to( @go_to_point.x , @go_to_point.y ) > 1000)
)
{
  
goto far_from_destination;
}
else
{
  
stay;
}
}

State stop

This state is a target state.



If that state is active,
 >  This enumerated output symbol is set:
    motion.type  = 
motion.type.stand
 
The decision tree:
  This browser can't display the SVG file svg/option_go_to_point_state_stop.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 (
(selfloc.distance_to( @go_to_point.x , @go_to_point.y ) > 200)
|| 
(abs( normalize( (@go_to_point.angle - robot_pose.angle() ) ) ) > 30)
)
{
  
goto walk;
}
else
{
  
stay;
}

State far_from_destination

If that state is active,
 >  The option go_to_point_avoid_obstacles is executed. Parameters:
    go_to_point_avoid_obstacles.x  =  @go_to_point.x ;
    go_to_point_avoid_obstacles.y  =  @go_to_point.y ;
    go_to_point_avoid_obstacles.speed  =  @go_to_point.speed ;
    go_to_point_avoid_obstacles.tolerance  =  ( @go_to_point.avoid_obstacles ? 150 : 0 ) ;
 
The decision tree:
  This browser can't display the SVG file svg/option_go_to_point_state_far_from_destination.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 (
(@go_to_point.always_turn_to_angle)
|| 
(selfloc.distance_to( @go_to_point.x , @go_to_point.y ) < 700)
)
{
  
goto walk;
}
else
{
  
stay;
}