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

ArActionJoydrive.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 ARACTIONJOYDRIVE_H
00027 #define ARACTIONJOYDRIVE_H
00028 
00029 #include "ariaTypedefs.h"
00030 #include "ArAction.h"
00031 #include "ArJoyHandler.h"
00032 
00034 
00049 class ArActionJoydrive : public ArAction
00050 {
00051 public:
00053   AREXPORT ArActionJoydrive(const char * name = "joydrive", 
00054                 double transVelMax = 400, 
00055                 double turnAmountMax = 15, 
00056                 bool stopIfNoButtonPressed = true,
00057                 bool useOSCalForJoystick = true);
00059   AREXPORT virtual ~ArActionJoydrive();
00060   AREXPORT virtual ArActionDesired *fire(ArActionDesired currentDesired);
00062   AREXPORT bool joystickInited(void);
00064   AREXPORT void setSpeeds(double transVelMax, double turnAmountMax);
00066   AREXPORT void setStopIfNoButtonPressed(bool stopIfNoButtonPressed);
00068   AREXPORT bool getStopIfNoButtonPressed(void);
00070   AREXPORT void setThrottleParams(double lowSpeed, double highSpeed);
00072   AREXPORT void setUseOSCal(bool useOSCal);
00074   AREXPORT bool getUseOSCal(void);
00076   AREXPORT ArJoyHandler *getJoyHandler(void) { return myJoyHandler; }
00077   AREXPORT virtual ArActionDesired *getDesired(void) { return &myDesired; }
00078 #ifndef SWIG
00079   AREXPORT virtual const ArActionDesired *getDesired(void) const { return &myDesired; }
00080 #endif
00081 protected:
00082   bool myUseThrottle;
00083   double myLowThrottle;
00084   double myHighThrottle;
00085   // action desired
00086   ArActionDesired myDesired;
00087   // joystick handler
00088   ArJoyHandler *myJoyHandler;
00089   // full spped
00090   double myTransVelMax;
00091   // full amount to turn
00092   double myTurnAmountMax;
00093   // if we want to stop when no button is presesd
00094   bool myStopIfNoButtonPressed;
00095   // if we're using os cal for the joystick
00096   bool myUseOSCal;
00097   bool myPreviousUseOSCal;
00098 };
00099 
00100 #endif //ARACTIONJOYDRIVE_H

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