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

ArSensorReading.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 ARSENSORREADING_H
00027 #define ARSENSORREADING_H
00028 
00029 #include "ariaTypedefs.h"
00030 #include "ariaUtil.h"
00031 #include "ArTransform.h"
00032 
00034 
00042 class ArSensorReading
00043 {
00044 public:
00046   AREXPORT ArSensorReading(double xPos = 0.0, double yPos = 0.0, double thPos = 0.0);
00048   AREXPORT ArSensorReading(const ArSensorReading & reading);
00050   AREXPORT ArSensorReading &operator=(const ArSensorReading &reading);
00052   AREXPORT virtual ~ArSensorReading();
00053 
00055 
00058   int getRange(void) const { return myRange; }
00059 
00061 
00066   bool isNew(unsigned int counter) const { return counter == myCounterTaken; }
00068   double getX(void) const { return myReading.getX(); }
00070   double getY(void) const { return myReading.getY(); }
00073   ArPose getPose(void) const { return myReading; }
00074 
00076   double getLocalX(void) const { return myLocalReading.getX(); }
00078   double getLocalY(void) const { return myLocalReading.getY(); }
00081   ArPose getLocalPose(void) const { return myLocalReading; }
00082 
00084   ArPose getPoseTaken(void) const { return myReadingTaken; }
00085 
00087   ArPose getEncoderPoseTaken(void) const { return myEncoderPoseTaken; }
00088 
00090   double getSensorX(void) const { return mySensorPos.getX(); }
00092   double getSensorY(void) const { return mySensorPos.getY(); }
00094   double getSensorTh(void) const { return mySensorPos.getTh(); }
00095   
00098   bool getIgnoreThisReading(void) const { return myIgnoreThisReading; }
00099 
00101 
00111   int getExtraInt(void) const { return myExtraInt; }
00112 
00113 
00115 
00118   ArPose getSensorPosition(void) const { return mySensorPos; }
00119 
00121   double getSensorDX(void) const { return mySensorCos; }
00123   double getSensorDY(void) const { return mySensorSin; }
00124 
00126   double getXTaken(void) const { return myReadingTaken.getX(); }
00128   double getYTaken(void) const { return myReadingTaken.getY(); }
00130   double getThTaken(void) const { return myReadingTaken.getTh(); }
00131 
00133 
00137   unsigned int getCounterTaken(void) const { return myCounterTaken; }
00138 
00139   ArTime getTimeTaken(void) const { return myTimeTaken; }
00140   
00142   AREXPORT void newData(int range, ArPose robotPose, ArPose encoderPose,
00143             ArTransform trans, unsigned int counter, 
00144             ArTime timeTaken, bool ignoreThisReading = false,
00145             int extraInt = 0);
00146 
00148   AREXPORT void newData(int sx, int sy, ArPose robotPose,
00149             ArPose encoderPose,
00150             ArTransform trans, 
00151             unsigned int counter,
00152             ArTime timeTaken,
00153             bool ignoreThisReading = false,
00154             int extraInt = 0);
00155 
00157   AREXPORT void resetSensorPosition(double xPos, double yPos, double thPos,
00158                     bool forceComputation = false);
00159 
00161   AREXPORT void setIgnoreThisReading(bool ignoreThisReading) 
00162     { myIgnoreThisReading = ignoreThisReading; }
00163 
00165   AREXPORT void setExtraInt(int extraInt) 
00166     { myExtraInt = extraInt; }
00167 
00168 
00170   AREXPORT void applyTransform(ArTransform trans);
00172   AREXPORT void applyEncoderTransform(ArTransform trans);
00174   AREXPORT bool getAdjusted(void) { return myAdjusted; }
00176   AREXPORT void setAdjusted(bool adjusted) { myAdjusted = adjusted; }
00177 protected:
00178   unsigned int myCounterTaken;
00179   ArPose myReading;
00180   ArPose myLocalReading;  
00181   ArPose myReadingTaken;
00182   ArPose myEncoderPoseTaken;
00183   ArPose mySensorPos;
00184   double mySensorCos, mySensorSin;
00185   double myDistToCenter;
00186   double myAngleToCenter;
00187   int myRange;
00188   ArTime myTimeTaken;
00189   bool myIgnoreThisReading;
00190   int myExtraInt;
00191   bool myAdjusted;
00192 };
00193 
00194 #endif

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