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

ArTCM2.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 ARTCM2_H
00028 #define ARTCM2_H
00029 
00030 #include "ariaUtil.h"
00031 #include "ArFunctor.h"
00032 #include "ArRobot.h"
00033 
00035 
00041 class ArTCM2
00042 {
00043 public:
00044 
00046   ArTCM2(ArRobot *robot);
00048   virtual ~ArTCM2();
00050   double getCompass(void) const { return myCompass; }
00052   double getPitch(void) const { return myPitch; }
00054   double getRoll(void) const { return myRoll; }
00056   double getXMagnetic(void) const { return myXMag; }
00058   double getYMagnetic(void) const { return myYMag; }
00060   double getZMagnetic(void) const { return myZMag; }
00062   double getTemperature(void) const { return myTemperature; }
00063   // Gets the error (see manual)
00064   int getError(void) const { return myError; }
00066   double getCalibrationH(void) const { return myCalibrationH; }
00068   double getCalibrationV(void) const { return myCalibrationV; }
00070   double getCalibrationM(void) const { return myCalibrationM; }
00072   void commandOff(void) { myRobot->comInt(ArCommands::TCM2, 0); }
00074   void commandJustCompass(void) { myRobot->comInt(ArCommands::TCM2, 1); }
00076   void commandOnePacket(void) { myRobot->comInt(ArCommands::TCM2, 2); }
00078   void commandContinuousPackets(void) { myRobot->comInt(ArCommands::TCM2, 3); }
00080   void commandUserCalibration(void) { myRobot->comInt(ArCommands::TCM2, 4); }
00082   void commandAutoCalibration(void) { myRobot->comInt(ArCommands::TCM2, 5); }
00084   void commandStopCalibration(void) { myRobot->comInt(ArCommands::TCM2, 6); }
00086   void commandSoftReset(void) { myRobot->comInt(ArCommands::TCM2, 7); }
00088   int getPacCount(void);
00090   bool packetHandler(ArRobotPacket *packet);
00091 protected:  
00092   ArRobot *myRobot;
00093 
00094   double myCompass;
00095   double myPitch;
00096   double myRoll;
00097   double myXMag;
00098   double myYMag;
00099   double myZMag;
00100   double myTemperature;
00101   int myError;
00102   double myCalibrationH;
00103   double myCalibrationV;
00104   double myCalibrationM;
00105 
00106   // packet count
00107   time_t myTimeLastPacket;
00108   int myPacCurrentCount;
00109   int myPacCount;               
00110   ArRetFunctor1C<bool, ArTCM2, ArRobotPacket *> myPacketHandlerCB;
00111   
00112 };
00113 
00114 #endif // ARTCM2_H

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