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

ArActionRatioInput.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 ARACTIONRATIOINPUT_H
00028 #define ARACTIONRATIOINPUT_H
00029 
00030 #include "ariaTypedefs.h"
00031 #include "ArAction.h"
00032 
00034 
00053 class ArActionRatioInput : public ArAction
00054 {
00055 public:
00057   ArActionRatioInput(const char *name = "RatioInput");
00059   virtual ~ArActionRatioInput();
00061   void setRatios(double transRatio, double rotRatio, 
00062                           double throttleRatio);
00064   void setTransRatio(double transRatio);
00066   void setRotRatio(double rotRatio);
00068   void setThrottleRatio(double throttleRatio);
00070   double getTransRatio(void) { return myTransRatio; }
00072   double getRotRatio(void) { return myRotRatio; }
00074   double getThrottleRatio(void) { return myThrottleRatio; }
00076   void addFireCallback(int priority, ArFunctor *functor);
00078   void remFireCallback(ArFunctor *functor);
00080   void addActivateCallback(ArFunctor *functor, 
00081                                     ArListPos::Pos position = ArListPos::LAST);
00083   void remActivateCallback(ArFunctor *functor);
00085   void addDeactivateCallback(ArFunctor *functor, 
00086                               ArListPos::Pos position = ArListPos::LAST);
00088   void remDeactivateCallback(ArFunctor *functor);
00090   void setParameters(double fullThrottleForwards, 
00091                               double fullThrottleBackwards, 
00092                               double rotAtFullForwards,
00093                               double rotAtFullBackwards,
00094                               double rotAtStopped);
00096   void addToConfig(ArConfig *config, const char *section);
00097   virtual ArActionDesired *fire(ArActionDesired currentDesired);
00098   virtual ArActionDesired *getDesired(void) { return &myDesired; }
00099   virtual void activate(void);
00100   virtual void deactivate(void);
00101 protected:
00102   std::multimap<int, ArFunctor *> myFireCallbacks;
00103   std::list<ArFunctor *> myActivateCallbacks;
00104   std::list<ArFunctor *> myDeactivateCallbacks;
00105   // if we're printing extra information or not
00106   bool myPrinting;
00107   double myTransDeadZone;
00108   double myRotDeadZone;
00109   double myFullThrottleForwards;
00110   double myFullThrottleBackwards; 
00111   double myRotAtFullForwards;
00112   double myRotAtFullBackwards;
00113   double myRotAtStopped;
00114   double myTransRatio;
00115   double myRotRatio;
00116   double myThrottleRatio;
00117   ArActionDesired myDesired;
00118 };
00119 
00120 #endif // ARACTIONSTOP_H

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