ronelib
Operating System for the r-one robot
 All Data Structures Files Functions Variables Typedefs
bumpBehaviors.h File Reference

Collection of behaviors that use the bump sensor. More...

Go to the source code of this file.

Functions

BehbehIRObstacleAvoid (Beh *behPtr, int32 tv, boolean invalidate)
 Uses IR to avoid all obstacles, including robots. Can be invalidated. More...
 
BehbehBumpMoveOutOfWay (Beh *behPtr)
 If bumped, robot will move slightly forward out of way. More...
 
BehbehIRObstacleAvoid_ExcludeRobots (Beh *behPtr, int32 tv, NbrList *nbrListPtr, boolean invalidate)
 Uses IR to avoid all obstacles, except robots. Can be invalidated. More...
 
BehbehBumpAvoid (Beh *behPtr, int32 tv, int32 forwardDist)
 Simple behavior: Uses bump sensors to determine if robot should avoid an obstacle. More...
 
BehbehBumpReflect (Beh *behPtr, int32 tv, int32 reflectDist)
 Turn around if it his running into something. More...
 
void behBumpReflectDemo (Beh *behPtr, int32 rotate_rv)
 If the front bump sensors are activated, the robot will rotate. More...
 
BehbehBumpBackoff (Beh *behPtr, int32 tv)
 If the front bump sensors are activated, the robot will backup. More...
 
BehbehBumpNavigate (Beh *behPtr, uint8 headingRobot)
 If bumped, robot will back up, turn in the direction is was traveling, then move forward. More...
 

Detailed Description

Collection of behaviors that use the bump sensor.

These behaviors include obstacle avoidance and navigation.

Since
September 28, 2011
Author
James McLurkin

Function Documentation

Beh* behBumpAvoid ( Beh behPtr,
int32  tv,
int32  forwardDist 
)

Simple behavior: Uses bump sensors to determine if robot should avoid an obstacle.

If obstacle is detected with bump sensors, the robot turns in place. After the bump sensor turns off, the robot moves forward forwardDist mm. If the robot does not bump anything, this behavior becomes inactive.

Parameters
behPtrbehavior that is updated by this function
tvdesired translational velocity
forwardDistthe desired distance (in mm) the robot should move once a bump sensor turns off
Returns
updated behPtr
Beh* behBumpBackoff ( Beh behPtr,
int32  tv 
)

If the front bump sensors are activated, the robot will backup.

Parameters
behPtrpointer for the behavior to update
tvdesired translational velocity
Returns
updated behPtr

added for improving bump behavior

Beh* behBumpMoveOutOfWay ( Beh behPtr)

If bumped, robot will move slightly forward out of way.

Parameters
behPtrpointer for behavior to be modified
Returns
updated behPtr
Beh* behBumpNavigate ( Beh behPtr,
uint8  headingRobot 
)

If bumped, robot will back up, turn in the direction is was traveling, then move forward.

Parameters
behPtrfor behavior that is updated by this function
headingRobotthe heading of the robot before bumping

0 - Straight 1 - Left 2 - Right

Returns
updated behPtr
Beh* behBumpReflect ( Beh behPtr,
int32  tv,
int32  reflectDist 
)

Turn around if it his running into something.

Parameters
behPtrbehavior that is updated by this function
tvdesired translational velocity
reflectDist
Returns
updated behPtr
void behBumpReflectDemo ( Beh behPtr,
int32  rotate_rv 
)

If the front bump sensors are activated, the robot will rotate.

This is obtained by turning off translational velocity and setting rotational velocity to the input rotate_rv in the behPtr.

Parameters
behPtrpointer for the behavior to update
rotate_rvdesired rotational velocity if the robot has encountered an obstacle
Returns
void
Beh* behIRObstacleAvoid ( Beh behPtr,
int32  tv,
boolean  invalidate 
)

Uses IR to avoid all obstacles, including robots. Can be invalidated.

Parameters
behPtr
tvdesired translational velocity
invalidate
Returns
a Beh* for obstacle avoidance
Beh* behIRObstacleAvoid_ExcludeRobots ( Beh behPtr,
int32  tv,
NbrList *  nbrListPtr,
boolean  invalidate 
)

Uses IR to avoid all obstacles, except robots. Can be invalidated.

Parameters
behPtr
tvdesired translational velocity
nbrListPtrfor list of neighbors
invalidate
Returns
a Beh* for obstacle avoidance