Main MRPT website > C++ reference
MRPT logo

CObservationBeaconRanges.h

Go to the documentation of this file.
00001 /* +---------------------------------------------------------------------------+
00002    |          The Mobile Robot Programming Toolkit (MRPT) C++ library          |
00003    |                                                                           |
00004    |                   http://mrpt.sourceforge.net/                            |
00005    |                                                                           |
00006    |   Copyright (C) 2005-2011  University of Malaga                           |
00007    |                                                                           |
00008    |    This software was written by the Machine Perception and Intelligent    |
00009    |      Robotics Lab, University of Malaga (Spain).                          |
00010    |    Contact: Jose-Luis Blanco  <jlblanco@ctima.uma.es>                     |
00011    |                                                                           |
00012    |  This file is part of the MRPT project.                                   |
00013    |                                                                           |
00014    |     MRPT is free software: you can redistribute it and/or modify          |
00015    |     it under the terms of the GNU General Public License as published by  |
00016    |     the Free Software Foundation, either version 3 of the License, or     |
00017    |     (at your option) any later version.                                   |
00018    |                                                                           |
00019    |   MRPT is distributed in the hope that it will be useful,                 |
00020    |     but WITHOUT ANY WARRANTY; without even the implied warranty of        |
00021    |     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         |
00022    |     GNU General Public License for more details.                          |
00023    |                                                                           |
00024    |     You should have received a copy of the GNU General Public License     |
00025    |     along with MRPT.  If not, see <http://www.gnu.org/licenses/>.         |
00026    |                                                                           |
00027    +---------------------------------------------------------------------------+ */
00028 #ifndef CObservationBeaconRanges_H
00029 #define CObservationBeaconRanges_H
00030 
00031 #include <mrpt/utils/CSerializable.h>
00032 #include <mrpt/slam/CObservation.h>
00033 #include <mrpt/poses/CPoint3D.h>
00034 #include <mrpt/poses/CPose2D.h>
00035 #include <mrpt/poses/CPose3D.h>
00036 
00037 namespace mrpt
00038 {
00039 namespace slam
00040 {
00041         DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE( CObservationBeaconRanges, CObservation, OBS_IMPEXP  )
00042 
00043         /** Declares a class derived from "CObservation" that represents one (or more) range measurements to labeled beacons.
00044          * \sa CObservation
00045          */
00046         class OBS_IMPEXP CObservationBeaconRanges : public CObservation
00047         {
00048                 // This must be added to any CSerializable derived class:
00049                 DEFINE_SERIALIZABLE( CObservationBeaconRanges )
00050 
00051          public:
00052                 /** Default constructor.
00053                  */
00054                 CObservationBeaconRanges( );
00055 
00056                  /** Information about the sensor:
00057                   */
00058                 float   minSensorDistance, maxSensorDistance;
00059 
00060                 /** The "sigma" of the sensor, assuming a zero-mean Gaussian noise model.
00061                   */
00062                 float   stdError;
00063 
00064                 /** Each one of the measurements:
00065                         */
00066                 struct OBS_IMPEXP TMeasurement
00067                 {
00068                         TMeasurement() : sensorLocationOnRobot(), sensedDistance(0),beaconID(INVALID_BEACON_ID)
00069                         {}
00070 
00071                         /** The position of the sensor on the robot.
00072                           */
00073                         CPoint3D                sensorLocationOnRobot;
00074 
00075                         /** The sensed range itself (in meters).
00076                           */
00077                         float                   sensedDistance;
00078 
00079                         /** The ID of the sensed beacon (or INVALID_BEACON_ID)
00080                           */
00081                         int32_t                 beaconID;
00082                 };
00083 
00084                 /** The list of observed ranges:
00085                   */
00086                 std::deque<TMeasurement> sensedData;
00087 
00088                 /** The (X,Y,PHI) pose estimated by the UWB software, for comparison purposes (Added in streamming version 1)
00089                   */
00090                 CPose2D                                 auxEstimatePose;
00091 
00092 
00093                  /** Prints out the contents of the object.
00094                    */
00095                  void  debugPrintOut();
00096 
00097                 /** A general method to retrieve the sensor pose on the robot.
00098                   *  Note that most sensors will return a full (6D) CPose3D, but see the derived classes for more details or special cases.
00099                   * \sa setSensorPose
00100                   */
00101                 void getSensorPose( CPose3D &out_sensorPose ) const;
00102 
00103 
00104                 /** A general method to change the sensor pose on the robot.
00105                   *  Note that most sensors will use the full (6D) CPose3D, but see the derived classes for more details or special cases.
00106                   * \sa getSensorPose
00107                   */
00108                 void setSensorPose( const CPose3D &newSensorPose );
00109 
00110                 /** Easy look-up into the vector sensedData, returns the range for a given beacon, or 0 if the beacon is not observed.
00111                   */
00112                 float getSensedRangeByBeaconID(int32_t beaconID);
00113 
00114         }; // End of class def.
00115 
00116 
00117         } // End of namespace
00118 } // End of namespace
00119 
00120 #endif



Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN:exported at Tue Jan 25 21:56:31 UTC 2011