Main MRPT website > C++ reference for MRPT 1.9.9
CPosePDFGaussianInf.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #include "base-precomp.h" // Precompiled headers
11 
14 #include <mrpt/poses/CPose3DPDF.h>
16 #include <mrpt/poses/CPose3D.h>
18 #include <mrpt/math/wrap2pi.h>
19 #include <mrpt/system/os.h>
20 #include <mrpt/utils/CStream.h>
21 
22 #include <mrpt/random.h>
23 
24 using namespace mrpt;
25 using namespace mrpt::utils;
26 using namespace mrpt::poses;
27 using namespace mrpt::math;
28 using namespace mrpt::random;
29 using namespace mrpt::system;
30 
31 using namespace std;
32 
34 
35 /*---------------------------------------------------------------
36  Constructor
37  ---------------------------------------------------------------*/
38 CPosePDFGaussianInf::CPosePDFGaussianInf() : mean(0, 0, 0), cov_inv() {}
39 /*---------------------------------------------------------------
40  Constructor
41  ---------------------------------------------------------------*/
42 CPosePDFGaussianInf::CPosePDFGaussianInf(
43  const CPose2D& init_Mean, const CMatrixDouble33& init_CovInv)
44  : mean(init_Mean), cov_inv(init_CovInv)
45 {
46 }
47 
48 /*---------------------------------------------------------------
49  Constructor
50  ---------------------------------------------------------------*/
52  : mean(init_Mean), cov_inv()
53 {
54 }
55 
56 /*---------------------------------------------------------------
57  writeToStream
58  ---------------------------------------------------------------*/
60  mrpt::utils::CStream& out, int* version) const
61 {
62  if (version)
63  *version = 0;
64  else
65  {
66  out << mean.x() << mean.y() << mean.phi();
67  out << cov_inv(0, 0) << cov_inv(1, 1) << cov_inv(2, 2);
68  out << cov_inv(0, 1) << cov_inv(0, 2) << cov_inv(1, 2);
69  }
70 }
71 
72 /*---------------------------------------------------------------
73  readFromStream
74  ---------------------------------------------------------------*/
76 {
77  switch (version)
78  {
79  case 0:
80  {
81  TPose2D p;
82  in >> p.x >> p.y >> p.phi;
83  mean = CPose2D(p);
84 
85  in >> cov_inv(0, 0) >> cov_inv(1, 1) >> cov_inv(2, 2);
86  in >> cov_inv(0, 1) >> cov_inv(0, 2) >> cov_inv(1, 2);
87  }
88  break;
89  default:
91  };
92 }
93 
94 /*---------------------------------------------------------------
95  copyFrom
96  ---------------------------------------------------------------*/
98 {
99  if (this == &o) return; // It may be used sometimes
100 
101  if (IS_CLASS(&o, CPosePDFGaussianInf))
102  { // It's my same class:
103  const CPosePDFGaussianInf* ptr =
104  static_cast<const CPosePDFGaussianInf*>(&o);
105  mean = ptr->mean;
106  cov_inv = ptr->cov_inv;
107  }
108  else
109  { // Convert to gaussian pdf:
110  o.getMean(mean);
111 
113  o.getCovariance(o_cov);
114  o_cov.inv_fast(this->cov_inv);
115  }
116 }
117 
118 /*---------------------------------------------------------------
119  copyFrom 3D
120  ---------------------------------------------------------------*/
122 {
123  // Convert to gaussian pdf:
124  mean = CPose2D(o.getMeanVal());
125 
127  { // Cov is already in information form:
128  const CPose3DPDFGaussianInf* ptr =
129  static_cast<const CPose3DPDFGaussianInf*>(&o);
130  cov_inv(0, 0) = ptr->cov_inv(0, 0);
131  cov_inv(1, 1) = ptr->cov_inv(1, 1);
132  cov_inv(2, 2) = ptr->cov_inv(3, 3);
133  cov_inv(0, 1) = cov_inv(1, 0) = ptr->cov_inv(0, 1);
134  cov_inv(0, 2) = cov_inv(2, 0) = ptr->cov_inv(0, 3);
135  cov_inv(1, 2) = cov_inv(2, 1) = ptr->cov_inv(1, 3);
136  }
137  else
138  {
140  o.getCovariance(C);
141 
142  // Clip to 3x3:
144  o_cov(0, 0) = C(0, 0);
145  o_cov(1, 1) = C(1, 1);
146  o_cov(2, 2) = C(3, 3);
147  o_cov(0, 1) = o_cov(1, 0) = C(0, 1);
148  o_cov(0, 2) = o_cov(2, 0) = C(0, 3);
149  o_cov(1, 2) = o_cov(2, 1) = C(1, 3);
150 
151  o_cov.inv_fast(this->cov_inv);
152  }
153 }
154 
155 /*---------------------------------------------------------------
156 
157  ---------------------------------------------------------------*/
159 {
160  FILE* f = os::fopen(file.c_str(), "wt");
161  if (!f) return;
162 
163  os::fprintf(f, "%f %f %f\n", mean.x(), mean.y(), mean.phi());
164 
165  for (unsigned int i = 0; i < 3; i++)
166  os::fprintf(
167  f, "%f %f %f\n", cov_inv(i, 0), cov_inv(i, 1), cov_inv(i, 2));
168 
169  os::fclose(f);
170 }
171 
172 /*---------------------------------------------------------------
173  changeCoordinatesReference
174  ---------------------------------------------------------------*/
176  const CPose3D& newReferenceBase_)
177 {
178  const CPose2D newReferenceBase = CPose2D(newReferenceBase_);
179 
180  // The mean:
181  mean.composeFrom(newReferenceBase, mean);
182 
183  // The covariance:
184  rotateCov(newReferenceBase.phi());
185 }
186 
187 /*---------------------------------------------------------------
188  changeCoordinatesReference
189  ---------------------------------------------------------------*/
191  const CPose2D& newReferenceBase)
192 {
193  // The mean:
194  mean.composeFrom(newReferenceBase, mean);
195  // The covariance:
196  rotateCov(newReferenceBase.phi());
197 }
198 
199 /*---------------------------------------------------------------
200  changeCoordinatesReference
201  ---------------------------------------------------------------*/
202 void CPosePDFGaussianInf::rotateCov(const double ang)
203 {
204  const double ccos = cos(ang);
205  const double ssin = sin(ang);
206 
207  alignas(16)
208  const double rot_vals[] = {ccos, -ssin, 0., ssin, ccos, 0., 0., 0., 1.};
209 
210  const CMatrixFixedNumeric<double, 3, 3> rot(rot_vals);
211 
212  // NEW_COV = H C H^T
213  // NEW_COV^(-1) = (H C H^T)^(-1) = (H^T)^(-1) C^(-1) H^(-1)
214  // rot: Inverse of a rotation matrix is its trasposed.
215  // But we need H^t^-1 -> H !! so rot stays unchanged:
216  cov_inv = (rot * cov_inv * rot.adjoint()).eval();
217 }
218 
219 /*---------------------------------------------------------------
220  drawSingleSample
221  ---------------------------------------------------------------*/
223 {
224  MRPT_START
225 
227  this->cov_inv.inv(cov);
228 
231 
232  outPart.x(mean.x() + v[0]);
233  outPart.y(mean.y() + v[1]);
234  outPart.phi(mean.phi() + v[2]);
235 
236  // Range -pi,pi
237  outPart.normalizePhi();
238 
240  cov_inv.saveToTextFile(
241  "__DEBUG_EXC_DUMP_drawSingleSample_COV_INV.txt"););
242 }
243 
244 /*---------------------------------------------------------------
245  drawManySamples
246  ---------------------------------------------------------------*/
248  size_t N, std::vector<CVectorDouble>& outSamples) const
249 {
250  MRPT_START
251 
253  this->cov_inv.inv(cov);
254 
255  std::vector<CVectorDouble> rndSamples;
256 
258  outSamples.resize(N);
259  for (unsigned int i = 0; i < N; i++)
260  {
261  outSamples[i].resize(3);
262  outSamples[i][0] = mean.x() + rndSamples[i][0];
263  outSamples[i][1] = mean.y() + rndSamples[i][1];
264  outSamples[i][2] = mean.phi() + rndSamples[i][2];
265 
266  wrapToPiInPlace(outSamples[i][2]);
267  }
268 
269  MRPT_END
270 }
271 
272 /*---------------------------------------------------------------
273  bayesianFusion
274  ---------------------------------------------------------------*/
276  const CPosePDF& p1_, const CPosePDF& p2_,
277  const double& minMahalanobisDistToDrop)
278 {
279  MRPT_START
280 
281  MRPT_UNUSED_PARAM(minMahalanobisDistToDrop); // Not used in this class!
282 
285 
286  const CPosePDFGaussianInf* p1 =
287  static_cast<const CPosePDFGaussianInf*>(&p1_);
288  const CPosePDFGaussianInf* p2 =
289  static_cast<const CPosePDFGaussianInf*>(&p2_);
290 
291  const CMatrixDouble33& C1_inv = p1->cov_inv;
292  const CMatrixDouble33& C2_inv = p2->cov_inv;
293 
294  CMatrixDouble31 x1 = CMatrixDouble31(p1->mean);
296 
297  this->cov_inv = C1_inv + C2_inv;
298 
300  this->cov_inv.inv(cov);
301 
302  CMatrixDouble31 x = cov * (C1_inv * x1 + C2_inv * x2);
303 
304  this->mean.x(x(0, 0));
305  this->mean.y(x(1, 0));
306  this->mean.phi(x(2, 0));
307  this->mean.normalizePhi();
308 
309  MRPT_END
310 }
311 
312 /*---------------------------------------------------------------
313  inverse
314  ---------------------------------------------------------------*/
316 {
318  CPosePDFGaussianInf* out = static_cast<CPosePDFGaussianInf*>(&o);
319 
320  // The mean:
321  out->mean = CPose2D(0, 0, 0) - mean;
322 
323  // The covariance:
324  const double ccos = ::cos(mean.phi());
325  const double ssin = ::sin(mean.phi());
326 
327  // jacobian:
328  alignas(16) const double H_values[] = {
329  -ccos, -ssin, mean.x() * ssin - mean.y() * ccos,
330  ssin, -ccos, mean.x() * ccos + mean.y() * ssin,
331  0, 0, -1};
332  const CMatrixFixedNumeric<double, 3, 3> H(H_values);
333 
334  out->cov_inv.noalias() =
335  (H * cov_inv * H.adjoint()).eval(); // o.cov = H * cov * Ht. It's the
336  // same with inverse covariances.
337 }
338 
339 /*---------------------------------------------------------------
340  +=
341  ---------------------------------------------------------------*/
343 {
344  mean = mean + Ap;
345  rotateCov(Ap.phi());
346 }
347 
348 /*---------------------------------------------------------------
349  evaluatePDF
350  ---------------------------------------------------------------*/
352 {
355 
356  return math::normalPDF(X, MU, cov_inv.inverse());
357 }
358 
359 /*---------------------------------------------------------------
360  evaluateNormalizedPDF
361  ---------------------------------------------------------------*/
363 {
366 
368  this->cov_inv.inv(cov);
369 
370  return math::normalPDF(X, MU, cov) / math::normalPDF(MU, MU, cov);
371 }
372 
373 /*---------------------------------------------------------------
374  assureSymmetry
375  ---------------------------------------------------------------*/
377 {
378  // Differences, when they exist, appear in the ~15'th significant
379  // digit, so... just take one of them arbitrarily!
380  cov_inv(0, 1) = cov_inv(1, 0);
381  cov_inv(0, 2) = cov_inv(2, 0);
382  cov_inv(1, 2) = cov_inv(2, 1);
383 }
384 
385 /*---------------------------------------------------------------
386  mahalanobisDistanceTo
387  ---------------------------------------------------------------*/
389  const CPosePDFGaussianInf& theOther)
390 {
391  MRPT_START
392 
394  MU -= CArrayDouble<3>(theOther.mean);
395 
396  wrapToPiInPlace(MU[2]);
397 
398  if (MU[0] == 0 && MU[1] == 0 && MU[2] == 0)
399  return 0; // This is the ONLY case where we know the result, whatever
400  // COVs are.
401 
403  this->cov_inv.inv(COV_);
404  theOther.cov_inv.inv(cov2);
405 
406  COV_ += cov2; // COV_ = cov1+cov2
407 
409  COV_.inv_fast(COV_inv);
410 
411  // (~MU) * (!COV_) * MU
412  return std::sqrt(mrpt::math::multiply_HCHt_scalar(MU, COV_inv));
413 
414  MRPT_END
415 }
416 
417 /*---------------------------------------------------------------
418  operator <<
419  ---------------------------------------------------------------*/
421  std::ostream& out, const CPosePDFGaussianInf& obj)
422 {
423  out << "Mean: " << obj.mean << "\n";
424  out << "Inverse cov:\n" << obj.cov_inv << "\n";
425 
426  return out;
427 }
428 
429 /*---------------------------------------------------------------
430  operator +
431  ---------------------------------------------------------------*/
434 {
437  return ret;
438 }
439 
440 /*---------------------------------------------------------------
441  inverseComposition
442  Set 'this' = 'x' - 'ref', computing the mean using the "-"
443  operator and the covariances through the corresponding Jacobians.
444  ---------------------------------------------------------------*/
446  const CPosePDFGaussianInf& xv, const CPosePDFGaussianInf& xi)
447 {
448  // Use implementation in CPosePDFGaussian:
450  xv.cov_inv.inv(xv_cov);
451  xi.cov_inv.inv(xi_cov);
452 
453  const CPosePDFGaussian xv_(xv.mean, xv_cov);
454  const CPosePDFGaussian xi_(xi.mean, xi_cov);
455 
456  CPosePDFGaussian RET;
457  RET.inverseComposition(xv_, xi_);
458 
459  // Copy result to "this":
460  this->mean = RET.mean;
461  RET.cov.inv(this->cov_inv);
462 }
463 
464 /*---------------------------------------------------------------
465  inverseComposition
466  Set \f$ this = x1 \ominus x0 \f$ , computing the mean using
467  the "-" operator and the covariances through the corresponding
468  Jacobians (Given the 3x3 cross-covariance matrix of variables x0 and x0).
469  ---------------------------------------------------------------*/
471  const CPosePDFGaussianInf& x1, const CPosePDFGaussianInf& x0,
472  const CMatrixDouble33& COV_01)
473 {
474  // Use implementation in CPosePDFGaussian:
476  x1.cov_inv.inv(x1_cov);
477  x0.cov_inv.inv(x0_cov);
478 
479  const CPosePDFGaussian x1_(x1.mean, x1_cov);
480  const CPosePDFGaussian x0_(x0.mean, x0_cov);
481 
482  CPosePDFGaussian RET;
483  RET.inverseComposition(x1_, x0_, COV_01);
484 
485  // Copy result to "this":
486  this->mean = RET.mean;
487  RET.cov.inv(this->cov_inv);
488 }
489 
490 /*---------------------------------------------------------------
491  +=
492  ---------------------------------------------------------------*/
494 {
495  // COV:
497  this->cov_inv.inv(OLD_COV);
498 
499  CMatrixDouble33 df_dx, df_du;
500 
502  this->mean, // x
503  Ap.mean, // u
504  df_dx, df_du);
505 
506  // this->cov = H1*this->cov*~H1 + H2*Ap.cov*~H2;
508 
510  Ap.cov_inv.inv(Ap_cov);
511 
512  df_dx.multiply_HCHt(OLD_COV, cov);
513  df_du.multiply_HCHt(Ap_cov, cov, true); // Accumulate result
514 
515  cov.inv_fast(this->cov_inv);
516 
517  // MEAN:
518  this->mean = this->mean + Ap.mean;
519 }
520 
522  const CPosePDFGaussianInf& p1, const CPosePDFGaussianInf& p2)
523 {
524  return p1.mean == p2.mean && p1.cov_inv == p2.cov_inv;
525 }
526 
527 /** Pose compose operator: RES = A (+) B , computing both the mean and the
528  * covariance */
531 {
533  res += b;
534  return res;
535 }
536 
537 /** Pose inverse compose operator: RES = A (-) B , computing both the mean and
538  * the covariance */
541 {
543  res.inverseComposition(a, b);
544  return res;
545 }
A namespace of pseudo-random numbers genrators of diferent distributions.
double x() const
Common members of all points & poses classes.
Definition: CPoseOrPoint.h:135
void operator+=(const CPose2D &Ap)
Makes: thisPDF = thisPDF + Ap, where "+" is pose composition (both the mean, and the covariance matri...
void saveToTextFile(const std::string &file) const override
Save PDF&#39;s particles to a text file, containing the 2D pose in the first line, then the covariance ma...
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
CPose2D mean
The mean value.
#define MRPT_END_WITH_CLEAN_UP(stuff)
void bayesianFusion(const CPosePDF &p1, const CPosePDF &p2, const double &minMahalanobisDistToDrop=0) override
Bayesian fusion of two points gauss.
This namespace provides a OS-independent interface to many useful functions: filenames manipulation...
Definition: math_frwds.h:30
int void fclose(FILE *f)
An OS-independent version of fclose.
Definition: os.cpp:272
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
mrpt::math::TPoint2D operator+(const CPose2D &pose, const mrpt::math::TPoint2D &pnt)
Compose a 2D point from a new coordinate base given by a 2D pose.
Definition: CPose2D.cpp:377
TDATA getMeanVal() const
Returns the mean, or mathematical expectation of the probability density distribution (PDF)...
mrpt::math::CMatrixDouble66 cov_inv
The inverse of the 6x6 covariance matrix.
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction...
Definition: eigen_frwds.h:42
MAT_C::Scalar multiply_HCHt_scalar(const VECTOR_H &H, const MAT_C &C)
r (a scalar) = H * C * H^t (with a vector H and a symmetric matrix C)
Definition: ops_matrices.h:69
void getCovariance(mrpt::math::CMatrixDouble &cov) const
Returns the estimate of the covariance matrix (STATE_LEN x STATE_LEN covariance matrix) ...
STL namespace.
void drawManySamples(size_t N, std::vector< mrpt::math::CVectorDouble > &outSamples) const override
Draws a number of samples from the distribution, and saves as a list of 1x3 vectors, where each row contains a (x,y,phi) datum.
GLsizei GLsizei GLuint * obj
Definition: glext.h:4070
mrpt::math::CMatrixDouble33 cov
The 3x3 covariance matrix.
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const override
Introduces a pure virtual method responsible for writing to a CStream.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:41
void wrapToPiInPlace(T &a)
Modifies the given angle to translate it into the ]-pi,pi] range.
Definition: wrap2pi.h:64
This base provides a set of functions for maths stuff.
Definition: CArrayNumeric.h:19
double evaluateNormalizedPDF(const CPose2D &x) const
Evaluates the ratio PDF(x) / PDF(MEAN), that is, the normalized PDF in the range [0,1].
#define CLASS_ID(T)
Access to runtime class ID for a defined class name.
Definition: CObject.h:85
void copyFrom(const CPosePDF &o) override
Copy operator, translating if necesary (for example, between particles and gaussian representations) ...
Declares a class that represents a Probability Density function (PDF) of a 2D pose ...
#define MRPT_END
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
void inverse(CPosePDF &o) const override
Returns a new PDF such as: NEW_PDF = (0,0,0) - THIS_PDF.
double evaluatePDF(const CPose2D &x) const
Evaluates the PDF at a given point.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
void drawGaussianMultivariateMany(VECTOR_OF_VECTORS &ret, size_t desiredSamples, const COVMATRIX &cov, const typename VECTOR_OF_VECTORS::value_type *mean=nullptr)
Generate a given number of multidimensional random samples according to a given covariance matrix...
CPose2D operator-(const CPose2D &p)
Unary - operator: return the inverse pose "-p" (Note that is NOT the same than a pose with negative x...
Definition: CPose2D.cpp:328
GLubyte GLubyte b
Definition: glext.h:6279
virtual void getMean(TDATA &mean_point) const =0
Returns the mean, or mathematical expectation of the probability density distribution (PDF)...
GLsizei const GLchar ** string
Definition: glext.h:4101
void inverseComposition(const CPosePDFGaussian &x, const CPosePDFGaussian &ref)
Set , computing the mean using the "-" operator and the covariances through the corresponding Jacobi...
Declares a class that represents a probability density function (pdf) of a 2D pose (x...
Definition: CPosePDF.h:41
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
Definition: CPoint.h:17
int fprintf(FILE *fil, const char *format,...) noexcept MRPT_printf_format_check(2
An OS-independent version of fprintf.
Definition: os.cpp:405
void rotateCov(const double ang)
Rotate the covariance matrix by replacing it by , where .
virtual const mrpt::utils::TRuntimeClassId * GetRuntimeClass() const override
Returns information about the class of an object in runtime.
CPosePDFGaussianInf()
Default constructor (mean=all zeros, inverse covariance=all zeros -> so be careful!) ...
#define MRPT_START
const GLdouble * v
Definition: glext.h:3678
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A Probability Density function (PDF) of a 2D pose as a Gaussian with a mean and the inverse of the c...
bool operator==(const CPoint< DERIVEDCLASS > &p1, const CPoint< DERIVEDCLASS > &p2)
Definition: CPoint.h:163
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle...
Definition: CPose2D.h:40
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
static void jacobiansPoseComposition(const CPose2D &x, const CPose2D &u, mrpt::math::CMatrixDouble33 &df_dx, mrpt::math::CMatrixDouble33 &df_du, const bool compute_df_dx=true, const bool compute_df_du=true)
This static method computes the pose composition Jacobians, with these formulas:
Definition: CPosePDF.cpp:32
const double & phi() const
Get the phi angle of the 2D pose (in radians)
Definition: CPose2D.h:91
#define IS_CLASS(ptrObj, class_name)
Evaluates to true if the given pointer to an object (derived from mrpt::utils::CSerializable) is of t...
Definition: CObject.h:103
void composeFrom(const CPose2D &A, const CPose2D &B)
Makes .
Definition: CPose2D.cpp:124
Declares a class that represents a Probability Density function (PDF) of a 3D pose as a Gaussian des...
GLuint in
Definition: glext.h:7274
Lightweight 2D pose.
#define ASSERT_(f)
void drawSingleSample(CPose2D &outPart) const override
Draws a single sample from the distribution.
FILE * fopen(const char *fileName, const char *mode) noexcept
An OS-independent version of fopen.
Definition: os.cpp:254
Eigen::Matrix< typename MATRIX::Scalar, MATRIX::ColsAtCompileTime, MATRIX::ColsAtCompileTime > cov(const MATRIX &v)
Computes the covariance matrix from a list of samples in an NxM matrix, where each row is a sample...
Definition: ops_matrices.h:148
GLuint res
Definition: glext.h:7268
void drawGaussianMultivariate(std::vector< T > &out_result, const mrpt::math::CMatrixTemplateNumeric< T > &cov, const std::vector< T > *mean=nullptr)
Generate multidimensional random samples according to a given covariance matrix.
GLenum GLint x
Definition: glext.h:3538
void assureSymmetry()
Assures the symmetry of the covariance matrix (eventually certain operations in the math-coprocessor ...
CRandomGenerator & getRandomGenerator()
A static instance of a CRandomGenerator class, for use in single-thread applications.
double normalPDF(double x, double mu, double std)
Evaluates the univariate normal (Gaussian) distribution at a given point "x".
Definition: math.cpp:989
void inverseComposition(const CPosePDFGaussianInf &x, const CPosePDFGaussianInf &ref)
Set , computing the mean using the "-" operator and the covariances through the corresponding Jacobi...
GLubyte GLubyte GLubyte a
Definition: glext.h:6279
GLfloat GLfloat p
Definition: glext.h:6305
void readFromStream(mrpt::utils::CStream &in, int version) override
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
Declares a class that represents a Probability Density Function (PDF) of a 3D pose (6D actually)...
Definition: CPose3DPDF.h:42
void changeCoordinatesReference(const CPose3D &newReferenceBase) override
this = p (+) this.
mrpt::math::CMatrixDouble33 cov_inv
The inverse of the 3x3 covariance matrix (the "information" matrix)
EIGEN_STRONG_INLINE double mean() const
Computes the mean of the entire matrix.
void normalizePhi()
Forces "phi" to be in the range [-pi,pi];.
Definition: CPose2D.cpp:305
CMatrixFixedNumeric< double, 3, 1 > CMatrixDouble31
Definition: eigen_frwds.h:60
double mahalanobisDistanceTo(const CPosePDFGaussianInf &theOther)
Computes the Mahalanobis distance between the centers of two Gaussians.
std::ostream & operator<<(std::ostream &o, const CPoint< DERIVEDCLASS > &p)
Dumps a point as a string [x,y] or [x,y,z].
Definition: CPoint.h:137



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019