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

ArPTZ.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 ARPTZ_H
00027 #define ARPTZ_H
00028 
00029 #include "ariaTypedefs.h"
00030 #include "ArFunctor.h"
00031 #include "ArCommands.h"
00032 
00033 class ArRobot;
00034 class ArBasePacket;
00035 class ArRobotPacket;
00036 class ArDeviceConnection;
00037 
00038 
00040 
00082 class ArPTZ
00083 {
00084 public:
00085   AREXPORT ArPTZ(ArRobot *robot);
00087   AREXPORT virtual ~ArPTZ();
00088 
00090   AREXPORT virtual bool init(void) = 0;
00091 
00093 
00098   AREXPORT virtual void reset(void) 
00099     { panTilt(0, 0); if (canZoom()) zoom(getMinZoom()); }
00101   AREXPORT virtual bool pan(double degrees) = 0;
00103   AREXPORT virtual bool panRel(double degrees) = 0;
00104 
00106   AREXPORT virtual bool tilt(double degrees) = 0;
00108   AREXPORT virtual bool tiltRel(double degrees) = 0;
00109 
00111   AREXPORT virtual bool panTilt(double degreesPan, double degreesTilt) = 0;
00113   AREXPORT virtual bool panTiltRel(double degreesPan, double degreesTilt) = 0;
00114 
00116   AREXPORT virtual bool canZoom(void) const = 0;
00117 
00119   AREXPORT virtual bool zoom(int zoomValue) { return false; }
00121   AREXPORT virtual bool zoomRel(int zoomValue) { return false; }
00122 
00124   AREXPORT virtual double getPan(void) const = 0;
00126   AREXPORT virtual double getTilt(void) const = 0;
00128   AREXPORT virtual int getZoom(void) const { return 0; }
00129 
00131   AREXPORT virtual bool canGetRealPanTilt(void) const { return false; }
00132   // The angle the camera says its at (not needed and was confusing, 
00133   //                                   just use getPan)
00134   // AREXPORT virtual double getRealPan(void) const { return 0; }
00135   // The angle the camera says its at (not needed and was confusing, 
00136   //                                   just use getTilt)
00137   //AREXPORT virtual double getRealTilt(void) const { return 0; }
00138 
00140   AREXPORT virtual bool canGetRealZoom(void) const { return false; }
00141   // The zoom the camera says its at (not needed and was confusing,
00142   //                                   just use getZoom)
00143   // AREXPORT virtual double getRealZoom(void) const { return 0; }
00144 
00146   AREXPORT virtual double getMaxPosPan(void) const = 0;
00148   AREXPORT virtual double getMaxNegPan(void) const = 0;
00150   AREXPORT virtual double getMaxPosTilt(void) const = 0;
00152   AREXPORT virtual double getMaxNegTilt(void) const = 0;
00154   AREXPORT virtual int getMaxZoom(void) const { return 0; }
00156   AREXPORT virtual int getMinZoom(void) const { return 0; }
00158   AREXPORT virtual bool canGetFOV(void) { return false; }
00160   AREXPORT virtual double getFOVAtMaxZoom(void) { return 0; }
00162   AREXPORT virtual double getFOVAtMinZoom(void) { return 0; }
00163 
00166   AREXPORT virtual bool setGain(double gain) const { return false; }
00168   AREXPORT virtual double getGain(double gain) const { return 0; }
00170   AREXPORT virtual bool canSetGain(void) const { return false; }
00171 
00174   AREXPORT virtual bool setFocus(double focus) const { return false; }
00176   AREXPORT virtual double getFocus(double focus) const { return 0; }
00178   AREXPORT virtual bool canSetFocus(void) const { return false; }
00179 
00183   AREXPORT virtual bool setDeviceConnection(ArDeviceConnection *connection,
00184                         bool driveFromRobotLoop = true);
00186   AREXPORT virtual ArDeviceConnection *getDeviceConnection(void);
00188   AREXPORT virtual bool setAuxPort(int auxPort);
00190   AREXPORT virtual int getAuxPort(void) { return myAuxPort; }
00192 
00200   AREXPORT virtual ArBasePacket *readPacket(void) { return NULL; }
00201   
00203   AREXPORT virtual bool sendPacket(ArBasePacket *packet);
00205 
00215   AREXPORT virtual bool packetHandler(ArBasePacket *packet) { return false; }
00216 
00218 
00226   AREXPORT virtual bool robotPacketHandler(ArRobotPacket *packet);
00227 
00229   AREXPORT virtual void connectHandler(void);
00231   AREXPORT virtual void sensorInterpHandler(void);
00232 protected:
00233   ArRobot *myRobot;
00234   ArDeviceConnection *myConn;
00235   ArFunctorC<ArPTZ> myConnectCB;
00236   ArFunctorC<ArPTZ> mySensorInterpCB;
00237   int myAuxPort;
00238   ArCommands::Commands myAuxTxCmd;
00239   ArCommands::Commands myAuxRxCmd;
00240   ArRetFunctor1C<bool, ArPTZ, ArRobotPacket *> myRobotPacketHandlerCB;
00241 };
00242 
00243 #endif // ARPTZ_H

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