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

ArAMPTU.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 ARAMPTU_H
00027 #define ARAMPTU_H
00028 
00029 #include "ariaTypedefs.h"
00030 #include "ArBasePacket.h"
00031 #include "ArPTZ.h"
00032 
00034 class ArAMPTUCommands
00035 {
00036 public:
00037   enum {
00038     ABSTILT = 0x35, 
00039     RELTILTU = 0x36, 
00040     RELTILTD = 0x37, 
00041     ABSPAN = 0x31, 
00042     RELPANCW = 0x32, 
00043     RELPANCCW = 0x33, 
00044     PANTILT = 0x28, 
00045     PANTILTUCW = 0x29, 
00046     PANTILTDCW = 0x2A, 
00047     PANTILTUCCW = 0x2B, 
00048     PANTILTDCCW = 0x2C, 
00049     ZOOM = 0x3F, 
00050     PAUSE = 0x39, 
00051     CONT = 0x3A, 
00052     PURGE = 0x3B, 
00053     STATUS = 0x3C, 
00054     INIT = 0x3D, 
00055     RESP = 0x3E, 
00056     PANSLEW = 0x34, 
00057     TILTSLEW = 0x38 
00058   };
00059 
00060 };
00061 
00063 
00070 class ArAMPTUPacket: public ArBasePacket
00071 {
00072 public:
00074   AREXPORT ArAMPTUPacket(ArTypes::UByte2 bufferSize = 30);
00076   AREXPORT virtual ~ArAMPTUPacket();
00077 
00079   AREXPORT unsigned char getUnitNumber(void);
00081   AREXPORT bool setUnitNumber(unsigned char unitNumber);
00082   
00083   AREXPORT virtual void byteToBuf(ArTypes::Byte val);
00084   AREXPORT virtual void byte2ToBuf(ArTypes::Byte2 val);
00085   
00086   AREXPORT virtual void finalizePacket(void);
00087 
00088 protected:
00089   unsigned char myUnitNumber;
00090 };
00091 
00093 class ArAMPTU : public ArPTZ
00094 {
00095 public:
00097   AREXPORT ArAMPTU(ArRobot *robot, int unitNumber = 0);
00099   AREXPORT virtual ~ArAMPTU();
00100   AREXPORT virtual bool init(void);
00101   AREXPORT virtual bool pan(double deg);
00102   AREXPORT virtual bool panRel(double deg);
00103   AREXPORT virtual bool tilt(double deg);
00104   AREXPORT virtual bool tiltRel(double deg);
00105   AREXPORT virtual bool panTilt(double panDeg, double tiltDeg);
00106   AREXPORT virtual bool panTiltRel(double panDeg, double tiltDeg);
00108   AREXPORT bool panSlew(double deg);
00110   AREXPORT bool tiltSlew(double deg);
00111   AREXPORT virtual bool canZoom(void) const { return false; }
00112   AREXPORT virtual double getMaxPosPan(void) const { return 150; }
00113   AREXPORT virtual double getMaxNegPan(void) const { return -150; }
00114   AREXPORT virtual double getMaxPosTilt(void) const { return 90; }
00115   AREXPORT virtual double getMaxNegTilt(void) const { return -90; }
00116 
00118   AREXPORT bool pause(void);
00120   AREXPORT bool resume(void);
00122   AREXPORT bool purge(void);
00124   AREXPORT bool requestStatus(void);
00126   AREXPORT virtual double getPan(void) const { return myPan; }
00128   AREXPORT virtual double getTilt(void) const { return myTilt; }
00129   enum {
00130     MIN_SLEW = 15,
00131     MAX_TILT_SLEW = 200,
00132     MAX_PAN_SLEW = 120
00133   };
00134 protected:
00135   ArRobot *myRobot;
00136   ArAMPTUPacket myPacket;
00137   int myUnitNumber;
00138   double myPan;
00139   double myTilt;
00140   double myPanSlew;
00141   double myTiltSlew;
00142   /*double myCurPan;
00143   double myCurTilt;
00144   double myCurPanSlew;
00145   double myCurTiltSlew;*/
00146 };
00147 
00148 #endif // ARAMPTU_H
00149 

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