Main MRPT website > C++ reference for MRPT 1.9.9
CPosePDF.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-2018, 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 "poses-precomp.h" // Precompiled headers
11 
12 #include <mrpt/poses/CPosePDF.h>
15 
16 using namespace mrpt::poses;
17 using namespace mrpt::math;
18 using namespace std;
19 
21 
22 void CPosePDF::jacobiansPoseComposition(
23  const CPosePDFGaussian& x, const CPosePDFGaussian& u,
24  CMatrixDouble33& df_dx, CMatrixDouble33& df_du)
25 {
26  CPosePDF::jacobiansPoseComposition(x.mean, u.mean, df_dx, df_du);
27 }
28 
29 /*---------------------------------------------------------------
30  jacobiansPoseComposition
31  ---------------------------------------------------------------*/
33  const CPose2D& x, const CPose2D& u, CMatrixDouble33& df_dx,
34  CMatrixDouble33& df_du, const bool compute_df_dx, const bool compute_df_du)
35 
36 {
37  const double spx = sin(x.phi());
38  const double cpx = cos(x.phi());
39  if (compute_df_dx)
40  {
41  /*
42  df_dx =
43  [ 1, 0, -sin(phi_x)*x_u-cos(phi_x)*y_u ]
44  [ 0, 1, cos(phi_x)*x_u-sin(phi_x)*y_u ]
45  [ 0, 0, 1 ]
46  */
47  df_dx.unit(3, 1.0);
48 
49  const double xu = u.x();
50  const double yu = u.y();
51 
52  df_dx.get_unsafe(0, 2) = -spx * xu - cpx * yu;
53  df_dx.get_unsafe(1, 2) = cpx * xu - spx * yu;
54  }
55 
56  if (compute_df_du)
57  {
58  /*
59  df_du =
60  [ cos(phi_x) , -sin(phi_x) , 0 ]
61  [ sin(phi_x) , cos(phi_x) , 0 ]
62  [ 0 , 0 , 1 ]
63  */
64  // This is the homogeneous matrix of "x":
65  df_du.get_unsafe(0, 2) = df_du.get_unsafe(1, 2) =
66  df_du.get_unsafe(2, 0) = df_du.get_unsafe(2, 1) = 0;
67  df_du.get_unsafe(2, 2) = 1;
68 
69  df_du.get_unsafe(0, 0) = cpx;
70  df_du.get_unsafe(0, 1) = -spx;
71  df_du.get_unsafe(1, 0) = spx;
72  df_du.get_unsafe(1, 1) = cpx;
73  }
74 }
poses-precomp.h
mrpt::poses::CPosePDF::jacobiansPoseComposition
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
mrpt::poses
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
Definition: CHierarchicalMapMHPartition.h:25
mrpt::poses::CPoseOrPoint::y
double y() const
Definition: CPoseOrPoint.h:144
CPosePDF.h
mrpt::poses::CPose2D
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle.
Definition: CPose2D.h:40
mrpt::poses::CPoseOrPoint::x
double x() const
Common members of all points & poses classes.
Definition: CPoseOrPoint.h:140
IMPLEMENTS_VIRTUAL_SERIALIZABLE
#define IMPLEMENTS_VIRTUAL_SERIALIZABLE( class_name, base_class_name, NameSpace)
This must be inserted as implementation of some required members for virtual CSerializable classes:
Definition: CSerializable.h:125
mrpt::math::CMatrixFixedNumeric< double, 3, 3 >
mrpt::poses::CPosePDF
Declares a class that represents a probability density function (pdf) of a 2D pose (x,...
Definition: CPosePDF.h:41
CPosePDFGaussian.h
void
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
mrpt::math
This base provides a set of functions for maths stuff.
Definition: math/include/mrpt/math/bits_math.h:13
mrpt::poses::CPosePDFGaussian
Declares a class that represents a Probability Density function (PDF) of a 2D pose .
Definition: CPosePDFGaussian.h:31
CArchive.h
x
GLenum GLint x
Definition: glext.h:3538



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST