00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef ARACTIONBUMPERS_H
00029 #define ARACTIONBUMPERS_H
00030
00031 #include "ariaTypedefs.h"
00032 #include "ArAction.h"
00033
00035
00044 class ArActionBumpers : public ArAction
00045 {
00046 public:
00048 ArActionBumpers(const char *name = "bumpers",
00049 double backOffSpeed = 100, int backOffTime = 3000,
00050 int turnTime = 3000, bool setMaximums = false);
00052 virtual ~ArActionBumpers();
00053 virtual ArActionDesired *fire(ArActionDesired currentDesired);
00054 virtual ArActionDesired *getDesired(void) { return &myDesired; }
00055 double findDegreesToTurn(int bumpValue, int whichBumper);
00056 protected:
00057 ArActionDesired myDesired;
00058 bool mySetMaximums;
00059 double myBackOffSpeed;
00060 int myBackOffTime;
00061 int myTurnTime;
00062 int myStopTime;
00063 bool myFiring;
00064 double mySpeed;
00065 double myHeading;
00066 int myBumpMask;
00067 ArTime myStartBack;
00068 ArTime stoppedSince;
00069 };
00070
00071 #endif // ARACTIONBUMPERS