28 CMetricMap::CMetricMap() =
default;
36 void CMetricMap::loadFromProbabilisticPosesAndObservations(
41 const size_t n = sfSeq.
size();
47 for (
size_t i = 0; i < n; i++)
49 sfSeq.
get(i, posePDF, sf);
50 ASSERTMSG_(posePDF,
"Input map has an empty `CPose3DPDF` ptr");
51 ASSERTMSG_(sf,
"Input map has an empty `CSensoryFrame` ptr");
54 posePDF->getMean(robotPose);
56 sf->insertObservationsInto(
66 double CMetricMap::computeObservationsLikelihood(
70 for (
const auto& it : sf)
71 lik += computeObservationLikelihood(*it, takenFrom);
76 double CMetricMap::computeObservationLikelihood(
79 return computeObservationLikelihood(obs,
CPose3D(takenFrom));
85 bool CMetricMap::canComputeObservationsLikelihood(
const CSensoryFrame& sf)
const 88 for (
auto it = sf.
begin(); !can && it != sf.
end(); ++it)
89 can = can || canComputeObservationLikelihood(**it);
93 bool CMetricMap::insertObservation(
96 if (!genericMapParams.enableObservationInsertion)
return false;
98 bool done = internal_insertObservation(obs, robotPose);
101 OnPostSuccesfulInsertObs(obs);
107 bool CMetricMap::insertObservationPtr(
115 return insertObservation(*obs, robotPose);
119 void CMetricMap::determineMatching2D(
121 [[maybe_unused]]
const CPose2D& otherMapPose,
131 void CMetricMap::determineMatching3D(
133 [[maybe_unused]]
const CPose3D& otherMapPose,
143 float CMetricMap::compute3DMatchingRatio(
153 float CMetricMap::squareDistanceToClosestCorrespondence(
154 [[maybe_unused]]
float x0, [[maybe_unused]]
float y0)
const 161 bool CMetricMap::canComputeObservationLikelihood(
164 if (genericMapParams.enableObservationLikelihood)
165 return internal_canComputeObservationLikelihood(obs);
170 double CMetricMap::computeObservationLikelihood(
173 if (genericMapParams.enableObservationLikelihood)
174 return internal_computeObservationLikelihood(obs, takenFrom);
#define IMPLEMENTS_VIRTUAL_SERIALIZABLE(class_name, base_class, NS)
This must be inserted as implementation of some required members for virtual CSerializable classes: ...
Parameters for CMetricMap::compute3DMatchingRatio()
#define THROW_EXCEPTION(msg)
This class stores a sequence of <Probabilistic Pose,SensoryFrame> pairs, thus a "metric map" can be t...
mrpt::vision::TStereoCalibParams params
const_iterator begin() const
Returns a constant iterator to the first observation: this is an example of usage: ...
This base provides a set of functions for maths stuff.
This namespace contains representation of robot actions and observations.
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
#define ASSERTMSG_(f, __ERROR_MSG)
Defines an assertion mechanism.
size_t size() const
Returns the count of pairs (pose,sensory data)
void get(size_t index, mrpt::poses::CPose3DPDF::Ptr &out_posePDF, mrpt::obs::CSensoryFrame::Ptr &out_SF) const
Access to the i'th pair, first one is index '0'.
Event emitted by a metric up upon a succesful call to insertObservation()
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
Event emitted by a metric up upon call of clear()
Declares a virtual base class for all metric maps storage classes.
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Declares a class that represents any robot's observation.
const_iterator end() const
Returns a constant iterator to the end of the list of observations: this is an example of usage: ...
Parameters for the determination of matchings between point clouds, etc.
Functions for estimating the optimal transformation between two frames of references given measuremen...
void clear()
Clear the contents of this container.