Visual Servoing Platform  version 3.6.1 under development (2024-11-21)
vpLandmarksGrid Class Reference

Public Member Functions

 vpLandmarksGrid (const std::vector< vpLandmarkMeasurements > &landmarks)
 
vpColVector state_to_measurement (const vpColVector &chi)
 
vpColVector measureGT (const vpColVector &pos)
 
vpColVector measureWithNoise (const vpColVector &pos)
 
 vpLandmarksGrid (const std::vector< vpLandmarkMeasurements > &landmarks, const double &distMaxAllowed)
 
vpColVector state_to_measurement (const vpColVector &particle)
 
vpColVector measureGT (const vpColVector &pos)
 
vpColVector measureWithNoise (const vpColVector &pos)
 
void computePositionFromMeasurements (const vpColVector &meas, double &x, double &y)
 
double likelihood (const vpColVector &particle, const vpColVector &meas)
 

Detailed Description

Class that represent a grid of landmarks that measure the distance and relative orientation of the 4-wheel robot.

Examples
pf-nonlinear-complex-example.cpp, and ukf-nonlinear-complex-example.cpp.

Definition at line 461 of file ukf-nonlinear-complex-example.cpp.

Constructor & Destructor Documentation

◆ vpLandmarksGrid() [1/2]

vpLandmarksGrid::vpLandmarksGrid ( const std::vector< vpLandmarkMeasurements > &  landmarks)
inline

Construct a new vpLandmarksGrid object.

Parameters
landmarksThe list of landmarks forming the grid.

Definition at line 469 of file ukf-nonlinear-complex-example.cpp.

◆ vpLandmarksGrid() [2/2]

vpLandmarksGrid::vpLandmarksGrid ( const std::vector< vpLandmarkMeasurements > &  landmarks,
const double &  distMaxAllowed 
)
inline

Construct a new vpLandmarksGrid object.

Parameters
[in]landmarksThe list of landmarks forming the grid.
[in]distMaxAllowedMaximum distance allowed for the likelihood computation.

Definition at line 472 of file pf-nonlinear-complex-example.cpp.

Member Function Documentation

◆ computePositionFromMeasurements()

void vpLandmarksGrid::computePositionFromMeasurements ( const vpColVector meas,
double &  x,
double &  y 
)
inline

Compute the position that corresponds to a measurement. As the measurements can be noisy, we take the average position computed for each landmark individually.

Parameters
[in]measThe measurement vector.
[out]xThe X-coordinate that corresponds to the measurement.
[out]yThe Y-coordinate that corresponds to the measurement.

Definition at line 546 of file pf-nonlinear-complex-example.cpp.

◆ likelihood()

double vpLandmarksGrid::likelihood ( const vpColVector particle,
const vpColVector meas 
)
inline

Compute the likelihood of a particle (value between 0. and 1.) knowing the measurements. The likelihood is computed using a Gaussian function that penalizes a particle whose position is "far" from the average position computed from the landmarks measurement.

Parameters
[in]particleThe particle state.
[in]measThe measurements.
Returns
double The likelihood of a particle (value between 0. and 1.)
Examples
pf-nonlinear-complex-example.cpp.

Definition at line 572 of file pf-nonlinear-complex-example.cpp.

◆ measureGT() [1/2]

vpColVector vpLandmarksGrid::measureGT ( const vpColVector pos)
inline

Perfect measurement from each landmark of the range and relative orientation of the robot located at pos.

Parameters
[in]posThe actual position of the robot (pos[0]: x, pos[1]: y, pos[2] = heading).
Returns
vpColVector n x ([0] the range [1] the relative orientation of the robot), where n is the number of landmarks.

Definition at line 499 of file ukf-nonlinear-complex-example.cpp.

◆ measureGT() [2/2]

vpColVector vpLandmarksGrid::measureGT ( const vpColVector pos)
inline

Perfect measurement from each landmark of the range and relative orientation of the robot located at pos.

Parameters
[in]posThe actual position of the robot (pos[0]: x, pos[1]: y, pos[2] = heading).
Returns
vpColVector n x ([0] the range [1] the relative orientation of the robot), where n is the number of landmarks.

Definition at line 507 of file pf-nonlinear-complex-example.cpp.

◆ measureWithNoise() [1/2]

vpColVector vpLandmarksGrid::measureWithNoise ( const vpColVector pos)
inline

Noisy measurement from each landmark of the range and relative orientation that correspond to pos.

Parameters
[in]posThe actual position of the robot (pos[0]: x ; pos[1] = y ; pos[2] = heading).
Returns
vpColVector n x ([0] the range [1] the relative orientation of the robot), where n is the number of landmarks.

Definition at line 519 of file ukf-nonlinear-complex-example.cpp.

◆ measureWithNoise() [2/2]

vpColVector vpLandmarksGrid::measureWithNoise ( const vpColVector pos)
inline

Noisy measurement from each landmark of the range and relative orientation that correspond to pos.

Parameters
[in]posThe actual position of the robot (pos[0]: x ; pos[1] = y ; pos[2] = heading).
Returns
vpColVector n x ([0] the range [1] the relative orientation of the robot), where n is the number of landmarks.

Definition at line 526 of file pf-nonlinear-complex-example.cpp.

◆ state_to_measurement() [1/2]

vpColVector vpLandmarksGrid::state_to_measurement ( const vpColVector chi)
inline

Convert the prior of the UKF into the measurement space.

Parameters
[in]chiThe prior.
Returns
vpColVector The prior expressed in the measurement space.
Examples
ukf-nonlinear-complex-example.cpp.

Definition at line 479 of file ukf-nonlinear-complex-example.cpp.

◆ state_to_measurement() [2/2]

vpColVector vpLandmarksGrid::state_to_measurement ( const vpColVector particle)
inline

Convert a particle of the Particle Filter into the measurement space.

Parameters
[in]particleThe prior.
Returns
vpColVector The prior expressed in the measurement space.

Definition at line 488 of file pf-nonlinear-complex-example.cpp.