hugIndex

Overview

The hug primitive makes the robot move forward while staying a desired distance from objects off to the side, such as walls.  The robot uses a closed-loop proportional control loop to "hug" or stay close to the wall.  The nominal hug distance is between 15cm and 35cm (6 to 14 inches).  Prior to calling this primitive, the robot must be lined up with its wheels nearly parallel to a wall and close to the desired hug distance.  If the robot is too far from the wall, it may turn sharply towards the wall and stop with a front ranger detection.  If the robot tries to hug a wall and none is within range, it may go in circles.  The monitor keeps track of obstructions, edges, stalls, and other boundary conditions.  The current speed setting for the robot is used for the motion and velocity damping is used to create a fluid movement.

The robot always checks for front obstacles when wall-hugging.  Depending on the wall-hug mode, the robot may also check for sudden changes from the side ranger being used for the hug.  Thresholds for front and rear obstacle detection may be adjusted by modifying the front-ranger-threshold and side-ranger-threshold properties of the Garcia object.  These properties may also be set within an XML script by using a global primitive.

Defined values that may be used as hug parameters can be found in the aGarciaDefs.tea file in the aSystem subfolder of the brainstem directory tree.

Return Status

This primitive returns the condition that terminated the motion.

Property Inheritance

hug inherits Behavior inherits Object properties.

Properties
side
mode
range

side (int)

The sensor to use for the hug.  Using the defined value aGARCIA_MOTO_ARANGE_SIDE_RIGHT will make Garcia perform a right wall hug.  Using the defined value aGARCIA_MOTO_ARANGE_SIDE_LEFT will make Garcia perform a left wall hug.


mode (int)

The type of hug.  Different types of hugs have different end conditions.  Using the defined value aGARCIA_HUGMODE_DEFAULT will make the hug stop when an object is in front of the robot.  Using the defined value aGARCIA_HUGMODE_SIDELOSS will make the hug stop when the wall is lost, as when the robot reaches a corner.  Using the defined value aGARCIA_HUGMODE_DOCKFIND will make the hug stop when there is a bump on the wall.  Placing an object on the wall that sticks out a few inches may be good way to indicate the location of a landmark such as a dock.


range (float)

The desired range (or setpoint) for the hug.  The value must be in units specified by the Garcia Object's distance-units property.  This range value is the distance between the middle axis and wall.


version: 1.0, build 91231
© Copyright 1994-2010 Acroname, Inc., Boulder, Colorado.  All rights reserved.