30 CRejectionSamplingRangeOnlyLocalization::
31 CRejectionSamplingRangeOnlyLocalization()
49 "There is no information from which to draw samples!! Use " 50 "'setParams' with valid data!");
123 const CPose2D& oldPose,
float robot_z,
bool autoCheckAngleRanges)
133 double xMin = 1e30, xMax = -1e30, yMin = 1e30, yMax = -1e30,
146 for (i = 0, it = observation.
sensedData.begin();
147 it != observation.
sensedData.end(); ++it, ++i)
155 data.sensorOnRobot = it->sensorLocationOnRobot.asTPoint();
161 data.radiusAtRobotPlane =
164 if (
data.radiusAtRobotPlane > 0)
166 data.radiusAtRobotPlane = sqrt(
data.radiusAtRobotPlane);
177 xMin,
data.beaconPosition.x - (
data.radiusAtRobotPlane +
180 xMax,
data.beaconPosition.x + (
data.radiusAtRobotPlane +
183 yMin,
data.beaconPosition.y - (
data.radiusAtRobotPlane +
186 yMax,
data.beaconPosition.y + (
data.radiusAtRobotPlane +
192 "\nWARNING: Beacon range is shorter than distance between " 193 "the robot and the beacon in the Z axis!!!: Ignoring this " 208 xMin, xMax, yMin, yMax, gridRes);
210 std::vector<bool>* cell;
261 if (std::count(cell->begin(), cell->end(),
true) > 1)
272 if (std::count(cell->begin(), cell->end(),
true) > 1)
284 if (std::count(cell->begin(), cell->end(),
true) > 1)
296 float minCoberture = 1e30f;
302 if (c < minCoberture)
A namespace of pseudo-random numbers generators of diferent distributions.
A 2D grid of dynamic size which stores any kind of data at each cell.
void fill(const T &value)
Fills all the cells with the same value.
TPoint2D_< double > TPoint2D
Lightweight 2D point.
#define THROW_EXCEPTION(msg)
void RS_drawFromProposal(mrpt::poses::CPose2D &outSample) override
Generates one sample, drawing from some proposal distribution.
Declares a class derived from "CObservation" that represents one (or more) range measurements to labe...
Data for each beacon observation with a correspondence with the map.
float m_z_robot
Z coordinate of the robot.
const CLandmark * getByBeaconID(unsigned int ID) const
Returns the landmark with a given beacon ID, or nullptr if not found.
double distanceTo(const CPoseOrPoint< OTHERCLASS, DIM2 > &b) const
Returns the Euclidean distance to another pose/point:
size_t m_drawIndex
The index in "m_dataPerBeacon" used to draw samples (the rest will be used to evaluate the likelihood...
mrpt::poses::CPose2D m_oldPose
#define ASSERT_(f)
Defines an assertion mechanism.
return_t drawUniform(const double Min, const double Max)
Generate a uniformly distributed pseudo-random number using the MT19937 algorithm, scaled to the selected range.
This base provides a set of functions for maths stuff.
bool setParams(const mrpt::maps::CLandmarksMap &beaconsMap, const mrpt::obs::CObservationBeaconRanges &observation, float sigmaRanges, const mrpt::poses::CPose2D &oldPose, float robot_z=0, bool autoCheckAngleRanges=true)
The parameters used in the generation of random samples:
A class for storing a map of 3D probabilistic landmarks.
double phi() const
Get the phi angle of the 2D pose (in radians)
T * cellByPos(double x, double y)
Returns a pointer to the contents of a cell given by its coordinates, or nullptr if it is out of the ...
std::deque< TMeasurement > sensedData
The list of observed ranges.
This namespace contains representation of robot actions and observations.
double x() const
Common members of all points & poses classes.
return_t drawGaussian1D(const double mean, const double std)
Generate a normally distributed pseudo-random number.
A class used to store a 3D point.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
std::deque< TDataPerBeacon > m_dataPerBeacon
Data for each beacon observation with a correspondence with the map.
return_t square(const num_t x)
Inline function for the square of a number.
double RS_observationLikelihood(const mrpt::poses::CPose2D &x) override
Returns the NORMALIZED observation likelihood (linear, not exponential!!!) at a given point of the st...
The class for storing "landmarks" (visual or laser-scan-extracted features,...)
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle...
Each one of the measurements.
mrpt::math::TPoint3D pose_mean
The mean of the landmark 3D position.
CRandomGenerator & getRandomGenerator()
A static instance of a CRandomGenerator class, for use in single-thread applications.
struct mrpt::maps::CLandmarksMap::TCustomSequenceLandmarks landmarks
static struct FontData data