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

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

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