Option go_to_point_smart

Go to a specific position on the field

Parameters of that option:
ParameterTypeMeasureRangeDescription
go_to_point_smart.xdecimalmm-3000..3000x position of the point to walk to on the field
go_to_point_smart.ydecimalmm-2000..2000y position of the point to walk to on the field
go_to_point_smart.angledecimaldeg-180..180desired angle at position
go_to_point_smart.avoid_obstaclesbooleantrue/ falseuse obstacle avoidance when far from destination

State Machine

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



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

State walkAndTurn

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_smart.x , @go_to_point_smart.y ) ) * 200)
 >  This decimal output symbol is set:
    motion.walk_speed.y  = 
(sin( selfloc.angle_to( @go_to_point_smart.x , @go_to_point_smart.y ) ) * 200)
 >  This decimal output symbol is set:
    motion.walk_speed.rot  = 
normalize( (@go_to_point_smart.angle - robot_pose.angle() ) )
 >  This decimal output symbol is set:
    strategy.destination.x  = 
@go_to_point_smart.x
 >  This decimal output symbol is set:
    strategy.destination.y  = 
@go_to_point_smart.y
 
The decision tree:
  This browser can't display the SVG file svg/option_go_to_point_smart_state_walkAndTurn.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_smart.x , @go_to_point_smart.y ) > 1300)
{
  
goto far_from_destination;
}
else
{
  
/** */
if ( selfloc.distance_to( @go_to_point_smart.x , @go_to_point_smart.y ) < 70)
{
  
goto turnOnly;
}
else
{
  
/** */
if ( abs( normalize( (@go_to_point_smart.angle - robot_pose.angle() ) ) ) < 5)
{
  
goto walkOnly;
}
else
{
  
stay;
}
}
}

State walkOnly

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_smart.x , @go_to_point_smart.y ) ) * 200)
 >  This decimal output symbol is set:
    motion.walk_speed.y  = 
(sin( selfloc.angle_to( @go_to_point_smart.x , @go_to_point_smart.y ) ) * 200)
 >  This decimal output symbol is set:
    motion.walk_speed.rot  = 
0
 >  This decimal output symbol is set:
    strategy.destination.x  = 
@go_to_point_smart.x
 >  This decimal output symbol is set:
    strategy.destination.y  = 
@go_to_point_smart.y
 
The decision tree:
  This browser can't display the SVG file svg/option_go_to_point_smart_state_walkOnly.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_smart.x , @go_to_point_smart.y ) > 1300)
{
  
goto far_from_destination;
}
else
{
  
/** */
if ( selfloc.distance_to( @go_to_point_smart.x , @go_to_point_smart.y ) < 70)
{
  
goto stop;
}
else
{
  
/** */
if ( abs( normalize( (@go_to_point_smart.angle - robot_pose.angle() ) ) ) > 10)
{
  
goto walkAndTurn;
}
else
{
  
stay;
}
}
}

State turnOnly

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  = 
0
 >  This decimal output symbol is set:
    motion.walk_speed.y  = 
0
 >  This decimal output symbol is set:
    motion.walk_speed.rot  = 
normalize( (@go_to_point_smart.angle - robot_pose.angle() ) )
 
The decision tree:
  This browser can't display the SVG file svg/option_go_to_point_smart_state_turnOnly.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_smart.x , @go_to_point_smart.y ) > 1300)
{
  
goto far_from_destination;
}
else
{
  
/** */
if ( selfloc.distance_to( @go_to_point_smart.x , @go_to_point_smart.y ) > 100)
{
  
goto walkAndTurn;
}
else
{
  
/** */
if ( abs( normalize( (@go_to_point_smart.angle - robot_pose.angle() ) ) ) < 5)
{
  
goto stop;
}
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_smart_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_smart.x , @go_to_point_smart.y ) > 1300)
{
  
goto far_from_destination;
}
else
{
  
/** */
if ( selfloc.distance_to( @go_to_point_smart.x , @go_to_point_smart.y ) > 100)
{
  
goto walkOnly;
}
else
{
  
/** */
if ( abs( normalize( (@go_to_point_smart.angle - robot_pose.angle() ) ) ) > 10)
{
  
goto turnOnly;
}
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_smart.x ;
    go_to_point_avoid_obstacles.y  =  @go_to_point_smart.y ;
    go_to_point_avoid_obstacles.tolerance  =  ( @go_to_point_smart.avoid_obstacles ? 150 : 0 ) ;
 
The decision tree:
  This browser can't display the SVG file svg/option_go_to_point_smart_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 ( selfloc.distance_to( @go_to_point_smart.x , @go_to_point_smart.y ) > 1300)
{
  
goto far_from_destination;
}
else
{
  
/** */
if ( selfloc.distance_to( @go_to_point_smart.x , @go_to_point_smart.y ) < 900)
{
  
goto walkAndTurn;
}
else
{
  
stay;
}
}