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

ArActionGotoStraight.h

00001 /*
00002 MobileRobots Advanced Robotics Interface for Applications (ARIA)
00003 Copyright (C) 2004, 2005 ActivMedia Robotics LLC
00004 Copyright (C) 2006, 2007 MobileRobots Inc.
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 MobileRobots for information about a commercial version of ARIA at 
00022 robots@mobilerobots.com or 
00023 MobileRobots Inc, 19 Columbia Drive, Amherst, NH 03031; 800-639-9481
00024 */
00025 
00026 #ifndef ARACTIONGOTOSTRAIGHT_H
00027 #define ARACTIONGOTOSTRAIGHT_H
00028 
00029 #include "ariaTypedefs.h"
00030 #include "ariaUtil.h"
00031 #include "ArAction.h"
00032 
00034 
00055 class ArActionGotoStraight : public ArAction
00056 {
00057 public:
00058   AREXPORT ArActionGotoStraight(const char *name = "goto", 
00059                 double speed = 400);
00060   AREXPORT virtual ~ArActionGotoStraight();
00061 
00063   AREXPORT bool haveAchievedGoal(void);
00065   AREXPORT void cancelGoal(void);
00067   AREXPORT void setGoal(ArPose goal, bool backwards = false, 
00068             bool justDistance = true);
00070   AREXPORT void setGoalRel(double dist, double deltaHeading, 
00071                bool backwards = false, bool justDistance = true);
00073   ArPose getGoal(void) { return myGoal; }
00075   bool usingEncoderGoal(void) { return myUseEncoderGoal; }
00077   AREXPORT void setEncoderGoal(ArPose encoderGoal, bool backwards = false,
00078                    bool justDistance = true);
00080   AREXPORT void setEncoderGoalRel(double dist, double deltaHeading, 
00081                   bool backwards = false, 
00082                   bool justDistance = true);
00084   ArPose getEncoderGoal(void) { return myEncoderGoal; }
00086   void setSpeed(double speed) { mySpeed = speed; }
00088   double getSpeed(void) { return mySpeed; }
00090   void setCloseDist(double closeDist = 100) { myCloseDist = closeDist; } 
00092   double getCloseDist(void) { return myCloseDist; }
00094   bool getBacking(void) { return myBacking; }
00095   AREXPORT virtual ArActionDesired *fire(ArActionDesired currentDesired);
00096   AREXPORT virtual ArActionDesired *getDesired(void) { return &myDesired; }
00097 #ifndef SWIG
00098   AREXPORT virtual const ArActionDesired *getDesired(void) const 
00099                                                         { return &myDesired; }
00100 #endif
00101 protected:
00102   ArPose myGoal;
00103   bool myUseEncoderGoal;
00104   ArPose myEncoderGoal;
00105   double mySpeed;
00106   bool myBacking;
00107   ArActionDesired myDesired;
00108   bool myPrinting;
00109   double myDist;
00110   double myCloseDist;
00111 
00112   bool myJustDist;
00113 
00114   double myDistTravelled;
00115   ArPose myLastPose;
00116   
00117   enum State
00118   {
00119     STATE_NO_GOAL, 
00120     STATE_ACHIEVED_GOAL,
00121     STATE_GOING_TO_GOAL
00122   };
00123   State myState;
00124 };
00125 
00126 #endif // ARACTIONGOTO

Generated on Tue Feb 20 10:51:38 2007 for Aria by  doxygen 1.4.0