51 const double qr =
x.quat().r();
52 const double qx =
x.quat().x();
const double qx2 =
square(qx);
53 const double qy =
x.quat().y();
const double qy2 =
square(qy);
54 const double qz =
x.quat().z();
const double qz2 =
square(qz);
56 const double ax = u.
x();
57 const double ay = u.
y();
58 const double az = u.z();
59 const double q2r = u.
quat().
r();
60 const double q2x = u.
quat().
x();
61 const double q2y = u.
quat().
y();
62 const double q2z = u.
quat().
z();
69 x.quat().normalizationJacobian(norm_jacob_x);
75 df_dx.set_unsafe(0,0, 1);
76 df_dx.set_unsafe(1,1, 1);
77 df_dx.set_unsafe(2,2, 1);
82 2*(-2*qy*ax + qx*ay +qr*az ),
83 2*(-2*qz*ax - qr*ay +qx*az ),
86 2*(qy*ax - 2*qx*ay -qr*az ),
88 2*(qr*ax - 2*qz*ay +qy*az ),
91 2*( qz*ax + qr*ay - 2*qx*az ),
92 2*(-qr*ax + qz*ay - 2*qy*az ),
105 q2z, q2y,-q2x, q2r };
114 df_du.set_unsafe(0,0, 1-2*(qy2+qz2) );
115 df_du.set_unsafe(0,1, 2*(qx*qy - qr*qz ) );
116 df_du.set_unsafe(0,2, 2*(qr*qy + qx*qz ) );
118 df_du.set_unsafe(1,0, 2*(qr*qz + qx*qy ) );
119 df_du.set_unsafe(1,1, 1 - 2*( qx2+qz2) );
120 df_du.set_unsafe(1,2, 2*(qy*qz - qr*qx ) );
122 df_du.set_unsafe(2,0, 2*(qx*qz - qr*qy ) );
123 df_du.set_unsafe(2,1, 2*(qr*qx + qy*qz ) );
124 df_du.set_unsafe(2,2, 1-2*(qx2+qy2) );
138 *out_x_oplus_u = x_plus_u;
mrpt::math::CQuaternionDouble & quat()
Read/Write access to the quaternion representing the 3D rotation.
double x() const
Common members of all points & poses classes.
T y() const
Return y coordinate of the quaternion.
GLdouble GLdouble GLdouble GLdouble q
Declares a class that represents a Probability Density function (PDF) of a 3D pose using a quaternion...
T square(const T x)
Inline function for the square of a number.
A numeric matrix of compile-time fixed size.
This base provides a set of functions for maths stuff.
#define IMPLEMENTS_VIRTUAL_SERIALIZABLE(class_name, base_class_name, NameSpace)
This must be inserted as implementation of some required members for virtual CSerializable classes: ...
T r() const
Return r coordinate of the quaternion.
A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,qz).
Declares a class that represents a probability density function (pdf) of a 2D pose (x...
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
T x() const
Return x coordinate of the quaternion.
void normalizationJacobian(MATRIXLIKE &J) const
Calculate the 4x4 Jacobian of the normalization operation of this quaternion.
Declares a class that represents a Probability Density Function (PDF) of a 3D pose (6D actually)...
static void jacobiansPoseComposition(const CPose3DQuat &x, const CPose3DQuat &u, mrpt::math::CMatrixDouble77 &df_dx, mrpt::math::CMatrixDouble77 &df_du, CPose3DQuat *out_x_oplus_u=NULL)
This static method computes the two Jacobians of a pose composition operation $f(x,u)= x u$.
Declares a class that represents a Probability Density function (PDF) of a 3D pose ...
T z() const
Return z coordinate of the quaternion.