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

ArSensorReading.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 ARSENSORREADING_H
00028 #define ARSENSORREADING_H
00029 
00030 #include "ariaTypedefs.h"
00031 #include "ariaUtil.h"
00032 #include "ArTransform.h"
00033 
00035 
00043 class ArSensorReading
00044 {
00045 public:
00047   ArSensorReading(double xPos = 0.0, double yPos = 0.0, double thPos = 0.0);
00049   ArSensorReading(const ArSensorReading & reading);
00051   ArSensorReading &operator=(const ArSensorReading &reading);
00053   virtual ~ArSensorReading();
00054 
00056 
00059   int getRange(void) const { return myRange; }
00060 
00062 
00067   bool isNew(unsigned int counter) const { return counter == myCounterTaken; }
00069   double getX(void) const { return myReading.getX(); }
00071   double getY(void) const { return myReading.getY(); }
00074   ArPose getPose(void) const { return myReading; }
00075 
00077   double getLocalX(void) const { return myLocalReading.getX(); }
00079   double getLocalY(void) const { return myLocalReading.getY(); }
00082   ArPose getLocalPose(void) const { return myLocalReading; }
00083 
00085   ArPose getPoseTaken(void) const { return myReadingTaken; }
00086 
00088   ArPose getEncoderPoseTaken(void) const { return myEncoderPoseTaken; }
00089 
00091   double getSensorX(void) const { return mySensorPos.getX(); }
00093   double getSensorY(void) const { return mySensorPos.getY(); }
00095   double getSensorTh(void) const { return mySensorPos.getTh(); }
00096   
00098   bool getIgnoreThisReading(void) const { return myIgnoreThisReading; }
00099 
00100 
00102 
00105   ArPose getSensorPosition(void) const { return mySensorPos; }
00106 
00108   double getSensorDX(void) const { return mySensorCos; }
00110   double getSensorDY(void) const { return mySensorSin; }
00111 
00113   double getXTaken(void) const { return myReadingTaken.getX(); }
00115   double getYTaken(void) const { return myReadingTaken.getY(); }
00117   double getThTaken(void) const { return myReadingTaken.getTh(); }
00118 
00120 
00124   unsigned int getCounterTaken(void) const { return myCounterTaken; }
00125 
00126   ArTime getTimeTaken(void) const { return myTimeTaken; }
00127   
00129   void newData(int range, ArPose robotPose, ArPose encoderPose,
00130                         ArTransform trans, unsigned int counter, 
00131                         ArTime timeTaken, bool ignoreThisReading = false);
00132 
00134   void newData(int sx, int sy, ArPose robotPose,
00135                         ArPose encoderPose,
00136                         ArTransform trans, 
00137                         unsigned int counter,
00138                         ArTime timeTaken,
00139                         bool ignoreThisReading = false);
00140 
00142   void resetSensorPosition(double xPos, double yPos, double thPos,
00143                                     bool forceComputation = false);
00144 
00146   void setIgnoreThisReading(bool ignoreThisReading) 
00147     { myIgnoreThisReading = ignoreThisReading; }
00148   
00150   void applyTransform(ArTransform trans);
00151 protected:
00152   unsigned int myCounterTaken;
00153   ArPose myReading;
00154   ArPose myLocalReading;  
00155   ArPose myReadingTaken;
00156   ArPose myEncoderPoseTaken;
00157   ArPose mySensorPos;
00158   double mySensorCos, mySensorSin;
00159   double myDistToCenter;
00160   double myAngleToCenter;
00161   int myRange;
00162   ArTime myTimeTaken;
00163   bool myIgnoreThisReading;
00164 };
00165 
00166 #endif

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