Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

ArActionBumpers Class Reference

Action to deal with if the bumpers trigger. More...

#include <ArActionBumpers.h>

Inheritance diagram for ArActionBumpers:

ArAction List of all members.

Public Member Functions

 ArActionBumpers (const char *name="bumpers", double backOffSpeed=100, int backOffTime=3000, int turnTime=3000, bool setMaximums=false)
 Constructor.
double findDegreesToTurn (int bumpValue, int whichBumper)
virtual ArActionDesiredfire (ArActionDesired currentDesired)
 Fires the action, returning what the action wants to do.
virtual ArActionDesiredgetDesired (void)
 Gets what this action wants to do (for display purposes).
virtual ~ArActionBumpers ()
 Destructor.

Protected Attributes

double myBackOffSpeed
int myBackOffTime
int myBumpMask
ArActionDesired myDesired
bool myFiring
double myHeading
bool mySetMaximums
double mySpeed
ArTime myStartBack
int myStopTime
int myTurnTime
ArTime stoppedSince

Detailed Description

Action to deal with if the bumpers trigger.

This class basically responds to the bumpers the robot has, what the activity things the robot has is decided by the param file. If the robot is going forwards and bumps into something with the front bumpers, it will back up and turn. If the robot is going backwards and bumps into something with the rear bumpers then the robot will move forward and turn.

Definition at line 44 of file ArActionBumpers.h.


Constructor & Destructor Documentation

ArActionBumpers::ArActionBumpers const char *  name = "bumpers",
double  backOffSpeed = 100,
int  backOffTime = 3000,
int  turnTime = 3000,
bool  setMaximums = false
 

Constructor.

Parameters:
name name of the action
backOffSpeed speed at which to back away (mm/sec)
backOffTime number of msec to back up for (msec)
turnTime number of msec to alow for turn (msec)

Definition at line 38 of file ArActionBumpers.cpp.

References ArAction::setNextArgument().


Member Function Documentation

ArActionDesired * ArActionBumpers::fire ArActionDesired  currentDesired  )  [virtual]
 

Fires the action, returning what the action wants to do.

Parameters:
currentDesired this is what the current resolver has for its desired, this is SOLELY for the purpose of giving information to the action
Returns:
pointer to what this action wants to do, NULL if it wants to do nothing

Implements ArAction.

Definition at line 111 of file ArActionBumpers.cpp.

References ArMath::addAngle(), ArMath::fabs(), ArRobot::getStallValue(), ArRobot::getTh(), ArRobot::getVel(), ArRobot::hasFrontBumpers(), ArRobot::hasRearBumpers(), ArTime::mSecSince(), ArActionDesired::reset(), ArActionDesired::setDeltaHeading(), ArActionDesired::setHeading(), ArActionDesired::setMaxNegVel(), ArActionDesired::setMaxVel(), ArTime::setToNow(), ArActionDesired::setVel(), and ArMath::subAngle().


The documentation for this class was generated from the following files:
Generated on Wed Oct 19 12:56:39 2005 for Aria by  doxygen 1.4.0