Go to the documentation of this file.
29 CRejectionSamplingRangeOnlyLocalization::
30 CRejectionSamplingRangeOnlyLocalization()
50 "There is no information from which to draw samples!! Use "
51 "'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)
Each one of the measurements.
const Scalar * const_iterator
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:
const double & phi() const
Get the phi angle of the 2D pose (in radians)
mrpt::poses::CPose2D m_oldPose
void RS_drawFromProposal(mrpt::poses::CPose2D &outSample)
Generates one sample, drawing from some proposal distribution.
double distanceTo(const CPoseOrPoint< OTHERCLASS > &b) const
Returns the Euclidean distance to another pose/point:
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 ...
#define THROW_EXCEPTION(msg)
#define ASSERT_(f)
Defines an assertion mechanism.
T square(const T x)
Inline function for the square of a number.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
size_t m_drawIndex
The index in "m_dataPerBeacon" used to draw samples (the rest will be used to evaluate the likelihood...
This namespace contains representation of robot actions and observations.
const CLandmark * getByBeaconID(unsigned int ID) const
Returns the landmark with a given beacon ID, or nullptr if not found.
std::deque< TMeasurement > sensedData
The list of observed ranges.
GLsizei GLsizei GLenum GLenum const GLvoid * data
double drawUniform(const double Min, const double Max)
Generate a uniformly distributed pseudo-random number using the MT19937 algorithm,...
GLuint GLuint GLsizei count
Declares a class derived from "CObservation" that represents one (or more) range measurements to labe...
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.
double x() const
Common members of all points & poses classes.
double x
X,Y,Z coordinates.
struct mrpt::maps::CLandmarksMap::TCustomSequenceLandmarks landmarks
std::deque< TDataPerBeacon > m_dataPerBeacon
Data for each beacon observation with a correspondence with the map.
Data for each beacon observation with a correspondence with the map.
mrpt::math::TPoint3D pose_mean
The mean of the landmark 3D position.
double RS_observationLikelihood(const mrpt::poses::CPose2D &x)
Returns the NORMALIZED observation likelihood (linear, not exponential!!!) at a given point of the st...
void fill(const T &value)
Fills all the cells with the same value.
float m_z_robot
Z coordinate of the robot.
A 2D grid of dynamic size which stores any kind of data at each cell.
CRandomGenerator & getRandomGenerator()
A static instance of a CRandomGenerator class, for use in single-thread applications.
This base provides a set of functions for maths stuff.
A class for storing a map of 3D probabilistic landmarks.
A namespace of pseudo-random numbers generators of diferent distributions.
double drawGaussian1D(const double mean, const double std)
Generate a normally distributed pseudo-random number.
A class used to store a 3D point.
GLubyte GLubyte GLubyte a
double DEG2RAD(const double x)
Degrees to radians.
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at mié 12 jul 2023 10:03:34 CEST | |