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

ArSonyPTZ.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 ARSONYPTZ_H
00028 #define ARSONYPTZ_H
00029 
00030 #include "ariaTypedefs.h"
00031 #include "ArBasePacket.h"
00032 #include "ArPTZ.h"
00033 
00035 
00039 class ArSonyPacket: public ArBasePacket
00040 {
00041 public:
00043   ArSonyPacket(ArTypes::UByte2 bufferSize = 15);
00044   virtual ~ArSonyPacket();
00045   
00046   virtual void uByteToBuf(ArTypes::UByte val);
00047   virtual void byte2ToBuf(ArTypes::Byte2 val);
00049   void byte2ToBufAtPos(ArTypes::Byte2 val, ArTypes::UByte2 pose);
00050 };
00051 
00052 class ArRobot;
00053 
00055 
00056 class ArSonyPTZ : public ArPTZ
00057 {
00058 public:
00059   ArSonyPTZ(ArRobot *robot);
00060   virtual ~ArSonyPTZ();
00061   
00062   virtual bool init(void);
00063   virtual bool pan(int degrees);
00064   virtual bool panRel(int degrees);
00065   virtual bool tilt(int degrees);
00066   virtual bool tiltRel(int degrees);
00067   virtual bool panTilt(int degreesPan, int degreesTilt);
00068   virtual bool panTiltRel(int degreesPan, int degreesTilt);
00069   virtual bool canZoom(void) const { return true; }
00070   virtual bool zoom(int zoomValue);
00071   virtual bool zoomRel(int zoomValue);
00072   virtual int getPan(void) const { return myPan; }
00073   virtual int getTilt(void) const { return myTilt; }
00074   virtual int getZoom(void) const { return myZoom; }
00075   virtual int getMaxPosPan(void) const { return 90; }
00076   virtual int getMaxNegPan(void) const { return -90; }
00077   virtual int getMaxPosTilt(void) const { return 30; }
00078   virtual int getMaxNegTilt(void) const { return -30; }
00079   virtual int getMaxZoom(void) const { return 1024; }
00080   virtual int getMinZoom(void) const { return 0; }
00081 
00082 
00083   bool backLightingOn(void);
00084   bool backLightingOff(void);
00085   //bool packetHandler(ArRobotPacket *packet);
00086   enum {
00087     MAX_PAN = 95, 
00088     MAX_TILT = 25, 
00089     MIN_ZOOM = 0, 
00090     MAX_ZOOM = 1023 
00091   };
00092 protected:
00093   void initializePackets(void);
00094   ArRobot *myRobot;
00095   int myPan;
00096   int myTilt;
00097   int myZoom;
00098   double myDegToTilt;
00099   double myDegToPan;
00100   ArSonyPacket myPacket;
00101   ArSonyPacket myZoomPacket; 
00102   ArSonyPacket myPanTiltPacket;
00103 };
00104 
00105 #endif // ARSONYPTZ_H

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