31 CRejectionSamplingRangeOnlyLocalization::CRejectionSamplingRangeOnlyLocalization() :
33 m_sigmaRanges ( 0.10f ),
49 THROW_EXCEPTION(
"There is no information from which to draw samples!! Use 'setParams' with valid data!");
110 bool autoCheckAngleRanges )
120 double xMin=1e30,xMax=-1e30,yMin=1e30,yMax=-1e30,gridRes=2*
m_sigmaRanges;
139 data.sensorOnRobot = it->sensorLocationOnRobot;
147 if (
data.radiusAtRobotPlane>0)
149 data.radiusAtRobotPlane = sqrt(
data.radiusAtRobotPlane );
164 printf(
"\nWARNING: Beacon range is shorter than distance between the robot and the beacon in the Z axis!!!: Ignoring this measurement\n");
220 if (
std::count(cell->begin(),cell->end(),
true)>1) { maxA=max(maxA,
a);minA=
min(minA,
a); }
226 if (
std::count(cell->begin(),cell->end(),
true)>1) { maxA=max(maxA,
a);minA=
min(minA,
a); }
232 if (
std::count(cell->begin(),cell->end(),
true)>1) { maxA=max(maxA,
a);minA=
min(minA,
a); }
240 float minCoberture=1e30f;
A namespace of pseudo-random numbers genrators of diferent distributions.
double drawUniform(const double Min, const double Max)
Generate a uniformly distributed pseudo-random number using the MT19937 algorithm, scaled to the selected range.
double x() const
Common members of all points & poses classes.
GLuint GLuint GLsizei count
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
double distanceTo(const CPoseOrPoint< OTHERCLASS > &b) const
Returns the Euclidean distance to another pose/point:
#define THROW_EXCEPTION(msg)
BASE_IMPEXP CRandomGenerator randomGenerator
A static instance of a CRandomGenerator class, for use in single-thread applications.
void RS_drawFromProposal(mrpt::poses::CPose2D &outSample)
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.
const Scalar * const_iterator
double z
X,Y,Z coordinates.
float m_z_robot
Z coordinate of the robot.
void fill(const T &value)
Fills all the cells with the same value.
const CLandmark * getByBeaconID(unsigned int ID) const
Returns the landmark with a given beacon ID, or NULL if not found.
double drawGaussian1D(const double mean, const double std)
Generate a normally distributed pseudo-random number.
T square(const T x)
Inline function for the square of a number.
std::vector< bool > vector_bool
A type for passing a vector of bools.
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
T * cellByPos(double x, double y)
Returns a pointer to the contents of a cell given by its coordinates, or NULL if it is out of the map...
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 2D grid of dynamic size which stores any kind of data at each cell.
A class for storing a map of 3D probabilistic landmarks.
double RS_observationLikelihood(const mrpt::poses::CPose2D &x)
Returns the NORMALIZED observation likelihood (linear, not exponential!!!) at a given point of the st...
std::deque< TMeasurement > sensedData
The list of observed ranges.
This namespace contains representation of robot actions and observations.
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.
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...
const double & phi() const
Get the phi angle of the 2D pose (in radians)
mrpt::math::TPoint3D pose_mean
The mean of the landmark 3D position.
GLsizei GLsizei GLenum GLenum const GLvoid * data
GLubyte GLubyte GLubyte a
struct VISION_IMPEXP mrpt::maps::CLandmarksMap::TCustomSequenceLandmarks landmarks