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

ArActionGotoStraight.h

00001 /*
00002 ActivMedia Robotics Interface for Applications (ARIA)
00003 Copyright (C) 2004,2005 ActivMedia Robotics, LLC
00004 
00005 
00006      This program is free software; you can redistribute it and/or modify
00007      it under the terms of the GNU General Public License as published by
00008      the Free Software Foundation; either version 2 of the License, or
00009      (at your option) any later version.
00010 
00011      This program is distributed in the hope that it will be useful,
00012      but WITHOUT ANY WARRANTY; without even the implied warranty of
00013      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014      GNU General Public License for more details.
00015 
00016      You should have received a copy of the GNU General Public License
00017      along with this program; if not, write to the Free Software
00018      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 
00020 If you wish to redistribute ARIA under different terms, contact 
00021 ActivMedia Robotics for information about a commercial version of ARIA at 
00022 robots@activmedia.com or 
00023 ActivMedia Robotics, 19 Columbia Drive, Amherst, NH 03031; 800-639-9481
00024 
00025 */
00026 
00027 #ifndef ARACTIONGOTOSTRAIGHT_H
00028 #define ARACTIONGOTOSTRAIGHT_H
00029 
00030 #include "ariaTypedefs.h"
00031 #include "ariaUtil.h"
00032 #include "ArAction.h"
00033 
00035 
00056 class ArActionGotoStraight : public ArAction
00057 {
00058 public:
00059   ArActionGotoStraight(const char *name = "goto", 
00060                                 double speed = 400);
00061   virtual ~ArActionGotoStraight();
00062 
00064   bool haveAchievedGoal(void);
00066   void cancelGoal(void);
00068   void setGoal(ArPose goal, bool backwards = false, 
00069                         bool justDistance = true);
00071   void setGoalRel(double dist, double deltaHeading, 
00072                            bool backwards = false, bool justDistance = true);
00074   ArPose getGoal(void) { return myGoal; }
00076   bool usingEncoderGoal(void) { return myUseEncoderGoal; }
00078   void setEncoderGoal(ArPose encoderGoal, bool backwards = false,
00079                                bool justDistance = true);
00081   void setEncoderGoalRel(double dist, double deltaHeading, 
00082                                   bool backwards = false, 
00083                                   bool justDistance = true);
00085   ArPose getEncoderGoal(void) { return myEncoderGoal; }
00087   void setSpeed(double speed) { mySpeed = speed; }
00089   double getSpeed(void) { return mySpeed; }
00091   void setCloseDist(double closeDist = 100) { myCloseDist = closeDist; } 
00093   double getCloseDist(void) { return myCloseDist; }
00095   bool getBacking(void) { return myBacking; }
00096   virtual ArActionDesired *fire(ArActionDesired currentDesired);
00097   virtual ArActionDesired *getDesired(void) { return &myDesired; }
00098 protected:
00099   ArPose myGoal;
00100   bool myUseEncoderGoal;
00101   ArPose myEncoderGoal;
00102   double mySpeed;
00103   bool myBacking;
00104   ArActionDesired myDesired;
00105   bool myPrinting;
00106   double myDist;
00107   double myCloseDist;
00108 
00109   bool myJustDist;
00110 
00111   double myDistTravelled;
00112   ArPose myLastPose;
00113   
00114   enum State
00115   {
00116     STATE_NO_GOAL, 
00117     STATE_ACHIEVED_GOAL,
00118     STATE_GOING_TO_GOAL
00119   };
00120   State myState;
00121 };
00122 
00123 #endif // ARACTIONGOTO

Generated on Wed Oct 19 12:56:34 2005 for Aria by  doxygen 1.4.0