An implementation of rejection sampling for generating 2D robot pose from range-only measurements within a landmarks (beacons) map.
Before calling the method "rejectionSampling" to generate the samples, you must call "setParams". It is assumed a planar scenario, where the robot is at a fixed height (default=0).
#include <mrpt/slam/CRejectionSamplingRangeOnlyLocalization.h>

Classes | |
| struct | TDataPerBeacon |
| Data for each beacon observation with a correspondence with the map. More... | |
Public Types | |
| typedef CProbabilityParticle < TStateSpace > | TParticle |
Public Member Functions | |
| CRejectionSamplingRangeOnlyLocalization () | |
| Constructor. | |
| virtual | ~CRejectionSamplingRangeOnlyLocalization () |
| Destructor. | |
| bool | setParams (const CLandmarksMap &beaconsMap, const CObservationBeaconRanges &observation, float sigmaRanges, const CPose2D &oldPose, float robot_z=0, bool autoCheckAngleRanges=true) |
| The parameters used in the generation of random samples: | |
| void | rejectionSampling (size_t desiredSamples, std::vector< TParticle > &outSamples, size_t timeoutTrials=1000) |
| Generates a set of N independent samples via rejection sampling. | |
Protected Member Functions | |
| void | RS_drawFromProposal (CPose2D &outSample) |
| Generates one sample, drawing from some proposal distribution. | |
| double | RS_observationLikelihood (const CPose2D &x) |
| Returns the NORMALIZED observation likelihood (linear, not exponential!!!) at a given point of the state space (values in the range [0,1]). | |
| virtual void | RS_drawFromProposal (TStateSpace &outSample)=0 |
| Generates one sample, drawing from some proposal distribution. | |
| virtual double | RS_observationLikelihood (const TStateSpace &x)=0 |
| Returns the NORMALIZED observation likelihood (linear, not exponential!!!) at a given point of the state space (values in the range [0,1]). | |
Protected Attributes | |
| float | m_z_robot |
| Z coordinate of the robot. | |
| float | m_sigmaRanges |
| CPose2D | m_oldPose |
| size_t | m_drawIndex |
| The index in "m_dataPerBeacon" used to draw samples (the rest will be used to evaluate the likelihood) | |
| std::deque< TDataPerBeacon > | m_dataPerBeacon |
| Data for each beacon observation with a correspondence with the map. | |
typedef CProbabilityParticle<TStateSpace> mrpt::bayes::CRejectionSamplingCapable::TParticle [inherited] |
Definition at line 50 of file CRejectionSamplingCapable.h.
| mrpt::slam::CRejectionSamplingRangeOnlyLocalization::CRejectionSamplingRangeOnlyLocalization | ( | ) |
Constructor.
| virtual mrpt::slam::CRejectionSamplingRangeOnlyLocalization::~CRejectionSamplingRangeOnlyLocalization | ( | ) | [inline, virtual] |
Destructor.
Definition at line 64 of file CRejectionSamplingRangeOnlyLocalization.h.
| void mrpt::bayes::CRejectionSamplingCapable::rejectionSampling | ( | size_t | desiredSamples, |
| std::vector< TParticle > & | outSamples, | ||
| size_t | timeoutTrials = 1000 |
||
| ) | [inline, inherited] |
Generates a set of N independent samples via rejection sampling.
| desiredSamples | The number of desired samples to generate |
| outSamples | The output samples. |
| timeoutTrials | The maximum number of rejection trials for each generated sample (i.e. the maximum number of iterations). This can be used to set a limit to the time complexity of the algorithm for difficult probability densities. All will have equal importance weights (a property of rejection sampling), although those samples generated at timeout will have a different importance weights. |
Definition at line 65 of file CRejectionSamplingCapable.h.
References MRPT_START, mrpt::bayes::CRejectionSamplingCapable::RS_drawFromProposal(), mrpt::bayes::CRejectionSamplingCapable::RS_observationLikelihood(), ASSERT_, mrpt::random::randomGenerator, and MRPT_END.
| void mrpt::slam::CRejectionSamplingRangeOnlyLocalization::RS_drawFromProposal | ( | CPose2D & | outSample | ) | [protected] |
Generates one sample, drawing from some proposal distribution.
| virtual void mrpt::bayes::CRejectionSamplingCapable::RS_drawFromProposal | ( | TStateSpace & | outSample | ) | [protected, pure virtual, inherited] |
Generates one sample, drawing from some proposal distribution.
| double mrpt::slam::CRejectionSamplingRangeOnlyLocalization::RS_observationLikelihood | ( | const CPose2D & | x | ) | [protected] |
Returns the NORMALIZED observation likelihood (linear, not exponential!!!) at a given point of the state space (values in the range [0,1]).
| virtual double mrpt::bayes::CRejectionSamplingCapable::RS_observationLikelihood | ( | const TStateSpace & | x | ) | [protected, pure virtual, inherited] |
Returns the NORMALIZED observation likelihood (linear, not exponential!!!) at a given point of the state space (values in the range [0,1]).
| bool mrpt::slam::CRejectionSamplingRangeOnlyLocalization::setParams | ( | const CLandmarksMap & | beaconsMap, |
| const CObservationBeaconRanges & | observation, | ||
| float | sigmaRanges, | ||
| const CPose2D & | oldPose, | ||
| float | robot_z = 0, |
||
| bool | autoCheckAngleRanges = true |
||
| ) |
The parameters used in the generation of random samples:
| beaconsMap | The map containing the N beacons (indexed by their "beacon ID"s). Only the mean 3D position of the beacons is used, the covariance is ignored. |
| observation | An observation with, at least ONE range measurement. |
| sigmaRanges | The standard deviation of the "range measurement noise". |
| robot_z | The height of the robot on the floor (default=0). Note that the beacon sensor on the robot may be at a different height, according to data within the observation object. |
| autoCheckAngleRanges | Whether to make a simple check for potential good angles from the beacons to generate samples (disable to speed-up the preparation vs. making slower the drawn). This method fills out the member "m_dataPerBeacon". |
std::deque<TDataPerBeacon> mrpt::slam::CRejectionSamplingRangeOnlyLocalization::m_dataPerBeacon [protected] |
Data for each beacon observation with a correspondence with the map.
Definition at line 118 of file CRejectionSamplingRangeOnlyLocalization.h.
size_t mrpt::slam::CRejectionSamplingRangeOnlyLocalization::m_drawIndex [protected] |
The index in "m_dataPerBeacon" used to draw samples (the rest will be used to evaluate the likelihood)
Definition at line 101 of file CRejectionSamplingRangeOnlyLocalization.h.
Definition at line 97 of file CRejectionSamplingRangeOnlyLocalization.h.
float mrpt::slam::CRejectionSamplingRangeOnlyLocalization::m_sigmaRanges [protected] |
Definition at line 96 of file CRejectionSamplingRangeOnlyLocalization.h.
float mrpt::slam::CRejectionSamplingRangeOnlyLocalization::m_z_robot [protected] |
Z coordinate of the robot.
Definition at line 94 of file CRejectionSamplingRangeOnlyLocalization.h.
| Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011 |