MRPT
2.0.4
|
A class for storing a map of 3D probabilistic landmarks.
Currently these types of landmarks are defined: (see mrpt::maps::CLandmark)
Observation class: | Generated Landmarks: | Comments: |
CObservationImage | vlSIFT | 1) A SIFT feature is created for each SIFT detected in the image, 2) Correspondences between SIFTs features and existing ones are finded by computeMatchingWith3DLandmarks, 3) The corresponding feaures are fused, and the new ones added, with an initial uncertainty according to insertionOptions |
CObservationStereoImages | vlSIFT | Each image is separately procesed by the method for CObservationImage observations |
CObservationStereoImages | vlColor | TODO... |
CObservation2DRangeScan | glOccupancy | A landmark is added for each range in the scan, with its appropiate covariance matrix derived from the jacobians matrixes. |
Definition at line 74 of file CLandmarksMap.h.
#include <mrpt/maps/CLandmarksMap.h>
Classes | |
struct | TCustomSequenceLandmarks |
The list of landmarks: the wrapper class is just for maintaining the KD-Tree representation. More... | |
struct | TFuseOptions |
With this struct options are provided to the fusion process. More... | |
struct | TInsertionOptions |
With this struct options are provided to the observation insertion process. More... | |
struct | TInsertionResults |
This struct stores extra results from invoking insertObservation. More... | |
struct | TLikelihoodOptions |
With this struct options are provided to the likelihood computations. More... | |
struct | TMapDefinition |
struct | TMapDefinitionBase |
Public Types | |
using | landmark_type = mrpt::maps::CLandmark |
Public Member Functions | |
double | internal_computeObservationLikelihood (const mrpt::obs::CObservation &obs, const mrpt::poses::CPose3D &takenFrom) override |
Computes the (logarithmic) likelihood that a given observation was taken from a given pose in the world being modeled with this map. More... | |
CLandmarksMap ()=default | |
~CLandmarksMap () override=default | |
mrpt::maps::CLandmark::TLandmarkID | getMapMaxID () |
float | compute3DMatchingRatio (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose3D &otherMapPose, const TMatchingRatioParams ¶ms) const 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 | saveToTextFile (std::string file) |
Save to a text file. More... | |
bool | saveToMATLABScript2D (std::string file, const char *style="b", float stdCount=2.0f) |
Save to a MATLAB script which displays 2D error ellipses for the map (top-view, projection on the XY plane). More... | |
bool | saveToMATLABScript3D (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... | |
double | computeLikelihood_RSLC_2007 (const CLandmarksMap *s, const mrpt::poses::CPose2D &sensorPose) |
Computes the (logarithmic) likelihood function for a sensed observation "o" according to "this" map. More... | |
void | loadSiftFeaturesFromImageObservation (const mrpt::obs::CObservationImage &obs, const mrpt::vision::CFeatureExtraction::TOptions &feat_options=mrpt::vision::CFeatureExtraction::TOptions(mrpt::vision::featSIFT)) |
Loads into this landmarks map the SIFT features extracted from an image observation (Previous contents of map will be erased) The robot is assumed to be at the origin of the map. More... | |
void | loadSiftFeaturesFromStereoImageObservation (const mrpt::obs::CObservationStereoImages &obs, mrpt::maps::CLandmark::TLandmarkID fID, const mrpt::vision::CFeatureExtraction::TOptions &feat_options=mrpt::vision::CFeatureExtraction::TOptions(mrpt::vision::featSIFT)) |
Loads into this landmarks map the SIFT features extracted from an observation consisting of a pair of stereo-image (Previous contents of map will be erased) The robot is assumed to be at the origin of the map. More... | |
void | loadOccupancyFeaturesFrom2DRangeScan (const mrpt::obs::CObservation2DRangeScan &obs, const mrpt::poses::CPose3D *robotPose=nullptr, unsigned int downSampleFactor=1) |
Loads into this landmarks-map a set of occupancy features according to a 2D range scan (Previous contents of map will be erased) More... | |
void | computeMatchingWith2D (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose2D &otherMapPose, float maxDistForCorrespondence, float maxAngularDistForCorrespondence, const mrpt::poses::CPose2D &angularDistPivotPoint, mrpt::tfest::TMatchingPairList &correspondences, float &correspondencesRatio, float *sumSqrDist=nullptr, bool onlyKeepTheClosest=false, bool onlyUniqueRobust=false) const |
void | computeMatchingWith3DLandmarks (const mrpt::maps::CLandmarksMap *otherMap, mrpt::tfest::TMatchingPairList &correspondences, float &correspondencesRatio, std::vector< bool > &otherCorrespondences) const |
Perform a search for correspondences between "this" and another lansmarks map: In this class, the matching is established solely based on the landmarks' IDs. 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::CLandmarksMap *otherMap) |
Changes the reference system of the map "otherMap" and save the result in "this" map. More... | |
void | fuseWith (CLandmarksMap &other, bool justInsertAllOfThem=false) |
Fuses the contents of another map with this one, updating "this" object with the result. More... | |
double | computeLikelihood_SIFT_LandmarkMap (CLandmarksMap *map, mrpt::tfest::TMatchingPairList *correspondences=nullptr, std::vector< bool > *otherCorrespondences=nullptr) |
Returns the (logarithmic) likelihood of a set of landmarks "map" given "this" map. More... | |
bool | isEmpty () const 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 noisy reading toward each of the beacons in the landmarks map, if any. More... | |
void | simulateRangeBearingReadings (const mrpt::poses::CPose3D &robotPose, const mrpt::poses::CPose3D &sensorLocationOnRobot, mrpt::obs::CObservationBearingRange &observations, bool sensorDetectsIDs=true, const float stdRange=0.01f, const float stdYaw=mrpt::DEG2RAD(0.1f), const float stdPitch=mrpt::DEG2RAD(0.1f), std::vector< size_t > *real_associations=nullptr, const double spurious_count_mean=0, const double spurious_count_std=0) const |
Simulates a noisy bearing-range observation of all the beacons (landamrks with type glBeacon) in the landmarks map, if any. More... | |
void | saveMetricMapRepresentationToFile (const std::string &filNamePrefix) const 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 | getAs3DObject (mrpt::opengl::CSetOfObjects::Ptr &outObj) const override |
Returns a 3D object representing the map. More... | |
void | auxParticleFilterCleanUp () override |
This method is called at the end of each "prediction-update-map
insertion" cycle within "mrpt::slam::CMetricMapBuilderRBPF::processActionObservation". 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) |
! More... | |
bool | insertObservation (const mrpt::obs::CObservation &obs, const mrpt::poses::CPose3D *robotPose=nullptr) |
Insert the observation information into this map. More... | |
bool | insertObservationPtr (const mrpt::obs::CObservation::Ptr &obs, const mrpt::poses::CPose3D *robotPose=nullptr) |
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... | |
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 | determineMatching2D (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose2D &otherMapPose, mrpt::tfest::TMatchingPairList &correspondences, const TMatchingParams ¶ms, TMatchingExtraResults &extraResults) const |
Computes the matching between this and another 2D point map, which includes finding: More... | |
virtual void | determineMatching3D (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose3D &otherMapPose, mrpt::tfest::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 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... | |
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... | |
RTTI classes and functions for polymorphic hierarchies | |
mrpt::rtti::CObject::Ptr | duplicateGetSmartPtr () const |
Makes a deep copy of the object and returns a smart pointer to it. More... | |
Static Public Attributes | |
static mrpt::img::TColorf | COLOR_LANDMARKS_IN_3DSCENES |
The color of landmark ellipsoids in CLandmarksMap::getAs3DObject. More... | |
static std::map< std::pair< mrpt::maps::CLandmark::TLandmarkID, mrpt::maps::CLandmark::TLandmarkID >, double > | _mEDD |
Map of the Euclidean Distance between the descriptors of two SIFT-based landmarks. More... | |
static mrpt::maps::CLandmark::TLandmarkID | _mapMaxID |
static bool | _maxIDUpdated = false |
Protected Member Functions | |
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 | |
uint8_t | serializeGetVersion () const override |
Must return the current versioning number of the object. More... | |
void | serializeTo (mrpt::serialization::CArchive &out) const override |
Pure virtual method for writing (serializing) to an abstract archive. More... | |
void | serializeFrom (mrpt::serialization::CArchive &in, uint8_t serial_version) override |
Pure virtual method for reading (deserializing) from an abstract archive. More... | |
CSerializable virtual methods | |
virtual void | serializeTo (CSchemeArchiveBase &out) const |
Virtual method for writing (serializing) to an abstract schema based archive. More... | |
virtual void | serializeFrom (CSchemeArchiveBase &in) |
Virtual method for reading (deserializing) from an abstract schema based archive. More... | |
Private Member Functions | |
void | internal_clear () override |
Internal method called by clear() More... | |
bool | internal_insertObservation (const mrpt::obs::CObservation &obs, const mrpt::poses::CPose3D *robotPose=nullptr) override |
Internal method called by insertObservation() More... | |
RTTI stuff | |
using | Ptr = std::shared_ptr< mrpt::maps ::CLandmarksMap > |
using | ConstPtr = std::shared_ptr< const mrpt::maps ::CLandmarksMap > |
using | UniquePtr = std::unique_ptr< mrpt::maps ::CLandmarksMap > |
using | ConstUniquePtr = std::unique_ptr< const mrpt::maps ::CLandmarksMap > |
static const mrpt::rtti::TRuntimeClassId | runtimeClassId |
static constexpr const char * | className = "mrpt::maps" "::" "CLandmarksMap" |
static const mrpt::rtti::TRuntimeClassId * | _GetBaseClass () |
static constexpr auto | getClassName () |
static const mrpt::rtti::TRuntimeClassId & | GetRuntimeClassIdStatic () |
static std::shared_ptr< CObject > | CreateObject () |
template<typename... Args> | |
static Ptr | Create (Args &&... args) |
template<typename Alloc , typename... Args> | |
static Ptr | CreateAlloc (const Alloc &alloc, Args &&... args) |
template<typename... Args> | |
static UniquePtr | CreateUnique (Args &&... args) |
virtual const mrpt::rtti::TRuntimeClassId * | GetRuntimeClass () const override |
Returns information about the class of an object in runtime. More... | |
virtual mrpt::rtti::CObject * | clone () const override |
Returns a deep copy (clone) of the object, indepently of its class. More... | |
Map Definition Interface stuff (see * mrpt::maps::TMetricMapInitializer) @{ | |
static const size_t | m_private_map_register_id = mrpt::maps::internal::TMetricMapTypesRegistry::Instance().doRegister( "mrpt::maps::CLandmarksMap,landmarksMap" , & mrpt::maps::CLandmarksMap ::MapDefinition, & mrpt::maps::CLandmarksMap ::internal_CreateFromMapDefinition) |
ID used to initialize class registration (just ignore it) More... | |
static mrpt::maps::TMetricMapInitializer * | MapDefinition () |
Returns default map definition initializer. More... | |
static CLandmarksMap * | 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) |
using mrpt::maps::CLandmarksMap::ConstPtr = std::shared_ptr<const mrpt::maps :: CLandmarksMap > |
Definition at line 76 of file CLandmarksMap.h.
using mrpt::maps::CLandmarksMap::ConstUniquePtr = std::unique_ptr<const mrpt::maps :: CLandmarksMap > |
Definition at line 76 of file CLandmarksMap.h.
Definition at line 129 of file CLandmarksMap.h.
using mrpt::maps::CLandmarksMap::Ptr = std::shared_ptr< mrpt::maps :: CLandmarksMap > |
A type for the associated smart pointer
Definition at line 76 of file CLandmarksMap.h.
using mrpt::maps::CLandmarksMap::UniquePtr = std::unique_ptr< mrpt::maps :: CLandmarksMap > |
Definition at line 76 of file CLandmarksMap.h.
|
default |
|
overridedefault |
|
staticprotected |
|
overridevirtual |
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 from mrpt::maps::CMetricMap.
Definition at line 2680 of file CLandmarksMap.cpp.
References _maxIDUpdated, and _mEDD.
|
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 161 of file CMetricMap.cpp.
|
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 85 of file CMetricMap.cpp.
References mrpt::obs::CSensoryFrame::begin(), and mrpt::obs::CSensoryFrame::end().
void CLandmarksMap::changeCoordinatesReference | ( | const mrpt::poses::CPose3D & | newOrg | ) |
Changes the reference system of the map to a given 3D pose.
Definition at line 766 of file CLandmarksMap.cpp.
References mrpt::poses::CPose3D::composePoint(), and mrpt::poses::CPose3D::getHomogeneousMatrix().
Referenced by computeMatchingWith2D(), internal_computeObservationLikelihood(), and internal_insertObservation().
void CLandmarksMap::changeCoordinatesReference | ( | const mrpt::poses::CPose3D & | newOrg, |
const mrpt::maps::CLandmarksMap * | otherMap | ||
) |
Changes the reference system of the map "otherMap" and save the result in "this" map.
Definition at line 847 of file CLandmarksMap.cpp.
References mrpt::maps::CLandmarksMap::TCustomSequenceLandmarks::begin(), mrpt::poses::CPose3D::composePoint(), mrpt::maps::CLandmarksMap::TCustomSequenceLandmarks::end(), mrpt::maps::CLandmark::features, mrpt::poses::CPose3D::getHomogeneousMatrix(), mrpt::maps::CLandmark::ID, landmarks, mrpt::maps::CLandmark::normal, mrpt::maps::CLandmark::pose_cov_11, mrpt::maps::CLandmark::pose_cov_12, mrpt::maps::CLandmark::pose_cov_13, mrpt::maps::CLandmark::pose_cov_22, mrpt::maps::CLandmark::pose_cov_23, mrpt::maps::CLandmark::pose_cov_33, mrpt::maps::CLandmark::pose_mean, mrpt::maps::CLandmark::seenTimesCount, mrpt::maps::CLandmark::timestampLastSeen, mrpt::math::TPoint3D_data< T >::x, mrpt::math::TPoint3D_data< T >::y, and mrpt::math::TPoint3D_data< T >::z.
|
inherited |
Erase all the contents of the map.
Definition at line 30 of file CMetricMap.cpp.
Referenced by mrpt::maps::CHeightGridMap2D_MRF::CHeightGridMap2D_MRF(), mrpt::maps::CReflectivityGridMap2D::clear(), mrpt::maps::CHeightGridMap2D::clear(), mrpt::maps::CRandomFieldGridMap2D::clear(), mrpt::apps::MonteCarloLocalization_Base::do_pf_localization(), mrpt::maps::CPointsMap::extractCylinder(), mrpt::maps::CPointsMap::extractPoints(), mrpt::ros1bridge::fromROS(), mrpt::opengl::CAngularObservationMesh::generatePointCloud(), mrpt::maps::COccupancyGridMap2D::getAsPointCloud(), mrpt::nav::CReactiveNavigationSystem3D::loggingGetWSObstaclesAndShape(), mrpt::hmtslam::CLSLAM_RBPF_2DLASER::prediction_and_update_pfOptimalProposal(), mrpt::vision::projectMatchedFeatures(), run_rnav_test(), mrpt::maps::CPointsMap::setFromPCLPointCloud(), mrpt::maps::CColouredPointsMap::setFromPCLPointCloudRGB(), mrpt::maps::CPointsMapXYZI::setFromPCLPointCloudXYZI(), mrpt::maps::CRandomFieldGridMap2D::setSize(), and mrpt::nav::PlannerTPS_VirtualBase::transformPointcloudWithSquareClipping().
|
overridevirtual |
Returns a deep copy (clone) of the object, indepently of its class.
Implements mrpt::rtti::CObject.
|
overridevirtual |
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 2550 of file CLandmarksMap.cpp.
References mrpt::maps::CLandmarksMap::TCustomSequenceLandmarks::begin(), CLASS_ID, mrpt::d2f(), mrpt::maps::CLandmarksMap::TCustomSequenceLandmarks::end(), mrpt::poses::CPose3D::getHomogeneousMatrix(), mrpt::maps::CLandmarksMap::TCustomSequenceLandmarks::getLargestDistanceFromOrigin(), mrpt::maps::CMetricMap::GetRuntimeClass(), mrpt::math::MatrixBase< Scalar, Derived >::inverse_LLt(), landmarks, MRPT_END, MRPT_START, mrpt::math::multiply_HCHt_scalar(), params, mrpt::maps::CLandmarksMap::TCustomSequenceLandmarks::size(), and mrpt::square().
double CLandmarksMap::computeLikelihood_RSLC_2007 | ( | const CLandmarksMap * | s, |
const mrpt::poses::CPose2D & | sensorPose | ||
) |
Computes the (logarithmic) likelihood function for a sensed observation "o" according to "this" map.
This is the implementation of the algorithm reported in the paper: J.L. Blanco, J. Gonzalez, and J.A. Fernandez-Madrigal, "A Consensus-based Approach for Estimating the Observation Likelihood of Accurate Range Sensors", in IEEE International Conference on Robotics and Automation (ICRA), Rome (Italy), Apr 10-14, 2007
Definition at line 1651 of file CLandmarksMap.cpp.
References ASSERT_, mrpt::maps::CLandmarksMap::TCustomSequenceLandmarks::begin(), mrpt::containers::CDynamicGrid< T >::cellByIndex(), mrpt::maps::CLandmarksMap::TCustomSequenceLandmarks::end(), mrpt::maps::CLandmark::getPose(), mrpt::containers::CDynamicGrid< T >::getSizeX(), mrpt::containers::CDynamicGrid< T >::getSizeY(), landmarks, MRPT_CHECK_NORMAL_NUMBER, MRPT_END, MRPT_START, mrpt::maps::CLandmark::pose_mean, mrpt::poses::CPointPDFGaussian::productIntegralNormalizedWith2D(), size(), mrpt::math::TPoint3D_data< T >::x, mrpt::containers::CDynamicGrid< T >::x2idx(), mrpt::math::TPoint3D_data< T >::y, and mrpt::containers::CDynamicGrid< T >::y2idx().
double CLandmarksMap::computeLikelihood_SIFT_LandmarkMap | ( | CLandmarksMap * | map, |
mrpt::tfest::TMatchingPairList * | correspondences = nullptr , |
||
std::vector< bool > * | otherCorrespondences = nullptr |
||
) |
Returns the (logarithmic) likelihood of a set of landmarks "map" given "this" map.
See paper: JJAA 2006
Definition at line 1944 of file CLandmarksMap.cpp.
References _mEDD, ASSERT_, mrpt::maps::CLandmarksMap::TCustomSequenceLandmarks::begin(), mrpt::poses::CPointPDFGaussian::cov, mrpt::maps::CLandmarksMap::TCustomSequenceLandmarks::end(), mrpt::vision::featSIFT, mrpt::maps::CLandmarksMap::TCustomSequenceLandmarks::get(), insertionOptions, mrpt::math::MatrixBase< Scalar, Derived >::inverse_LLt(), landmarks, likelihoodOptions, MRPT_CHECK_NORMAL_NUMBER, mrpt::math::multiply_HCHt_scalar(), mrpt::maps::CLandmark::pose_mean, mrpt::maps::CLandmarksMap::TInsertionOptions::SIFTLikelihoodMethod, mrpt::maps::CLandmarksMap::TLikelihoodOptions::SIFTnullCorrespondenceDistance, mrpt::maps::CLandmarksMap::TLikelihoodOptions::SIFTs_decimation, mrpt::maps::CLandmarksMap::TLikelihoodOptions::SIFTs_mahaDist_std, mrpt::maps::CLandmarksMap::TLikelihoodOptions::SIFTs_sigma_descriptor_dist, size(), mrpt::square(), THROW_EXCEPTION, mrpt::math::TPoint3D_data< T >::x, mrpt::math::TPoint3D_data< T >::y, and mrpt::math::TPoint3D_data< T >::z.
void CLandmarksMap::computeMatchingWith2D | ( | const mrpt::maps::CMetricMap * | otherMap, |
const mrpt::poses::CPose2D & | otherMapPose, | ||
float | maxDistForCorrespondence, | ||
float | maxAngularDistForCorrespondence, | ||
const mrpt::poses::CPose2D & | angularDistPivotPoint, | ||
mrpt::tfest::TMatchingPairList & | correspondences, | ||
float & | correspondencesRatio, | ||
float * | sumSqrDist = nullptr , |
||
bool | onlyKeepTheClosest = false , |
||
bool | onlyUniqueRobust = false |
||
) | const |
Definition at line 561 of file CLandmarksMap.cpp.
References ASSERT_, changeCoordinatesReference(), CLASS_ID, MRPT_END, and MRPT_START.
void CLandmarksMap::computeMatchingWith3DLandmarks | ( | const mrpt::maps::CLandmarksMap * | otherMap, |
mrpt::tfest::TMatchingPairList & | correspondences, | ||
float & | correspondencesRatio, | ||
std::vector< bool > & | otherCorrespondences | ||
) | const |
Perform a search for correspondences between "this" and another lansmarks map: In this class, the matching is established solely based on the landmarks' IDs.
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 1055 of file CLandmarksMap.cpp.
References ASSERT_, mrpt::maps::CLandmarksMap::TCustomSequenceLandmarks::begin(), mrpt::poses::CPointPDFGaussian::cov, mrpt::d2f(), mrpt::maps::CLandmarksMap::TCustomSequenceLandmarks::end(), mrpt::vision::featSIFT, mrpt::maps::CLandmarksMap::TCustomSequenceLandmarks::get(), mrpt::math::MatrixBase< Scalar, Derived >::inverse_LLt(), landmarks, mrpt::poses::CPointPDFGaussian::mean, MRPT_END, MRPT_START, mrpt::math::multiply_HCHt_scalar(), mrpt::tfest::TMatchingPair::other_idx, mrpt::tfest::TMatchingPair::other_x, mrpt::tfest::TMatchingPair::other_y, mrpt::tfest::TMatchingPair::other_z, mrpt::maps::CLandmark::pose_mean, mrpt::maps::CLandmarksMap::TCustomSequenceLandmarks::size(), mrpt::square(), mrpt::tfest::TMatchingPair::this_idx, mrpt::tfest::TMatchingPair::this_x, mrpt::tfest::TMatchingPair::this_y, mrpt::tfest::TMatchingPair::this_z, mrpt::math::TPoint3D_data< T >::x, mrpt::poses::CPoseOrPoint< DERIVEDCLASS, DIM >::x(), mrpt::math::TPoint3D_data< T >::y, mrpt::poses::CPoseOrPoint< DERIVEDCLASS, DIM >::y(), and mrpt::math::TPoint3D_data< T >::z.
|
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 170 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 76 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 66 of file CMetricMap.cpp.
Referenced by mrpt::hmtslam::CLSLAM_RBPF_2DLASER::auxiliarComputeObservationLikelihood().
|
inlinestatic |
Definition at line 76 of file CLandmarksMap.h.
|
inlinestatic |
Definition at line 76 of file CLandmarksMap.h.
|
static |
Constructor from a map definition structure: initializes the map and * its parameters accordingly.
Definition at line 48 of file CLandmarksMap.cpp.
|
static |
|
inlinestatic |
Definition at line 76 of file CLandmarksMap.h.
|
virtualinherited |
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 in mrpt::maps::COccupancyGridMap2D, mrpt::maps::CPointsMap, mrpt::maps::COccupancyGridMap3D, mrpt::maps::CBeaconMap, and mrpt::maps::CMultiMetricMap.
Definition at line 119 of file CMetricMap.cpp.
References MRPT_END, MRPT_START, and THROW_EXCEPTION.
Referenced by mrpt::slam::CICP::ICP_Method_Classic().
|
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 131 of file CMetricMap.cpp.
References MRPT_END, MRPT_START, and THROW_EXCEPTION.
Referenced by mrpt::slam::CICP::ICP3D_Method_Classic().
|
inlineinherited |
Makes a deep copy of the object and returns a smart pointer to it.
Definition at line 204 of file CObject.h.
References mrpt::rtti::CObject::clone().
Referenced by mrpt::obs::CRawlog::insert().
void CLandmarksMap::fuseWith | ( | CLandmarksMap & | other, |
bool | justInsertAllOfThem = false |
||
) |
Fuses the contents of another map with this one, updating "this" object with the result.
This process involves fusing corresponding landmarks, then adding the new ones.
other | The other landmarkmap, whose landmarks will be inserted into "this" |
justInsertAllOfThem | If set to "true", all the landmarks in "other" will be inserted into "this" without checking for possible correspondences (may appear duplicates ones, etc...) |
Definition at line 940 of file CLandmarksMap.cpp.
References mrpt::poses::CPointPDFGaussian::bayesianFusion(), mrpt::system::os::fclose(), mrpt::vision::featNotDefined, mrpt::system::os::fopen(), mrpt::system::os::fprintf(), mrpt::maps::CLandmarksMap::TCustomSequenceLandmarks::get(), mrpt::maps::CLandmark::getPose(), landmarks, MRPT_END, MRPT_START, mrpt::maps::CLandmark::seenTimesCount, mrpt::maps::CLandmark::setPose(), size(), mrpt::maps::CLandmark::timestampLastSeen, and verbose.
|
overridevirtual |
Returns a 3D object representing the map.
Implements mrpt::maps::CMetricMap.
Definition at line 2466 of file CLandmarksMap.cpp.
References mrpt::poses::CPointPDFGaussian::cov, mrpt::maps::TMapGenericParams::enableSaveAs3DObject, mrpt::format(), mrpt::maps::CMetricMap::genericMapParams, landmarks, and mrpt::poses::CPointPDFGaussian::mean.
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 nullptr
Reimplemented in mrpt::maps::CMultiMetricMap, and mrpt::maps::CSimplePointsMap.
Definition at line 295 of file CMetricMap.h.
Referenced by mrpt::maps::CPointsMap::compute3DMatchingRatio(), and mrpt::maps::CMetricMap::getAsSimplePointsMap().
|
inlineinherited |
Definition at line 299 of file CMetricMap.h.
References mrpt::maps::CMetricMap::getAsSimplePointsMap().
|
inlinestatic |
Definition at line 76 of file CLandmarksMap.h.
mrpt::maps::CLandmark::TLandmarkID CLandmarksMap::getMapMaxID | ( | ) |
Definition at line 2496 of file CLandmarksMap.cpp.
References _mapMaxID.
|
overridevirtual |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::maps::CMetricMap.
|
static |
|
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 53 of file CObservable.h.
References mrpt::system::CObservable::m_subscribers.
Referenced by mrpt::gui::CWindowDialog::OnMouseDown(), mrpt::gui::CWindowDialog::OnMouseMove(), mrpt::gui::CWindowDialog::OnResize(), mrpt::opengl::COpenGLViewport::render(), and mrpt::opengl::COpenGLViewport::renderNormalSceneMode().
|
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 93 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 107 of file CMetricMap.cpp.
References MRPT_END, MRPT_START, and THROW_EXCEPTION.
Referenced by mrpt::slam::CMetricMapBuilderICP::processObservation().
|
overrideprivatevirtual |
Internal method called by clear()
Implements mrpt::maps::CMetricMap.
Definition at line 145 of file CLandmarksMap.cpp.
|
overridevirtual |
Computes the (logarithmic) likelihood that a given observation was taken from a given pose in the world being modeled with this map.
In the current implementation, this method behaves in a different way according to the nature of the observation's class:
Observation class: | Generated Landmarks: | Comments: |
CObservationImage | vlSIFT | 1) A SIFT feature is created for each SIFT detected in the image, 2) Correspondences between SIFTs features and existing ones are found by computeMatchingWith3DLandmarks, 3) The corresponding feaures are fused, and the new ones added, with an initial uncertainty according to insertionOptions |
CObservationStereoImages | vlSIFT | Each image is separately procesed by the method for CObservationImage observations |
CObservationStereoImages | vlColor | TODO... |
CObservation2DRangeScan | glOccupancy | A landmark is added for each range in the scan, with its appropiate covariance matrix derived from the jacobians matrixes. |
takenFrom | The robot's pose the observation is supposed to be taken from. |
obs | The observation. |
Implements mrpt::maps::CMetricMap.
Definition at line 197 of file CLandmarksMap.cpp.
References mrpt::obs::gnss::Message_NMEA_GGA::content_t::altitude_meters, ASSERT_ABOVE_, changeCoordinatesReference(), CLASS_ID, mrpt::DEG2RAD(), mrpt::math::distance(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS, DIM >::distanceTo(), mrpt::vision::featBeacon, mrpt::obs::gnss::Message_NMEA_GGA::fields, mrpt::obs::CObservation::GetRuntimeClass(), insertionOptions, mrpt::math::MatrixBase< Scalar, Derived >::inverse_LLt(), mrpt::obs::gnss::Message_NMEA_GGA::content_t::latitude_degrees, loadOccupancyFeaturesFrom2DRangeScan(), loadSiftFeaturesFromStereoImageObservation(), mrpt::obs::gnss::Message_NMEA_GGA::content_t::longitude_degrees, mrpt::poses::CPointPDFGaussian::mean, MRPT_CHECK_NORMAL_NUMBER, MRPT_END, MRPT_START, mrpt::math::multiply_HCHt_scalar(), mrpt::poses::CPose3D::pitch(), mrpt::poses::CPose3D::roll(), mrpt::obs::gnss::Message_NMEA_GGA::content_t::satellitesUsed, size(), mrpt::square(), mrpt::obs::CObservationBeaconRanges::stdError, mrpt::math::wrapToPi(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS, DIM >::x(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS, DIM >::y(), and mrpt::poses::CPose3D::yaw().
|
static |
Definition at line 101 of file CLandmarksMap.cpp.
References mrpt::maps::CLandmark::createOneFeature(), mrpt::vision::featBeacon, mrpt::maps::CLandmark::features, mrpt::maps::CLandmark::ID, mrpt::maps::CLandmarksMap::TMapDefinition::initialBeacons, mrpt::maps::CLandmarksMap::TMapDefinition::insertionOpts, mrpt::maps::CLandmarksMap::TMapDefinition::likelihoodOpts, mrpt::maps::CLandmark::pose_cov_11, mrpt::maps::CLandmark::pose_cov_12, mrpt::maps::CLandmark::pose_cov_13, mrpt::maps::CLandmark::pose_cov_22, mrpt::maps::CLandmark::pose_cov_23, mrpt::maps::CLandmark::pose_cov_33, mrpt::maps::CLandmark::pose_mean, and mrpt::square().
|
overrideprivatevirtual |
Internal method called by insertObservation()
Implements mrpt::maps::CMetricMap.
Definition at line 438 of file CLandmarksMap.cpp.
References changeCoordinatesReference(), CLASS_ID, mrpt::obs::CObservation::GetRuntimeClass(), insertionOptions, loadSiftFeaturesFromImageObservation(), loadSiftFeaturesFromStereoImageObservation(), MRPT_END, and MRPT_START.
|
overridevirtual |
Returns true if the map is empty/no observation has been inserted.
Implements mrpt::maps::CMetricMap.
Definition at line 2381 of file CLandmarksMap.cpp.
References size().
|
inherited |
Load the map contents from a CSimpleMap object, erasing all previous content of the map.
This is done invoking insertObservation()
for each observation at the mean 3D robot pose of each pose-observations pair in the CSimpleMap object.
std::exception | Some internal steps in invoked methods can raise exceptions on invalid parameters, etc... |
Definition at line 36 of file CMetricMap.cpp.
References ASSERTMSG_, mrpt::containers::clear(), mrpt::maps::CSimpleMap::get(), and mrpt::maps::CSimpleMap::size().
Referenced by mrpt::apps::MonteCarloLocalization_Base::do_pf_localization(), mrpt::maps::CMetricMap::loadFromSimpleMap(), mrpt::apps::CGridMapAlignerApp::run(), and run_test_pf_localization().
|
inlineinherited |
!
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 106 of file CMetricMap.h.
References mrpt::maps::CMetricMap::loadFromProbabilisticPosesAndObservations().
Referenced by mrpt::maps::CRandomFieldGridMap2D::internal_clear(), and mrpt::ros1bridge::MapHdl::loadMap().
void CLandmarksMap::loadOccupancyFeaturesFrom2DRangeScan | ( | const mrpt::obs::CObservation2DRangeScan & | obs, |
const mrpt::poses::CPose3D * | robotPose = nullptr , |
||
unsigned int | downSampleFactor = 1 |
||
) |
Loads into this landmarks-map a set of occupancy features according to a 2D range scan (Previous contents of map will be erased)
obs | The observation |
robotPose | The robot pose in the map (Default = the origin) Some options may be applicable from "insertionOptions" |
Definition at line 1551 of file CLandmarksMap.cpp.
References mrpt::obs::CObservation2DRangeScan::aperture, mrpt::containers::clear(), mrpt::maps::CLandmark::createOneFeature(), mrpt::vision::featNotDefined, mrpt::maps::CLandmark::features, mrpt::obs::CObservation2DRangeScan::getScanRange(), mrpt::obs::CObservation2DRangeScan::getScanRangeValidity(), mrpt::obs::CObservation2DRangeScan::getScanSize(), mrpt::math::TPoint3D_< T >::norm(), mrpt::maps::CLandmark::normal, mrpt::maps::CLandmark::pose_cov_11, mrpt::maps::CLandmark::pose_cov_12, mrpt::maps::CLandmark::pose_cov_13, mrpt::maps::CLandmark::pose_cov_22, mrpt::maps::CLandmark::pose_cov_23, mrpt::maps::CLandmark::pose_cov_33, mrpt::maps::CLandmark::pose_mean, mrpt::obs::CObservation2DRangeScan::rightToLeft, mrpt::maps::CLandmark::seenTimesCount, mrpt::obs::CObservation2DRangeScan::sensorPose, mrpt::square(), mrpt::obs::CObservation::timestamp, mrpt::maps::CLandmark::timestampLastSeen, mrpt::math::TPoint3D_data< T >::x, mrpt::math::TPoint3D_data< T >::y, and mrpt::math::TPoint3D_data< T >::z.
Referenced by internal_computeObservationLikelihood().
void CLandmarksMap::loadSiftFeaturesFromImageObservation | ( | const mrpt::obs::CObservationImage & | obs, |
const mrpt::vision::CFeatureExtraction::TOptions & | feat_options = mrpt::vision::CFeatureExtraction::TOptions(mrpt::vision::featSIFT) |
||
) |
Loads into this landmarks map the SIFT features extracted from an image observation (Previous contents of map will be erased) The robot is assumed to be at the origin of the map.
Some options may be applicable from "insertionOptions" (insertionOptions.SIFTsLoadDistanceOfTheMean)
feat_options | Optionally, you can pass here parameters for changing the default SIFT detector settings. |
Definition at line 598 of file CLandmarksMap.cpp.
References mrpt::poses::CPoint3D::asTPoint(), mrpt::vision::CFeatureList::begin(), mrpt::obs::CObservationImage::cameraParams, mrpt::poses::CPointPDFGaussian::cov, mrpt::vision::CFeatureExtraction::detectFeatures(), dir, mrpt::vision::CFeatureList::end(), mrpt::maps::CLandmark::features, mrpt::math::generateAxisBaseFromDirection(), mrpt::obs::CObservationImage::image, mrpt::img::TCamera::intrinsicParams, mrpt::poses::CPointPDFGaussian::mean, mrpt::math::multiply_HCHt(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS, DIM >::norm(), mrpt::maps::CLandmark::normal, mrpt::vision::CFeatureExtraction::options, mrpt::vision::pixelTo3D(), mrpt::maps::CLandmark::pose_cov_11, mrpt::maps::CLandmark::pose_cov_12, mrpt::maps::CLandmark::pose_cov_13, mrpt::maps::CLandmark::pose_cov_22, mrpt::maps::CLandmark::pose_cov_23, mrpt::maps::CLandmark::pose_cov_33, mrpt::maps::CLandmark::pose_mean, mrpt::maps::CLandmark::seenTimesCount, mrpt::square(), mrpt::obs::CObservation::timestamp, and mrpt::maps::CLandmark::timestampLastSeen.
Referenced by internal_insertObservation().
void CLandmarksMap::loadSiftFeaturesFromStereoImageObservation | ( | const mrpt::obs::CObservationStereoImages & | obs, |
mrpt::maps::CLandmark::TLandmarkID | fID, | ||
const mrpt::vision::CFeatureExtraction::TOptions & | feat_options = mrpt::vision::CFeatureExtraction::TOptions(mrpt::vision::featSIFT) |
||
) |
Loads into this landmarks map the SIFT features extracted from an observation consisting of a pair of stereo-image (Previous contents of map will be erased) The robot is assumed to be at the origin of the map.
Some options may be applicable from "insertionOptions"
feat_options | Optionally, you can pass here parameters for changing the default SIFT detector settings. |
Definition at line 681 of file CLandmarksMap.cpp.
References mrpt::vision::TStereoSystemParams::baseline, mrpt::obs::CObservationStereoImages::cameraPose, mrpt::vision::TMatchingOptions::EDD_RATIO, mrpt::vision::TMatchingOptions::epipolar_TH, mrpt::obs::CObservationStereoImages::imageLeft, mrpt::obs::CObservationStereoImages::imageRight, mrpt::img::TCamera::intrinsicParams, mrpt::vision::TStereoSystemParams::K, mrpt::obs::CObservationStereoImages::leftCamera, mrpt::vision::matchFeatures(), mrpt::vision::TMatchingOptions::matching_method, mrpt::vision::TMatchingOptions::maxEDD_TH, mrpt::vision::TStereoSystemParams::maxZ, mrpt::vision::TStereoSystemParams::minZ, mrpt::vision::TMatchingOptions::mmDescriptorSIFT, MRPT_END, MRPT_START, mrpt::vision::projectMatchedFeatures(), mrpt::obs::CObservationStereoImages::rightCameraPose, mrpt::vision::TStereoSystemParams::stdDisp, mrpt::vision::TStereoSystemParams::stdPixel, mrpt::obs::CObservation::timestamp, and mrpt::poses::CPoseOrPoint< DERIVEDCLASS, DIM >::x().
Referenced by internal_computeObservationLikelihood(), and internal_insertObservation().
|
static |
Returns default map definition initializer.
See * mrpt::maps::TMetricMapInitializer
Definition at line 48 of file CLandmarksMap.cpp.
|
protectedinherited |
Called when you want this object to emit an event to all the observers currently subscribed to this object.
Definition at line 57 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(), mrpt::opengl::COpenGLViewport::render(), and mrpt::opengl::COpenGLViewport::renderNormalSceneMode().
|
overridevirtual |
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 2436 of file CLandmarksMap.cpp.
References mrpt::opengl::CSetOfObjects::Create(), getAs3DObject(), mrpt::opengl::COpenGLScene::insert(), MRPT_END, MRPT_START, mrpt::opengl::COpenGLScene::saveToFile(), and saveToMATLABScript3D().
bool CLandmarksMap::saveToMATLABScript2D | ( | std::string | file, |
const char * | style = "b" , |
||
float | stdCount = 2.0f |
||
) |
Save to a MATLAB script which displays 2D error ellipses for the map (top-view, projection on the XY plane).
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 possibilities) |
stdCount | The ellipsoids will be drawn from the center to "stdCount" times the "standard deviations". (default is 2std = 95% confidence intervals) |
Definition at line 1455 of file CLandmarksMap.cpp.
References mrpt::math::MatrixVectorBase< Scalar, Derived >::array(), mrpt::math::CMatrixFixed< T, ROWS, COLS >::asEigen(), mrpt::math::cov(), mrpt::math::MatrixBase< Scalar, Derived >::eig_symmetric(), mrpt::system::os::fclose(), mrpt::system::os::fopen(), mrpt::system::os::fprintf(), M_2PI, mrpt::math::MatrixBase< Scalar, Derived >::setDiagonal(), mrpt::math::MatrixVectorBase< Scalar, Derived >::setZero(), and mrpt::math::MatrixVectorBase< Scalar, Derived >::transpose().
bool CLandmarksMap::saveToMATLABScript3D | ( | 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 possibilities) |
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 1405 of file CLandmarksMap.cpp.
References mrpt::system::os::fclose(), mrpt::system::os::fopen(), and mrpt::system::os::fprintf().
Referenced by saveMetricMapRepresentationToFile().
bool CLandmarksMap::saveToTextFile | ( | std::string | file | ) |
Save to a text file.
In line "i" there are the (x,y,z) mean values of the i'th landmark + type of landmark + # times seen + timestamp + RGB/descriptor + ID
Returns false if any error occured, true elsewere.
Definition at line 1359 of file CLandmarksMap.cpp.
References ASSERT_, mrpt::system::extractDayTimeFromTimestamp(), mrpt::system::os::fclose(), mrpt::vision::featSIFT, mrpt::system::os::fopen(), mrpt::system::os::fprintf(), INVALID_TIMESTAMP, MRPT_END, and MRPT_START.
|
inlineprotectedvirtualinherited |
Virtual method for reading (deserializing) from an abstract schema based archive.
Definition at line 74 of file CSerializable.h.
References mrpt::serialization::CSerializable::GetRuntimeClass(), and THROW_EXCEPTION.
|
overrideprotectedvirtual |
Pure virtual method for reading (deserializing) from an abstract archive.
Users don't call this method directly. Instead, use stream >> object;
.
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 I/O error |
Implements mrpt::serialization::CSerializable.
Definition at line 161 of file CLandmarksMap.cpp.
References MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION.
|
overrideprotectedvirtual |
Must return the current versioning number of the object.
Start in zero for new classes, and increments each time there is a change in the stored format.
Implements mrpt::serialization::CSerializable.
Definition at line 149 of file CLandmarksMap.cpp.
|
inlineprotectedvirtualinherited |
Virtual method for writing (serializing) to an abstract schema based archive.
Definition at line 64 of file CSerializable.h.
References mrpt::serialization::CSerializable::GetRuntimeClass(), and THROW_EXCEPTION.
|
overrideprotectedvirtual |
Pure virtual method for writing (serializing) to an abstract archive.
Users don't call this method directly. Instead, use stream << object;
.
std::exception | On any I/O error |
Implements mrpt::serialization::CSerializable.
Definition at line 150 of file CLandmarksMap.cpp.
References out.
void CLandmarksMap::simulateBeaconReadings | ( | const mrpt::poses::CPose3D & | in_robotPose, |
const mrpt::poses::CPoint3D & | in_sensorLocationOnRobot, | ||
mrpt::obs::CObservationBeaconRanges & | out_Observations | ||
) | const |
Simulates a noisy 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 2385 of file CLandmarksMap.cpp.
References mrpt::obs::CObservationBeaconRanges::TMeasurement::beaconID, mrpt::maps::CLandmarksMap::TCustomSequenceLandmarks::begin(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS, DIM >::distanceTo(), mrpt::random::CRandomGenerator::drawGaussian1D_normalized(), mrpt::maps::CLandmarksMap::TCustomSequenceLandmarks::end(), mrpt::vision::featBeacon, mrpt::system::getCurrentTime(), mrpt::random::getRandomGenerator(), landmarks, mrpt::obs::CObservationBeaconRanges::maxSensorDistance, mrpt::poses::CPointPDFGaussian::mean, mrpt::obs::CObservationBeaconRanges::minSensorDistance, mrpt::obs::CObservationBeaconRanges::sensedData, mrpt::obs::CObservationBeaconRanges::TMeasurement::sensedDistance, mrpt::obs::CObservationBeaconRanges::TMeasurement::sensorLocationOnRobot, mrpt::obs::CObservationBeaconRanges::stdError, and mrpt::obs::CObservation::timestamp.
void CLandmarksMap::simulateRangeBearingReadings | ( | const mrpt::poses::CPose3D & | robotPose, |
const mrpt::poses::CPose3D & | sensorLocationOnRobot, | ||
mrpt::obs::CObservationBearingRange & | observations, | ||
bool | sensorDetectsIDs = true , |
||
const float | stdRange = 0.01f , |
||
const float | stdYaw = mrpt::DEG2RAD(0.1f) , |
||
const float | stdPitch = mrpt::DEG2RAD(0.1f) , |
||
std::vector< size_t > * | real_associations = nullptr , |
||
const double | spurious_count_mean = 0 , |
||
const double | spurious_count_std = 0 |
||
) | const |
Simulates a noisy bearing-range observation of all the beacons (landamrks with type glBeacon) in the landmarks map, if any.
[in] | robotPose | The robot pose. |
[in] | sensorLocationOnRobot | The 3D position of the sensor on the robot |
[out] | observations | The results will be stored here. |
[in] | sensorDetectsIDs | If this is set to false, all the landmarks will be sensed with INVALID_LANDMARK_ID as ID. |
[in] | stdRange | The sigma of the sensor noise in range (meters). |
[in] | stdYaw | The sigma of the sensor noise in yaw (radians). |
[in] | stdPitch | The sigma of the sensor noise in pitch (radians). |
[out] | real_associations | If it's not a nullptr pointer, this will contain at the return the real indices of the landmarks in the map in the same order than they appear in out_Observations. Useful when sensorDetectsIDs=false. Spurious readings are assigned a std::string::npos (=-1) index. |
[in] | spurious_count_mean | The mean number of spurious measurements (uniformly distributed in range & angle) to generate. The number of spurious is generated by rounding a random Gaussin number. If both this mean and the std are zero (the default) no spurious readings are generated. |
[in] | spurious_count_std | Read spurious_count_mean above. |
Definition at line 2689 of file CLandmarksMap.cpp.
References mrpt::poses::CPoint3D::asTPoint(), mrpt::maps::CLandmarksMap::TCustomSequenceLandmarks::begin(), mrpt::random::CRandomGenerator::drawGaussian1D(), mrpt::random::CRandomGenerator::drawGaussian1D_normalized(), mrpt::random::CRandomGenerator::drawUniform(), mrpt::maps::CLandmarksMap::TCustomSequenceLandmarks::end(), mrpt::obs::CObservationBearingRange::fieldOfView_pitch, mrpt::obs::CObservationBearingRange::fieldOfView_yaw, mrpt::system::getCurrentTime(), mrpt::random::getRandomGenerator(), INVALID_LANDMARK_ID, mrpt::obs::CObservationBearingRange::TMeasurement::landmarkID, landmarks, mrpt::obs::CObservationBearingRange::maxSensorDistance, mrpt::poses::CPointPDFGaussian::mean, mrpt::obs::CObservationBearingRange::minSensorDistance, mrpt::obs::CObservationBearingRange::TMeasurement::pitch, mrpt::obs::gnss::pitch, mrpt::obs::CObservationBearingRange::TMeasurement::range, mrpt::round_long(), mrpt::obs::CObservationBearingRange::sensedData, mrpt::obs::CObservationBearingRange::sensor_std_pitch, mrpt::obs::CObservationBearingRange::sensor_std_range, mrpt::obs::CObservationBearingRange::sensor_std_yaw, mrpt::obs::CObservationBearingRange::sensorLocationOnRobot, mrpt::poses::CPose3D::sphericalCoordinates(), mrpt::obs::CObservation::timestamp, mrpt::obs::CObservationBearingRange::validCovariances, mrpt::math::wrapToPi(), and mrpt::obs::CObservationBearingRange::TMeasurement::yaw.
size_t CLandmarksMap::size | ( | ) | const |
Returns the stored landmarks count.
Definition at line 147 of file CLandmarksMap.cpp.
Referenced by computeLikelihood_RSLC_2007(), computeLikelihood_SIFT_LandmarkMap(), fuseWith(), internal_computeObservationLikelihood(), and 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 153 of file CMetricMap.cpp.
References MRPT_END, MRPT_START, 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 nullptr is class does not support conversion to MATLAB. Definition at line 90 of file CSerializable.h.
|
static |
Definition at line 214 of file CLandmarksMap.h.
Referenced by getMapMaxID().
|
static |
Definition at line 215 of file CLandmarksMap.h.
Referenced by auxParticleFilterCleanUp().
|
static |
Map of the Euclidean Distance between the descriptors of two SIFT-based landmarks.
Definition at line 213 of file CLandmarksMap.h.
Referenced by auxParticleFilterCleanUp(), and computeLikelihood_SIFT_LandmarkMap().
|
static |
Definition at line 76 of file CLandmarksMap.h.
|
static |
The color of landmark ellipsoids in CLandmarksMap::getAs3DObject.
Definition at line 127 of file CLandmarksMap.h.
struct mrpt::maps::CLandmarksMap::TFuseOptions mrpt::maps::CLandmarksMap::fuseOptions |
|
inherited |
Common params to all maps.
Definition at line 274 of file CMetricMap.h.
Referenced by mrpt::maps::internal::TMetricMapTypesRegistry::factoryMapObjectFromDefinition(), mrpt::maps::CWirelessPowerGridMap2D::getAs3DObject(), mrpt::maps::CGasConcentrationGridMap2D::getAs3DObject(), mrpt::maps::CReflectivityGridMap2D::getAs3DObject(), mrpt::maps::CHeightGridMap2D::getAs3DObject(), mrpt::maps::CRandomFieldGridMap2D::getAs3DObject(), getAs3DObject(), mrpt::maps::CPointsMap::getAs3DObject(), mrpt::maps::CGasConcentrationGridMap2D::serializeFrom(), mrpt::maps::CWirelessPowerGridMap2D::serializeFrom(), mrpt::maps::CReflectivityGridMap2D::serializeFrom(), mrpt::maps::CHeightGridMap2D::serializeFrom(), mrpt::maps::CWirelessPowerGridMap2D::serializeTo(), mrpt::maps::CGasConcentrationGridMap2D::serializeTo(), mrpt::maps::CReflectivityGridMap2D::serializeTo(), and mrpt::maps::CHeightGridMap2D::serializeTo().
mrpt::maps::CLandmarksMap::TInsertionOptions mrpt::maps::CLandmarksMap::insertionOptions |
struct mrpt::maps::CLandmarksMap::TInsertionResults mrpt::maps::CLandmarksMap::insertionResults |
struct mrpt::maps::CLandmarksMap::TCustomSequenceLandmarks mrpt::maps::CLandmarksMap::landmarks |
Referenced by changeCoordinatesReference(), mrpt::vision::cloudsToMatchedList(), compute3DMatchingRatio(), computeLikelihood_RSLC_2007(), computeLikelihood_SIFT_LandmarkMap(), computeMatchingWith3DLandmarks(), fuseWith(), getAs3DObject(), mrpt::vision::projectMatchedFeatures(), mrpt::slam::CRejectionSamplingRangeOnlyLocalization::setParams(), simulateBeaconReadings(), simulateRangeBearingReadings(), mrpt::vision::StereoObs2BRObs(), and mrpt::slam::COccupancyGridMapFeatureExtractor::uncached_extractFeatures().
mrpt::maps::CLandmarksMap::TLikelihoodOptions mrpt::maps::CLandmarksMap::likelihoodOptions |
Referenced by computeLikelihood_SIFT_LandmarkMap().
|
static |
ID used to initialize class registration (just ignore it)
Definition at line 709 of file CLandmarksMap.h.
|
staticprotected |
Definition at line 76 of file CLandmarksMap.h.
Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020 |