38 for (
size_t i = 0; i < N; i++)
40 const double prediction_total_var =
rangesCovar(i, i) + sensorRangeVar;
42 if (prediction_total_var > max_var)
52 const double likGauss = std::exp(
54 prediction_total_var);
61 pi = std::max(likGauss,
params.prob_lost_ray);
64 pi = std::max(likGauss, std::min(1.0,
params.prob_outliers));
66 double lpi = std::max(
params.min_ray_log_lik, log(pi));
69 if (num_valid) lik_sum /= num_valid;
70 lik_sum = exp(lik_sum);
size_type size() const
Get a 2-vector with [NROWS NCOLS] (as in MATLAB command size(x))
mrpt::vision::TStereoCalibParams params
float stdError
The "sigma" error of the device in meters, used while inserting the scan in an occupancy grid...
size_t getScanSize() const
Get number of scan rays.
float maxRange
The maximum range allowed by the device, in meters (e.g.
#define ASSERT_(f)
Defines an assertion mechanism.
mrpt::math::CVectorDouble rangesMean
The same ranges than in rangeScan.getScanRange(), for convenience as a math vector container...
#define ASSERT_EQUAL_(__A, __B)
Assert comparing two values, reporting their actual values upon failure.
This namespace contains representation of robot actions and observations.
double evaluateScanLikelihood(const CObservation2DRangeScan &otherScan, const TEvalParams ¶ms) const
Returns a measure of the likelihood of a given scan, compared to this scan variances.
size_type rows() const
Number of rows in the matrix.
size_type cols() const
Number of columns in the matrix.
return_t square(const num_t x)
Inline function for the square of a number.
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
const float & getScanRange(const size_t i) const
The range values of the scan, in meters.
mrpt::math::CMatrixDouble rangesCovar
The covariance matrix for all the ranges in rangeScan.getScanRange()
bool getScanRangeValidity(const size_t i) const
It's false (=0) on no reflected rays, referenced to elements in scan.