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

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

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