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

ArTCM2.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 ARTCM2_H
00027 #define ARTCM2_H
00028 
00029 #include "ariaUtil.h"
00030 #include "ArFunctor.h"
00031 #include "ArRobot.h"
00032 
00034 
00040 class ArTCM2
00041 {
00042 public:
00043 
00045   AREXPORT ArTCM2(ArRobot *robot);
00047   AREXPORT virtual ~ArTCM2();
00049   double getCompass(void) const { return myCompass; }
00051   double getPitch(void) const { return myPitch; }
00053   double getRoll(void) const { return myRoll; }
00055   double getXMagnetic(void) const { return myXMag; }
00057   double getYMagnetic(void) const { return myYMag; }
00059   double getZMagnetic(void) const { return myZMag; }
00061   double getTemperature(void) const { return myTemperature; }
00062   // Gets the error (see manual)
00063   int getError(void) const { return myError; }
00065   double getCalibrationH(void) const { return myCalibrationH; }
00067   double getCalibrationV(void) const { return myCalibrationV; }
00069   double getCalibrationM(void) const { return myCalibrationM; }
00071   void commandOff(void) { myRobot->comInt(ArCommands::TCM2, 0); }
00073   void commandJustCompass(void) { myRobot->comInt(ArCommands::TCM2, 1); }
00075   void commandOnePacket(void) { myRobot->comInt(ArCommands::TCM2, 2); }
00077   void commandContinuousPackets(void) { myRobot->comInt(ArCommands::TCM2, 3); }
00079   void commandUserCalibration(void) { myRobot->comInt(ArCommands::TCM2, 4); }
00081   void commandAutoCalibration(void) { myRobot->comInt(ArCommands::TCM2, 5); }
00083   void commandStopCalibration(void) { myRobot->comInt(ArCommands::TCM2, 6); }
00085   void commandSoftReset(void) { myRobot->comInt(ArCommands::TCM2, 7); }
00087   AREXPORT int getPacCount(void);
00089   AREXPORT bool packetHandler(ArRobotPacket *packet);
00090 protected:  
00091   ArRobot *myRobot;
00092 
00093   double myCompass;
00094   double myPitch;
00095   double myRoll;
00096   double myXMag;
00097   double myYMag;
00098   double myZMag;
00099   double myTemperature;
00100   int myError;
00101   double myCalibrationH;
00102   double myCalibrationV;
00103   double myCalibrationM;
00104 
00105   // packet count
00106   time_t myTimeLastPacket;
00107   int myPacCurrentCount;
00108   int myPacCount;       
00109   ArRetFunctor1C<bool, ArTCM2, ArRobotPacket *> myPacketHandlerCB;
00110   
00111 };
00112 
00113 #endif // ARTCM2_H

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