| align | Index |
Overview
The align primitive puts the robot in a known orientation to a wall. An align primitive is a sequence of two maneuvers. The first maneuver is a rotational alignment. In this maneuver, the robot pivots until the specified front sensor is parallel to the wall. It minimizes the front sensor reading in order to get the proper alignment. The second maneuver is a straight alignment. In this meaneuver, the robot moves forward or backward to reach a desired distance between the wall and the specified front sensor. This primitive is useful as a preparation step for the hug primitive. Using the align primitive when the robot is in front of something other than a wall may have dubious results. The monitor keeps track of obstructions, edges, stalls, and other boundary conditions. The current speed setting for the robot is used for the motion.
A mode parameter may be used to make the robot perform both the rotational and straight alignment maneuvers, just the rotational maneuver, or just the straight maneuver. Performing each maneuver separately makes it possible to determine the angle of rotation and the straight travel distance. This may be useful in mapping applications. Lowering the speed of the robot prior to executing an align maneuver is recommended in order to get the best results. A typical speed setting for an align maneuver is 3% to 5% of the maximum velocity for the robot.
Defined values that may be used as align parameters can be found in the aGarciaDefs.tea file in the aSystem subfolder of the brainstem directory tree.
Return Status
This primitive returns either a succesful completion code, aGARCIA_ERRFLAG_NORMAL , or the code for the condition that terminated the motion.
Property Inheritance
align inherits Behavior inherits Object properties.
| Properties |
| side mode range |
side (int) Which sensor to line up with the wall. Using the defined value aGARCIA_MOTO_ARANGE_FRONT_RIGHT will align the front right sensor with the wall. Using the defined value aGARCIA_MOTO_ARANGE_FRONT_LEFT will align the front left sensor with the wall. |
mode (int) The type of align maneuver. Using the defined value aGARCIA_ALIGNMODE_DEFAULT will make the robot perform a rotational alignment followed by a straight alignment. Using the defined value aGARCIA_ALIGNMODE_ROTATE will make the robot perform a rotational alignment only. Using the defined value aGARCIA_ALIGNMODE_STRAIGHT will make the robot perform a straight alignment only. |
range (float) The desired range for the align primitive. This is the range value for the straight alignment maneuver. The value must be in units specified by the Garcia Object's distance-units property. This range value is the distance between the midpoint and wall. |