Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members  

Gradient Navigation Module


Functions

void sfGradInit (void)
 Initializes the gradient. More...

void sfGradInitRes (int res, int turnRadius)
 Initializes the gradient,. More...

void sfGradSetMap (void *p)
 Sets the map with an mcObject. More...

void sfGradUseArtifacts (int useArtifacts)
 Whether the gradient module should use artifacts (.wld files).

void sfGradUseMap (int useMap)
 Whether the gradient module should use grid maps (.map files).

void sfGradUseSonar (int useSonar)
 Whether the gradient module should use sonar data.

void sfGradUseLaser (int useLaser)
 Whether the gradient module should use laser data.

void sfGradSetGoal (float x, float y)
 Sets the Gradient goal to this global point (in mm). The goal can be changed at any time.

void sfGradSetSpeed (int high, int mid, int back)
 Sets the speed the robot travels at. More...

void sfGradDoGoal (int which)
 Whether the robot should be going to a goal or not.

void sfGradStop (void)
 Stops the robot going to goal and stops the robot.

int sfGradStatus (void)
 Gets the status of the gradient module. More...

int sfGradIsActive (void)
 Gets if the gradient module is active or not.

void sfGradObsParams (int keepout, int decay)
 Resets keep-out distance and decay distance; in mm. More...

void sfGradSetDone (int close, int done)
 Set how close we need to be to a goal to slow done or be done. More...

int sfGradGetCanBack (void)
 Gets if the grad action can back up, 0 = no, 1 = when appropriate, 2 = always. More...

void sfGradSetCanBack (int canBack)
 Gets if the grad action can back up, 0 = no, 1 = when appropriate, 2 = always. More...

void sfGradSetTurnRadius (int turnRadius)
 Sets the turn radius needed to let it turn instead of back, make it back with sfGradSetCanBack. More...

int sfGradGetTurnRadius (void)
 Gets the turn radius needed to let it turn instead of back, make sure it is allowed to back up with with sfGradGetCanBack. More...

void sfGradSetAcc (int acc)
 Sets the acceleration used in driving the robot.

void sfGradSetPnum (int n)
 Set number of propagations, mostly for show.

void sfGradSetMax (int width, int height)
 Sets the size of the gradient window. More...

void sfGradUseFinalApproach (int which)
 Use the final approach action or not.

void sfGradSetFinalApproachSpeed (int speed)
 Sets the final approach speed.

int sfGradGetFinalApproachSpeed (void)
 Gets the final approach speed.


Detailed Description

For efficient movement based on local obstacles and world maps, Saphira has a realtime path planner based on the gradient method [Konolige, IROS 2000]. For planning paths and moving in a world map, the gradient module is typically used with Markov Localization to keep the robot registered with a map as it moves (sfLoc, sfLocLaser, and sfLocFl libraries).

Gradient Path Planning is a process for determining optimal paths for the robot, in real time. These paths can take into account both local obstacles, sensed by sonars and/or laser range-finder devices; and global map information such as the location of walls and other structural obstacles. At each sync cycle (100 ms), the Gradient module calculates the lowest-cost path from a goal point or set of goal points to the robot. The algorithm starts by considering a local neighborhood connecting the robot and the goal or goals, and then expands its search if no path is found. There is a user-settable limit on the size of the neighborhood considered.

Gradient uses a square-cell grid as a cost field for determining good paths. You can set the grid resolution; a typical resolution is 10 mm. The maximum size of the grid can also be set.

Costs are calculated from a set of obstacles, obtained from pre-existing maps and from local sensor readings. Here are the obstacles sources:

1. Artifacts in a world map. Load a world map, and call sfGradUseArtifacts(true).

2. A grid map created from the laser navigation software. A grid map is typically loaded into the localization system using mcLoadScanMap(). To access this map from the gradient module, use sfGradSetMap(mcGetObject()). Finally, turn on grid map use by calling sfGradUseMap(true).

Grid maps and world maps may both be used at the same time.

3. Laser and sonar readings. These can be turned on and off with sfGradUseLaser() and sfGradUseSonar().

The cost field radiates outward from obstacles, to create a safety cushion for the robot. You can adjust this cushion using sfGradObsParams().

There is a local controllers, implemented as an action (SfGradAction), that drives the robot along the gradient path. This action controls the speed of the robot in a parameterized fashion, and can be set with sfGradSetSpeed. A further refinement for rectangular robots is the ability to back up when appropriate; this behavior is controlled by sfGradSetCanBack and sfGradSetTurnRadius. If the robot needs to turn more than 45 degrees to follow the path, it will see if its turn radius is clear. If it isn't, it will try to back up if possible, and turn around when it is clear of obstacles.

Some relevant samples Colbert load files: flgrad.act - basic gradient, without localization for localization with respect to a world, look at flloc.act scan.act - localization and gradient using a grid map (from the Laser Localization/Navigation module).

You can also use the gradient for a final approach to a given position, to do this call sfGradUseFinalApproach... you will also want to adjust the gradient obstacle parameters with sfGradObsParams and the done distance with sfGradSetDone (the close dist is ignored for the final approach). You may want to set the speed with sfGradSetFinalApproachSpeed.


Function Documentation

int sfGradGetCanBack void   
 

Gets if the grad action can back up, 0 = no, 1 = when appropriate, 2 = always.

Returns:
0 if the gradient action will never back up, 1 if it will back up when appropriate (see sfGradInitRes), and 2 it will back up all the time

int sfGradGetTurnRadius void   
 

Gets the turn radius needed to let it turn instead of back, make sure it is allowed to back up with with sfGradGetCanBack.

Returns:
the radius that must be clear for the robot to turn more than 45 degrees

void sfGradInit void   
 

Initializes the gradient.

Initializes the Gradient module. Should be called right after loading the Gradient library.

void sfGradInitRes int    res,
int    turnRadius
 

Initializes the gradient,.

Parameters:
res  res in mm for grid cell resolution
turnRadius  if turnRadius is 0 then it will use the normal parameters and action for movement, buf it turnRadius is not 0 it will back up if the robot needs to travel backwards and a circle with radius turnRadius is obstructed

void sfGradObsParams int    keepout,
int    decay
 

Resets keep-out distance and decay distance; in mm.

This sets the distance away from obstacles the gradient algorithm will stay. (These set fcost and fdecay on my_grad, see the header file for SfGrad.h and class SfGradGrid for the information about this in C++).

Parameters:
keepout  (mm) the distance from the obstacles not to never drive within
decay  (mm) the distance from obstacles to avoid if possible

void sfGradSetCanBack int    canBack
 

Gets if the grad action can back up, 0 = no, 1 = when appropriate, 2 = always.

Parameters:
canBack  0 if the gradient action will never back up, 1 if it will back up when appropriate (see sfGradInitRes), and 2 it will back up all the time

void sfGradSetDone int    close,
int    done
 

Set how close we need to be to a goal to slow done or be done.

Parameters:
close  (mm) the distance away the robot is from the goal when it switches to close mode
done  (mm) the distance away the robot is from the goal when the gradient decides its done

void sfGradSetMap void *    p
 

Sets the map with an mcObject.

Sets the grid map that the gradient will use. Typically the map is taken from the localization module using a call to mcGetObject(), so that the gradient will use the same map that localization is. NOTE: The resolution of the map must be the same as that of the gradient routines (sfGradInit call).

void sfGradSetMax int    width,
int    height
 

Sets the size of the gradient window.

Sets the maximum size (in mm) of the neighborhood considered by the Gradient module. The neighborhood will expand until it reaches this size, in searching for a valid path.

Parameters:
width  maximum width in mm of neighborhood
height  maximum height in mm of neighborhood

void sfGradSetSpeed int    high,
int    mid,
int    back
 

Sets the speed the robot travels at.

Sets the speed the gradient module will use for different circumstances.

Parameters:
high  the speed to travel at when there are no obstructions (mm/sec)
mid  the speed to travel at when there is congestion (mm/sec)
back  the maximum speed for backwards travel (see sfGradInitRes)... it will go slower than this if needed and will use the same parameters high and mid above, but simply cap the backwards velocity at the one given here

void sfGradSetTurnRadius int    turnRadius
 

Sets the turn radius needed to let it turn instead of back, make it back with sfGradSetCanBack.

Parameters:
turnRadius  the radius that must be clear for the robot to turn more than 45 degrees

int sfGradStatus void   
 

Gets the status of the gradient module.

Returns:
0 is idle, 1 is active, 2 is done, 3 is failed, 4 is searching


Generated on Tue Nov 12 17:49:38 2002 for Saphira by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001