39 const CPose3D& P1DP2inv, matrix_VxV_t* df_de1, matrix_VxV_t* df_de2)
46 CPose3D::ln_rot_jacob(
R, dLnRot_dRot);
50 matrix_VxV_t& J1 = *df_de1;
61 J1(0, 4) = P1DP2inv.z();
62 J1(0, 5) = -P1DP2inv.
y();
63 J1(1, 3) = -P1DP2inv.z();
64 J1(1, 5) = P1DP2inv.
x();
65 J1(2, 3) = P1DP2inv.
y();
66 J1(2, 4) = -P1DP2inv.
x();
69 0,
R(2, 0), -
R(1, 0), -
R(2, 0), 0,
R(0, 0),
R(1, 0), -
R(0, 0), 0,
71 0,
R(2, 1), -
R(1, 1), -
R(2, 1), 0,
R(0, 1),
R(1, 1), -
R(0, 1), 0,
73 0,
R(2, 2), -
R(1, 2), -
R(2, 2), 0,
R(0, 2),
R(1, 2), -
R(0, 2), 0};
77 J1.block(3, 3, 3, 3) = (dLnRot_dRot * aux).eval();
86 matrix_VxV_t& J2 = *df_de2;
89 for (
int i = 0; i < 3; i++)
90 for (
int j = 0; j < 3; j++)
91 J2.set_unsafe(i, j, -
R.get_unsafe(i, j));
94 0,
R(0, 2), -
R(0, 1), 0,
R(1, 2), -
R(1, 1), 0,
R(2, 2), -
R(2, 1),
96 -
R(0, 2), 0,
R(0, 0), -
R(1, 2), 0,
R(1, 0), -
R(2, 2), 0,
R(2, 0),
98 R(0, 1), -
R(0, 0), 0,
R(1, 1), -
R(1, 0), 0,
R(2, 1), -
R(2, 0), 0};
102 J2.block(3, 3, 3, 3) = (dLnRot_dRot * aux).eval();
108 matrix_VxV_t* df_de1, matrix_VxV_t* df_de2)
116 const CPose2D& P1DP2inv, matrix_VxV_t* df_de1, matrix_VxV_t* df_de2)
120 matrix_VxV_t& J1 = *df_de1;
126 J1.unit(VECTOR_SIZE, 1.0);
127 J1(0, 2) = -P1DP2inv.
y();
128 J1(1, 2) = P1DP2inv.
x();
137 matrix_VxV_t& J2 = *df_de2;
139 const double ccos = cos(P1DP2inv.
phi());
140 const double csin = sin(P1DP2inv.
phi());
142 const double vals[] = {-ccos, csin, 0, -csin, -ccos, 0, 0, 0, -1};
149 matrix_VxV_t* df_de1, matrix_VxV_t* df_de2)
152 const double phi1 = P1.
phi();
155 const double si = std::sin(phi1), ci = std::cos(phi1);
160 K.block<2, 2>(0, 0) = RotDinv;
165 (*df_de1)(0, 0) = -ci;
166 (*df_de1)(0, 1) = -si;
167 (*df_de1)(0, 2) = -si * dt.x + ci * dt.y;
168 (*df_de1)(1, 0) = si;
169 (*df_de1)(1, 1) = -ci;
170 (*df_de1)(1, 2) = -ci * dt.x - si * dt.y;
173 (*df_de1)(2, 2) = -1;
174 (*df_de1) = K * (*df_de1);
179 (*df_de2)(0, 0) = ci;
180 (*df_de2)(0, 1) = si;
182 (*df_de2)(1, 0) = -si;
183 (*df_de2)(1, 1) = ci;
188 (*df_de2) = K * (*df_de2);
double x() const
Common members of all points & poses classes.
#define MRPT_MAX_ALIGN_BYTES
#define THROW_EXCEPTION(msg)
mrpt::math::CArrayDouble< 3 > ln_rotation() const
Take the logarithm of the 3x3 rotation matrix, generating the corresponding vector in the Lie Algebra...
CArrayNumeric is an array for numeric types supporting several mathematical operations (actually...
This base provides a set of functions for maths stuff.
mrpt::math::CArrayDouble< 3 > m_coords
The translation vector [x,y,z] access directly or with x(), y(), z() setter/getter methods...
void getRotationMatrix(mrpt::math::CMatrixDouble22 &R) const
Returns the SE(2) 2x2 rotation matrix.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
const double & phi() const
Get the phi angle of the 2D pose (in radians)
A helper class for SE(2) and SE(3) geometry-related transformations, on-manifold optimization Jacobia...
void getRotationMatrix(mrpt::math::CMatrixDouble33 &ROT) const
Get the 3x3 rotation matrix.