A class for storing a map of 3D probabilistic beacons, using a Montecarlo, Gaussian, or Sum of Gaussians (SOG) representation (for range-only SLAM).
The individual beacons are defined as mrpt::maps::CBeacon objects.
When invoking CBeaconMap::insertObservation(), landmarks will be extracted and fused into the map. The only currently supported observation type is mrpt::obs::CObservationBeaconRanges. See insertionOptions and likelihoodOptions for parameters used when creating and fusing beacon landmarks.
Use "TInsertionOptions::insertAsMonteCarlo" to select between 2 different behaviors:
Refer to the papers: []
Definition at line 44 of file maps/CBeaconMap.h.
#include <mrpt/maps/CBeaconMap.h>
Classes | |
struct | TInsertionOptions |
This struct contains data for choosing the method by which new beacons are inserted in the map. More... | |
struct | TLikelihoodOptions |
With this struct options are provided to the likelihood computations. More... | |
struct | TMapDefinition |
struct | TMapDefinitionBase |
Public Types | |
typedef std::deque< CBeacon > | TSequenceBeacons |
typedef std::deque< CBeacon >::iterator | iterator |
typedef std::deque< CBeacon >::const_iterator | const_iterator |
Public Member Functions | |
void * | operator new (size_t size) |
void * | operator new[] (size_t size) |
void | operator delete (void *ptr) throw () |
void | operator delete[] (void *ptr) throw () |
void | operator delete (void *memory, void *ptr) throw () |
void * | operator new (size_t size, const std::nothrow_t &) throw () |
void | operator delete (void *ptr, const std::nothrow_t &) throw () |
CBeaconMap () | |
Constructor. More... | |
void | resize (const size_t N) |
Resize the number of SOG modes. More... | |
const CBeacon & | operator[] (size_t i) const |
Access to individual beacons. More... | |
const CBeacon & | get (size_t i) const |
Access to individual beacons. More... | |
CBeacon & | operator[] (size_t i) |
Access to individual beacons. More... | |
CBeacon & | get (size_t i) |
Access to individual beacons. More... | |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
void | push_back (const CBeacon &m) |
Inserts a copy of the given mode into the SOG. More... | |
float | compute3DMatchingRatio (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose3D &otherMapPose, const TMatchingRatioParams ¶ms) const MRPT_OVERRIDE |
Computes the ratio in [0,1] of correspondences between "this" and the "otherMap" map, whose 6D pose relative to "this" is "otherMapPose" In the case of a multi-metric map, this returns the average between the maps. More... | |
bool | saveToMATLABScript3D (const std::string &file, const char *style="b", float confInterval=0.95f) const |
Save to a MATLAB script which displays 3D error ellipses for the map. More... | |
size_t | size () const |
Returns the stored landmarks count. More... | |
virtual void | determineMatching2D (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose2D &otherMapPose, mrpt::utils::TMatchingPairList &correspondences, const TMatchingParams ¶ms, TMatchingExtraResults &extraResults) const MRPT_OVERRIDE |
Computes the matching between this and another 2D point map, which includes finding: More... | |
void | computeMatchingWith3DLandmarks (const mrpt::maps::CBeaconMap *otherMap, mrpt::utils::TMatchingPairList &correspondences, float &correspondencesRatio, std::vector< bool > &otherCorrespondences) const |
Perform a search for correspondences between "this" and another lansmarks map: Firsly, the landmarks' descriptor is used to find correspondences, then inconsistent ones removed by looking at their 3D poses. More... | |
void | changeCoordinatesReference (const mrpt::poses::CPose3D &newOrg) |
Changes the reference system of the map to a given 3D pose. More... | |
void | changeCoordinatesReference (const mrpt::poses::CPose3D &newOrg, const mrpt::maps::CBeaconMap *otherMap) |
Changes the reference system of the map "otherMap" and save the result in "this" map. More... | |
bool | isEmpty () const MRPT_OVERRIDE |
Returns true if the map is empty/no observation has been inserted. More... | |
void | simulateBeaconReadings (const mrpt::poses::CPose3D &in_robotPose, const mrpt::poses::CPoint3D &in_sensorLocationOnRobot, mrpt::obs::CObservationBeaconRanges &out_Observations) const |
Simulates a reading toward each of the beacons in the landmarks map, if any. More... | |
void | saveMetricMapRepresentationToFile (const std::string &filNamePrefix) const MRPT_OVERRIDE |
This virtual method saves the map to a file "filNamePrefix"+< some_file_extension >, as an image or in any other applicable way (Notice that other methods to save the map may be implemented in classes implementing this virtual interface). More... | |
void | saveToTextFile (const std::string &fil) const |
Save a text file with a row per beacon, containing this 11 elements: More... | |
void | getAs3DObject (mrpt::opengl::CSetOfObjectsPtr &outObj) const MRPT_OVERRIDE |
Returns a 3D object representing the map. More... | |
const CBeacon * | getBeaconByID (CBeacon::TBeaconID id) const |
Returns a pointer to the beacon with the given ID, or NULL if it does not exist. More... | |
CBeacon * | getBeaconByID (CBeacon::TBeaconID id) |
Returns a pointer to the beacon with the given ID, or NULL if it does not exist. More... | |
void | clear () |
Erase all the contents of the map. More... | |
void | loadFromProbabilisticPosesAndObservations (const mrpt::maps::CSimpleMap &Map) |
Load the map contents from a CSimpleMap object, erasing all previous content of the map. More... | |
void | loadFromSimpleMap (const mrpt::maps::CSimpleMap &Map) |
Load the map contents from a CSimpleMap object, erasing all previous content of the map. More... | |
bool | insertObservation (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=NULL) |
Insert the observation information into this map. More... | |
bool | insertObservationPtr (const mrpt::obs::CObservationPtr &obs, const mrpt::poses::CPose3D *robotPose=NULL) |
A wrapper for smart pointers, just calls the non-smart pointer version. More... | |
double | computeObservationLikelihood (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom) |
Computes the log-likelihood of a given observation given an arbitrary robot 3D pose. More... | |
double | computeObservationLikelihood (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose2D &takenFrom) |
virtual bool | canComputeObservationLikelihood (const mrpt::obs::CObservation *obs) const |
Returns true if this map is able to compute a sensible likelihood function for this observation (i.e. More... | |
bool | canComputeObservationLikelihood (const mrpt::obs::CObservationPtr &obs) const |
double | computeObservationsLikelihood (const mrpt::obs::CSensoryFrame &sf, const mrpt::poses::CPose2D &takenFrom) |
Returns the sum of the log-likelihoods of each individual observation within a mrpt::obs::CSensoryFrame. More... | |
bool | canComputeObservationsLikelihood (const mrpt::obs::CSensoryFrame &sf) const |
Returns true if this map is able to compute a sensible likelihood function for this observation (i.e. More... | |
virtual void | determineMatching3D (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose3D &otherMapPose, mrpt::utils::TMatchingPairList &correspondences, const TMatchingParams ¶ms, TMatchingExtraResults &extraResults) const |
Computes the matchings between this and another 3D points map - method used in 3D-ICP. More... | |
virtual void | auxParticleFilterCleanUp () |
This method is called at the end of each "prediction-update-map insertion" cycle within "mrpt::slam::CMetricMapBuilderRBPF::processActionObservation". More... | |
virtual float | squareDistanceToClosestCorrespondence (float x0, float y0) const |
Returns the square distance from the 2D point (x0,y0) to the closest correspondence in the map. More... | |
virtual const mrpt::maps::CSimplePointsMap * | getAsSimplePointsMap () const |
If the map is a simple points map or it's a multi-metric map that contains EXACTLY one simple points map, return it. More... | |
virtual mrpt::maps::CSimplePointsMap * | getAsSimplePointsMap () |
virtual mxArray * | writeToMatlab () const |
Introduces a pure virtual method responsible for writing to a mxArray Matlab object, typically a MATLAB struct whose contents are documented in each derived class. More... | |
CObject * | clone () const |
Cloning interface for smart pointers. More... | |
RTTI classes and functions | |
mrpt::utils::CObjectPtr | duplicateGetSmartPtr () const |
Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer). More... | |
Static Public Member Functions | |
static void * | operator new (size_t size, void *ptr) |
Public Attributes | |
mrpt::maps::CBeaconMap::TLikelihoodOptions | likelihoodOptions |
mrpt::maps::CBeaconMap::TInsertionOptions | insertionOptions |
TMapGenericParams | genericMapParams |
Common params to all maps. More... | |
Static Public Attributes | |
static const mrpt::utils::TRuntimeClassId | classCObject |
RTTI stuff | |
static const mrpt::utils::TRuntimeClassId | classCMetricMap |
RTTI stuff | |
static const mrpt::utils::TRuntimeClassId | classCSerializable |
Protected Member Functions | |
virtual void | internal_clear () MRPT_OVERRIDE |
Internal method called by clear() More... | |
virtual bool | internal_insertObservation (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=NULL) MRPT_OVERRIDE |
Internal method called by insertObservation() More... | |
double | internal_computeObservationLikelihood (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom) MRPT_OVERRIDE |
Internal method called by computeObservationLikelihood() More... | |
void | publishEvent (const mrptEvent &e) const |
Called when you want this object to emit an event to all the observers currently subscribed to this object. More... | |
bool | hasSubscribers () const |
Can be called by a derived class before preparing an event for publishing with publishEvent to determine if there is no one subscribed, so it can save the wasted time preparing an event that will be not read. More... | |
CSerializable virtual methods | |
void | writeToStream (mrpt::utils::CStream &out, int *getVersion) const |
Introduces a pure virtual method responsible for writing to a CStream. More... | |
void | readFromStream (mrpt::utils::CStream &in, int version) |
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori. More... | |
Protected Attributes | |
TSequenceBeacons | m_beacons |
The individual beacons. More... | |
RTTI stuff | |
typedef CBeaconMapPtr | Ptr |
typedef CBeaconMapPtr | ConstPtr |
static mrpt::utils::CLASSINIT | _init_CBeaconMap |
static mrpt::utils::TRuntimeClassId | classCBeaconMap |
static const mrpt::utils::TRuntimeClassId * | classinfo |
static const mrpt::utils::TRuntimeClassId * | _GetBaseClass () |
virtual const mrpt::utils::TRuntimeClassId * | GetRuntimeClass () const |
Returns information about the class of an object in runtime. More... | |
virtual mrpt::utils::CObject * | duplicate () const |
Returns a copy of the object, indepently of its class. More... | |
static mrpt::utils::CObject * | CreateObject () |
static CBeaconMapPtr | Create () |
Map Definition Interface stuff (see mrpt::maps::TMetricMapInitializer) @{ | |
static const size_t | m_private_map_register_id = mrpt::maps::internal::TMetricMapTypesRegistry::Instance().doRegister( "CBeaconMap,beaconMap" ,& mrpt::maps::CBeaconMap ::MapDefinition,& mrpt::maps::CBeaconMap ::internal_CreateFromMapDefinition) |
ID used to initialize class registration (just ignore it) More... | |
static mrpt::maps::TMetricMapInitializer * | MapDefinition () |
Returns default map definition initializer. More... | |
static CBeaconMap * | CreateFromMapDefinition (const mrpt::maps::TMetricMapInitializer &def) |
Constructor from a map definition structure: initializes the map and its parameters accordingly. More... | |
static mrpt::maps::CMetricMap * | internal_CreateFromMapDefinition (const mrpt::maps::TMetricMapInitializer &def) |
typedef std::deque<CBeacon>::const_iterator mrpt::maps::CBeaconMap::const_iterator |
Definition at line 52 of file maps/CBeaconMap.h.
typedef CBeaconMapPtr mrpt::maps::CBeaconMap::ConstPtr |
Definition at line 47 of file maps/CBeaconMap.h.
typedef std::deque<CBeacon>::iterator mrpt::maps::CBeaconMap::iterator |
Definition at line 51 of file maps/CBeaconMap.h.
typedef CBeaconMapPtr mrpt::maps::CBeaconMap::Ptr |
A typedef for the associated smart pointer
Definition at line 47 of file maps/CBeaconMap.h.
typedef std::deque<CBeacon> mrpt::maps::CBeaconMap::TSequenceBeacons |
Definition at line 50 of file maps/CBeaconMap.h.
CBeaconMap::CBeaconMap | ( | ) |
Constructor.
Definition at line 82 of file CBeaconMap.cpp.
|
staticprotected |
|
inlinevirtualinherited |
This method is called at the end of each "prediction-update-map insertion" cycle within "mrpt::slam::CMetricMapBuilderRBPF::processActionObservation".
This method should normally do nothing, but in some cases can be used to free auxiliary cached variables.
Reimplemented in mrpt::maps::CLandmarksMap, and mrpt::maps::CMultiMetricMap.
Definition at line 232 of file maps/CMetricMap.h.
|
inline |
Definition at line 89 of file maps/CBeaconMap.h.
|
inline |
Definition at line 90 of file maps/CBeaconMap.h.
|
virtualinherited |
Returns true if this map is able to compute a sensible likelihood function for this observation (i.e.
an occupancy grid map cannot with an image). See: Maps and observations compatibility matrix
obs | The observation. |
Definition at line 189 of file CMetricMap.cpp.
|
inherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inherited |
Returns true if this map is able to compute a sensible likelihood function for this observation (i.e.
an occupancy grid map cannot with an image). See: Maps and observations compatibility matrix
sf | The observations. |
Definition at line 94 of file CMetricMap.cpp.
References mrpt::obs::CSensoryFrame::begin(), and mrpt::obs::CSensoryFrame::end().
void CBeaconMap::changeCoordinatesReference | ( | const mrpt::poses::CPose3D & | newOrg | ) |
Changes the reference system of the map to a given 3D pose.
Definition at line 754 of file CBeaconMap.cpp.
Referenced by compute3DMatchingRatio(), and determineMatching2D().
void CBeaconMap::changeCoordinatesReference | ( | const mrpt::poses::CPose3D & | newOrg, |
const mrpt::maps::CBeaconMap * | otherMap | ||
) |
Changes the reference system of the map "otherMap" and save the result in "this" map.
Definition at line 764 of file CBeaconMap.cpp.
|
inherited |
Erase all the contents of the map.
Definition at line 34 of file CMetricMap.cpp.
Referenced by mrpt::maps::CGasConcentrationGridMap2D::CGasConcentrationGridMap2D(), mrpt::maps::CHeightGridMap2D_MRF::CHeightGridMap2D_MRF(), mrpt::maps::CReflectivityGridMap2D::clear(), mrpt::maps::CHeightGridMap2D::clear(), mrpt::maps::CRandomFieldGridMap2D::clear(), mrpt::maps::CWirelessPowerGridMap2D::CWirelessPowerGridMap2D(), mrpt::maps::CPointsMap::extractCylinder(), mrpt::maps::CPointsMap::extractPoints(), mrpt::opengl::CAngularObservationMesh::generatePointCloud(), mrpt::maps::COccupancyGridMap2D::getAsPointCloud(), mrpt::maps::CPointsMap::load2Dor3D_from_text_file(), mrpt::maps::CLandmarksMap::loadOccupancyFeaturesFrom2DRangeScan(), mrpt::nav::CReactiveNavigationSystem3D::loggingGetWSObstaclesAndShape(), mrpt::hmtslam::CLSLAM_RBPF_2DLASER::prediction_and_update_pfOptimalProposal(), mrpt::vision::projectMatchedFeatures(), run_rnav_test(), mrpt::maps::CRandomFieldGridMap2D::setSize(), mrpt::nav::PlannerTPS_VirtualBase::transformPointcloudWithSquareClipping(), and mrpt::hmtslam::CLocalMetricHypothesis::updateAreaFromLMH().
|
inlineinherited |
|
virtual |
Computes the ratio in [0,1] of correspondences between "this" and the "otherMap" map, whose 6D pose relative to "this" is "otherMapPose" In the case of a multi-metric map, this returns the average between the maps.
This method always return 0 for grid maps.
otherMap | [IN] The other map to compute the matching with. |
otherMapPose | [IN] The 6D pose of the other map as seen from "this". |
params | [IN] Matching parameters |
Reimplemented from mrpt::maps::CMetricMap.
Definition at line 1126 of file CBeaconMap.cpp.
References changeCoordinatesReference(), CLASS_ID, computeMatchingWith3DLandmarks(), mrpt::maps::CMetricMap::GetRuntimeClass(), MRPT_END, and MRPT_START.
void CBeaconMap::computeMatchingWith3DLandmarks | ( | const mrpt::maps::CBeaconMap * | otherMap, |
mrpt::utils::TMatchingPairList & | correspondences, | ||
float & | correspondencesRatio, | ||
std::vector< bool > & | otherCorrespondences | ||
) | const |
Perform a search for correspondences between "this" and another lansmarks map: Firsly, the landmarks' descriptor is used to find correspondences, then inconsistent ones removed by looking at their 3D poses.
otherMap | [IN] The other map. |
correspondences | [OUT] The matched pairs between maps. |
correspondencesRatio | [OUT] This is NumberOfMatchings / NumberOfLandmarksInTheAnotherMap |
otherCorrespondences | [OUT] Will be returned with a vector containing "true" for the indexes of the other map's landmarks with a correspondence. |
Definition at line 775 of file CBeaconMap.cpp.
References m_beacons, MRPT_END, MRPT_START, mrpt::utils::TMatchingPair::other_idx, mrpt::utils::TMatchingPair::other_x, mrpt::utils::TMatchingPair::other_y, mrpt::utils::TMatchingPair::other_z, mrpt::utils::TMatchingPair::this_idx, mrpt::utils::TMatchingPair::this_x, mrpt::utils::TMatchingPair::this_y, mrpt::utils::TMatchingPair::this_z, mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::x(), and mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::y().
Referenced by compute3DMatchingRatio().
|
inherited |
Computes the log-likelihood of a given observation given an arbitrary robot 3D pose.
See: Maps and observations compatibility matrix
takenFrom | The robot's pose the observation is supposed to be taken from. |
obs | The observation. |
Definition at line 196 of file CMetricMap.cpp.
Referenced by mrpt::maps::CMultiMetricMapPDF::PF_SLAM_computeObservationLikelihoodForParticle().
|
inherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 86 of file CMetricMap.cpp.
|
inherited |
Returns the sum of the log-likelihoods of each individual observation within a mrpt::obs::CSensoryFrame.
See: Maps and observations compatibility matrix
takenFrom | The robot's pose the observation is supposed to be taken from. |
sf | The set of observations in a CSensoryFrame. |
Definition at line 75 of file CMetricMap.cpp.
References mrpt::obs::CSensoryFrame::begin(), and mrpt::obs::CSensoryFrame::end().
Referenced by mrpt::hmtslam::CLSLAM_RBPF_2DLASER::auxiliarComputeObservationLikelihood().
|
static |
|
static |
Constructor from a map definition structure: initializes the map and its parameters accordingly.
Definition at line 42 of file CBeaconMap.cpp.
|
static |
|
virtual |
Computes the matching between this and another 2D point map, which includes finding:
The algorithm is:
This method is the most time critical one into ICP-like algorithms.
otherMap | [IN] The other map to compute the matching with. |
otherMapPose | [IN] The pose of the other map as seen from "this". |
params | [IN] Parameters for the determination of pairings. |
correspondences | [OUT] The detected matchings pairs. |
extraResults | [OUT] Other results. |
Reimplemented from mrpt::maps::CMetricMap.
Definition at line 719 of file CBeaconMap.cpp.
References ASSERT_, changeCoordinatesReference(), CLASS_ID, mrpt::maps::CMetricMap::GetRuntimeClass(), MRPT_END, MRPT_START, and MRPT_UNUSED_PARAM.
|
virtualinherited |
Computes the matchings between this and another 3D points map - method used in 3D-ICP.
This method finds the set of point pairs in each map.
The method is the most time critical one into ICP-like algorithms.
The algorithm is:
otherMap | [IN] The other map to compute the matching with. |
otherMapPose | [IN] The pose of the other map as seen from "this". |
params | [IN] Parameters for the determination of pairings. |
correspondences | [OUT] The detected matchings pairs. |
extraResults | [OUT] Other results. |
Reimplemented in mrpt::maps::CPointsMap.
Definition at line 150 of file CMetricMap.cpp.
References MRPT_END, MRPT_START, MRPT_UNUSED_PARAM, and THROW_EXCEPTION.
Referenced by mrpt::slam::CICP::ICP3D_Method_Classic().
|
virtual |
Returns a copy of the object, indepently of its class.
Implements mrpt::utils::CObject.
|
inlineinherited |
Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer).
Definition at line 162 of file CObject.h.
References mrpt::utils::CObjectPtr.
Referenced by mrpt::obs::CRawlog::addActions(), mrpt::slam::CIncrementalMapPartitioner::addMapFrame(), and mrpt::obs::CRawlog::addObservations().
|
inline |
Definition at line 91 of file maps/CBeaconMap.h.
|
inline |
Definition at line 92 of file maps/CBeaconMap.h.
|
inline |
|
inline |
|
virtual |
Returns a 3D object representing the map.
Implements mrpt::maps::CMetricMap.
Definition at line 1097 of file CBeaconMap.cpp.
References mrpt::opengl::stock_objects::CornerXYZ(), mrpt::maps::TMapGenericParams::enableSaveAs3DObject, mrpt::maps::CMetricMap::genericMapParams, m_beacons, MRPT_END, and MRPT_START.
Referenced by saveMetricMapRepresentationToFile().
|
inlinevirtualinherited |
If the map is a simple points map or it's a multi-metric map that contains EXACTLY one simple points map, return it.
Otherwise, return NULL
Reimplemented in mrpt::maps::CPointsMap, mrpt::maps::CMultiMetricMap, and mrpt::maps::CSimplePointsMap.
Definition at line 240 of file maps/CMetricMap.h.
Referenced by mrpt::maps::CPointsMap::compute3DMatchingRatio().
|
inlinevirtualinherited |
Reimplemented in mrpt::maps::CPointsMap, mrpt::maps::CMultiMetricMap, and mrpt::maps::CSimplePointsMap.
Definition at line 241 of file maps/CMetricMap.h.
const CBeacon * CBeaconMap::getBeaconByID | ( | CBeacon::TBeaconID | id | ) | const |
Returns a pointer to the beacon with the given ID, or NULL if it does not exist.
Definition at line 1161 of file CBeaconMap.cpp.
References m_beacons.
CBeacon * CBeaconMap::getBeaconByID | ( | CBeacon::TBeaconID | id | ) |
Returns a pointer to the beacon with the given ID, or NULL if it does not exist.
Definition at line 1172 of file CBeaconMap.cpp.
References m_beacons.
|
virtual |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::maps::CMetricMap.
|
inlineprotectedinherited |
Can be called by a derived class before preparing an event for publishing with publishEvent to determine if there is no one subscribed, so it can save the wasted time preparing an event that will be not read.
Definition at line 52 of file CObservable.h.
Referenced by mrpt::gui::CWindowDialog::OnMouseDown(), mrpt::gui::CWindowDialog::OnMouseMove(), mrpt::gui::CWindowDialog::OnResize(), and mrpt::opengl::COpenGLViewport::render().
|
inherited |
Insert the observation information into this map.
This method must be implemented in derived classes. See: Maps and observations compatibility matrix
obs | The observation |
robotPose | The 3D pose of the robot mobile base in the map reference system, or NULL (default) if you want to use the origin. |
Definition at line 102 of file CMetricMap.cpp.
Referenced by ICPTests::align2scans(), mrpt::maps::COccupancyGridMap2D::computeObservationLikelihood_likelihoodField_Thrun(), mrpt::graphslam::deciders::CRangeScanOps< GRAPH_T >::getICPEdge(), CAngularObservationMesh_fnctr::operator()(), TEST(), and mrpt::graphslam::CGraphSlamEngine< GRAPH_T >::updateMapVisualization().
|
inherited |
A wrapper for smart pointers, just calls the non-smart pointer version.
See: Maps and observations compatibility matrix
Definition at line 118 of file CMetricMap.cpp.
References MRPT_END, MRPT_START, and THROW_EXCEPTION.
Referenced by mrpt::slam::CMetricMapBuilderICP::processObservation().
|
protectedvirtual |
Internal method called by clear()
Implements mrpt::maps::CMetricMap.
Definition at line 92 of file CBeaconMap.cpp.
|
protectedvirtual |
Internal method called by computeObservationLikelihood()
Implements mrpt::maps::CMetricMap.
Definition at line 172 of file CBeaconMap.cpp.
References mrpt::math::averageLogLikelihood(), mrpt::poses::CPointPDFSOG::begin(), CLASS_ID, mrpt::poses::CPointPDFGaussian::cov, mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::distance3DTo(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::distanceTo(), mrpt::poses::CPointPDFSOG::end(), mrpt::obs::CObservation::GetRuntimeClass(), mrpt::math::isNaN(), mrpt::maps::CBeacon::m_locationGauss, mrpt::maps::CBeacon::m_locationMC, mrpt::maps::CBeacon::m_locationSOG, mrpt::bayes::CParticleFilterData< T >::m_particles, mrpt::maps::CBeacon::m_typePDF, mrpt::obs::CObservationBeaconRanges::maxSensorDistance, mrpt::poses::CPointPDFGaussian::mean, mrpt::obs::CObservationBeaconRanges::minSensorDistance, MRPT_CHECK_NORMAL_NUMBER, MRPT_END, MRPT_START, mrpt::maps::CBeacon::pdfGauss, mrpt::maps::CBeacon::pdfMonteCarlo, mrpt::maps::CBeacon::pdfSOG, mrpt::obs::CObservationBeaconRanges::sensedData, mrpt::poses::CPointPDFSOG::size(), mrpt::math::square(), THROW_EXCEPTION, mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::x(), and mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::y().
|
static |
Definition at line 66 of file CBeaconMap.cpp.
References mrpt::maps::CBeaconMap::TMapDefinition::insertionOpts, and mrpt::maps::CBeaconMap::TMapDefinition::likelihoodOpts.
|
protectedvirtual |
Internal method called by insertObservation()
Implements mrpt::maps::CMetricMap.
Definition at line 346 of file CBeaconMap.cpp.
References ASSERT_, mrpt::poses::CPointPDFSOG::begin(), CLASS_ID, mrpt::poses::CPointPDFParticles::clear(), mrpt::poses::CPointPDFGaussian::cov, DEG2RAD, mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::distance3DTo(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::distanceTo(), mrpt::random::CRandomGenerator::drawGaussian1D(), mrpt::random::CRandomGenerator::drawUniform(), mrpt::poses::CPointPDFSOG::end(), mrpt::poses::CPointPDFSOG::erase(), mrpt::bayes::CParticleFilterDataImpl< Derived, particle_list_t >::ESS(), mrpt::maps::CBeacon::generateRingSOG(), mrpt::poses::CPointPDFParticles::getCovarianceAndMean(), mrpt::poses::CPointPDFSOG::getCovarianceAndMean(), mrpt::obs::CObservation::GetRuntimeClass(), mrpt::bayes::CParticleFilterData< T >::getWeights(), mrpt::maps::CBeacon::m_ID, mrpt::maps::CBeacon::m_locationGauss, mrpt::maps::CBeacon::m_locationMC, mrpt::maps::CBeacon::m_locationSOG, mrpt::bayes::CParticleFilterData< T >::m_particles, M_PI, mrpt::maps::CBeacon::m_typePDF, mrpt::utils::max3(), mrpt::poses::CPointPDFGaussian::mean, MRPT_END, MRPT_START, mrpt::poses::CPointPDFSOG::normalizeWeights(), mrpt::maps::CBeacon::pdfGauss, mrpt::maps::CBeacon::pdfMonteCarlo, mrpt::maps::CBeacon::pdfSOG, mrpt::bayes::CParticleFilterDataImpl< Derived, particle_list_t >::performSubstitution(), R, mrpt::random::randomGenerator, mrpt::utils::round(), mrpt::obs::CObservationBeaconRanges::sensedData, mrpt::poses::CPointPDFParticles::setSize(), mrpt::math::square(), THROW_EXCEPTION, mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::x(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::x_incr(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::y(), and mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::y_incr().
|
virtual |
Returns true if the map is empty/no observation has been inserted.
Implements mrpt::maps::CMetricMap.
Definition at line 984 of file CBeaconMap.cpp.
References size().
|
inherited |
Load the map contents from a CSimpleMap object, erasing all previous content of the map.
This is automaticed invoking "insertObservation" for each observation at the mean 3D robot pose as given by the "poses::CPosePDF" in the CSimpleMap object.
std::exception | Some internal steps in invoked methods can raise exceptions on invalid parameters, etc... |
Definition at line 48 of file CMetricMap.cpp.
References mrpt::utils::clear(), mrpt::maps::CSimpleMap::get(), and mrpt::maps::CSimpleMap::size().
Referenced by run_test_pf_localization().
|
inlineinherited |
Load the map contents from a CSimpleMap object, erasing all previous content of the map.
This is automaticed invoking "insertObservation" for each observation at the mean 3D robot pose as given by the "poses::CPosePDF" in the CSimpleMap object.
std::exception | Some internal steps in invoked methods can raise exceptions on invalid parameters, etc... |
Definition at line 105 of file maps/CMetricMap.h.
Referenced by mrpt::maps::CRandomFieldGridMap2D::internal_clear().
|
static |
Returns default map definition initializer.
See mrpt::maps::TMetricMapInitializer
Definition at line 42 of file CBeaconMap.cpp.
|
inline |
Definition at line 47 of file maps/CBeaconMap.h.
Definition at line 47 of file maps/CBeaconMap.h.
Definition at line 47 of file maps/CBeaconMap.h.
Definition at line 47 of file maps/CBeaconMap.h.
Definition at line 47 of file maps/CBeaconMap.h.
|
inline |
Definition at line 47 of file maps/CBeaconMap.h.
|
inline |
Definition at line 47 of file maps/CBeaconMap.h.
|
inline |
Definition at line 47 of file maps/CBeaconMap.h.
|
inline |
|
inline |
Called when you want this object to emit an event to all the observers currently subscribed to this object.
Definition at line 49 of file CObservable.cpp.
References MRPT_END, and MRPT_START.
Referenced by mrpt::gui::CDisplayWindow3D::internal_emitGrabImageEvent(), mrpt::gui::CWindowDialog::OnChar(), mrpt::gui::CWindowDialog::OnClose(), mrpt::gui::C3DWindowDialog::OnClose(), mrpt::gui::CWindowDialog::OnMouseDown(), mrpt::gui::CWindowDialog::OnMouseMove(), mrpt::gui::CWindowDialog::OnResize(), mrpt::gui::C3DWindowDialog::OnResize(), and mrpt::opengl::COpenGLViewport::render().
Inserts a copy of the given mode into the SOG.
Definition at line 95 of file maps/CBeaconMap.h.
|
protectedvirtual |
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori.
in | The input binary stream where the object data must read from. |
version | The version of the object stored in the stream: use this version number in your code to know how to read the incoming data. |
std::exception | On any error, see CStream::ReadBuffer |
Implements mrpt::utils::CSerializable.
Definition at line 141 of file CBeaconMap.cpp.
References mrpt::utils::clear(), MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION, and version.
void CBeaconMap::resize | ( | const size_t | N | ) |
Resize the number of SOG modes.
Definition at line 108 of file CBeaconMap.cpp.
|
virtual |
This virtual method saves the map to a file "filNamePrefix"+< some_file_extension >, as an image or in any other applicable way (Notice that other methods to save the map may be implemented in classes implementing this virtual interface).
In the case of this class, these files are generated:
Implements mrpt::maps::CMetricMap.
Definition at line 1035 of file CBeaconMap.cpp.
References mrpt::opengl::CSetOfObjects::Create(), mrpt::opengl::CGridPlaneXY::Create(), mrpt::system::os::fclose(), mrpt::system::os::fopen(), mrpt::system::os::fprintf(), getAs3DObject(), mrpt::opengl::COpenGLScene::insert(), m_beacons, MRPT_END, MRPT_START, mrpt::maps::CBeacon::pdfGauss, mrpt::maps::CBeacon::pdfMonteCarlo, mrpt::maps::CBeacon::pdfSOG, saveToMATLABScript3D(), and saveToTextFile().
bool CBeaconMap::saveToMATLABScript3D | ( | const std::string & | file, |
const char * | style = "b" , |
||
float | confInterval = 0.95f |
||
) | const |
Save to a MATLAB script which displays 3D error ellipses for the map.
file | The name of the file to save the script to. |
style | The MATLAB-like string for the style of the lines (see 'help plot' in MATLAB for posibilities) |
stdCount | The ellipsoids will be drawn from the center to a given confidence interval in [0,1], e.g. 2 sigmas=0.95 (default is 2std = 0.95 confidence intervals) |
Definition at line 849 of file CBeaconMap.cpp.
References mrpt::system::os::fclose(), mrpt::system::os::fopen(), mrpt::system::os::fprintf(), mrpt::utils::CStringList::getText(), and MRPT_UNUSED_PARAM.
Referenced by saveMetricMapRepresentationToFile().
void CBeaconMap::saveToTextFile | ( | const std::string & | fil | ) | const |
Save a text file with a row per beacon, containing this 11 elements:
Definition at line 1186 of file CBeaconMap.cpp.
References ASSERT_, mrpt::system::os::fclose(), mrpt::system::os::fopen(), mrpt::system::os::fprintf(), m_beacons, MRPT_END, MRPT_START, and mrpt::math::square().
Referenced by saveMetricMapRepresentationToFile().
void CBeaconMap::simulateBeaconReadings | ( | const mrpt::poses::CPose3D & | in_robotPose, |
const mrpt::poses::CPoint3D & | in_sensorLocationOnRobot, | ||
mrpt::obs::CObservationBeaconRanges & | out_Observations | ||
) | const |
Simulates a reading toward each of the beacons in the landmarks map, if any.
in_robotPose | This robot pose is used to simulate the ranges to each beacon. |
in_sensorLocationOnRobot | The 3D position of the sensor on the robot |
out_Observations | The results will be stored here. NOTICE that the fields "CObservationBeaconRanges::minSensorDistance","CObservationBeaconRanges::maxSensorDistance" and "CObservationBeaconRanges::stdError" MUST BE FILLED OUT before calling this function. An observation will be generated for each beacon in the map, but notice that some of them may be missed if out of the sensor maximum range. |
Definition at line 992 of file CBeaconMap.cpp.
References mrpt::obs::CObservationBeaconRanges::TMeasurement::beaconID, mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::distanceTo(), mrpt::random::CRandomGenerator::drawGaussian1D(), m_beacons, mrpt::obs::CObservationBeaconRanges::minSensorDistance, mrpt::random::randomGenerator, mrpt::obs::CObservationBeaconRanges::sensedData, mrpt::obs::CObservationBeaconRanges::TMeasurement::sensedDistance, mrpt::obs::CObservationBeaconRanges::TMeasurement::sensorLocationOnRobot, and mrpt::obs::CObservationBeaconRanges::stdError.
size_t CBeaconMap::size | ( | ) | const |
Returns the stored landmarks count.
Definition at line 100 of file CBeaconMap.cpp.
Referenced by isEmpty().
|
virtualinherited |
Returns the square distance from the 2D point (x0,y0) to the closest correspondence in the map.
Reimplemented in mrpt::maps::CPointsMap.
Definition at line 178 of file CMetricMap.cpp.
References MRPT_END, MRPT_START, MRPT_UNUSED_PARAM, and THROW_EXCEPTION.
|
inlinevirtualinherited |
Introduces a pure virtual method responsible for writing to a mxArray
Matlab object, typically a MATLAB struct
whose contents are documented in each derived class.
mxArray
(caller is responsible of memory freeing) or NULL is class does not support conversion to MATLAB. Definition at line 79 of file CSerializable.h.
|
protectedvirtual |
Introduces a pure virtual method responsible for writing to a CStream.
This can not be used directly be users, instead use "stream << object;" for writing it to a stream.
out | The output binary stream where object must be dumped. |
getVersion | If NULL, the object must be dumped. If not, only the version of the object dump must be returned in this pointer. This enables the versioning of objects dumping and backward compatibility with previously stored data. |
std::exception | On any error, see CStream::WriteBuffer |
Implements mrpt::utils::CSerializable.
Definition at line 118 of file CBeaconMap.cpp.
|
staticprotected |
Definition at line 47 of file maps/CBeaconMap.h.
|
static |
Definition at line 47 of file maps/CBeaconMap.h.
|
staticinherited |
Definition at line 57 of file maps/CMetricMap.h.
|
staticinherited |
|
staticinherited |
Definition at line 42 of file CSerializable.h.
|
static |
Definition at line 47 of file maps/CBeaconMap.h.
|
inherited |
Common params to all maps.
Definition at line 227 of file maps/CMetricMap.h.
Referenced by mrpt::maps::internal::TMetricMapTypesRegistry::factoryMapObjectFromDefinition(), mrpt::maps::CGasConcentrationGridMap2D::getAs3DObject(), mrpt::maps::CReflectivityGridMap2D::getAs3DObject(), mrpt::maps::CHeightGridMap2D::getAs3DObject(), getAs3DObject(), mrpt::maps::CRandomFieldGridMap2D::getAs3DObject(), mrpt::maps::CLandmarksMap::getAs3DObject(), mrpt::maps::CPointsMap::getAs3DObject(), mrpt::maps::CGasConcentrationGridMap2D::readFromStream(), mrpt::maps::CReflectivityGridMap2D::readFromStream(), mrpt::maps::CGasConcentrationGridMap2D::writeToStream(), and mrpt::maps::CReflectivityGridMap2D::writeToStream().
mrpt::maps::CBeaconMap::TInsertionOptions mrpt::maps::CBeaconMap::insertionOptions |
Referenced by mrpt::maps::CBeacon::generateRingSOG().
mrpt::maps::CBeaconMap::TLikelihoodOptions mrpt::maps::CBeaconMap::likelihoodOptions |
Referenced by mrpt::maps::CBeacon::generateRingSOG().
|
protected |
The individual beacons.
Definition at line 55 of file maps/CBeaconMap.h.
Referenced by computeMatchingWith3DLandmarks(), getAs3DObject(), getBeaconByID(), saveMetricMapRepresentationToFile(), saveToTextFile(), and simulateBeaconReadings().
|
static |
ID used to initialize class registration (just ignore it)
Definition at line 259 of file maps/CBeaconMap.h.
Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020 |