SO3.cpp
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2 
3  * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4  * Atlanta, Georgia 30332-0415
5  * All Rights Reserved
6  * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7 
8  * See LICENSE for the license information
9 
10  * -------------------------------------------------------------------------- */
11 
21 #include <gtsam/base/Matrix.h>
22 #include <gtsam/base/Vector.h>
23 #include <gtsam/base/concepts.h>
24 #include <gtsam/geometry/Point3.h>
25 #include <gtsam/geometry/SO3.h>
26 
27 #include <Eigen/SVD>
28 #include <cmath>
29 #include <limits>
30 
31 namespace gtsam {
32 
33 //******************************************************************************
34 namespace so3 {
35 
36 static constexpr double one_6th = 1.0 / 6.0;
37 static constexpr double one_12th = 1.0 / 12.0;
38 static constexpr double one_24th = 1.0 / 24.0;
39 static constexpr double one_60th = 1.0 / 60.0;
40 static constexpr double one_120th = 1.0 / 120.0;
41 static constexpr double one_180th = 1.0 / 180.0;
42 static constexpr double one_720th = 1.0 / 720.0;
43 static constexpr double one_1260th = 1.0 / 1260.0;
44 
45 static constexpr double kPi_inv = 1.0 / M_PI;
46 static constexpr double kPi2 = M_PI * M_PI;
47 static constexpr double k1_Pi2 = 1.0 / kPi2;
48 static constexpr double kPi3 = M_PI * kPi2;
49 static constexpr double k1_Pi3 = 1.0 / kPi3;
50 static constexpr double k2_Pi3 = 2.0 * k1_Pi3;
51 static constexpr double k1_4Pi = 0.25 * kPi_inv; // 1/(4*pi)
52 
53 // --- Thresholds ---
54 // Tolerance for near zero (theta^2)
55 static constexpr double kNearZeroThresholdSq = 1e-6;
56 // Tolerance for near pi (delta^2 = (pi - theta)^2)
57 static constexpr double kNearPiThresholdSq = 1e-6;
58 
59 GTSAM_EXPORT Matrix99 Dcompose(const SO3& Q) {
60  Matrix99 H;
61  auto R = Q.matrix();
62  H << I_3x3 * R(0, 0), I_3x3 * R(1, 0), I_3x3 * R(2, 0), //
63  I_3x3 * R(0, 1), I_3x3 * R(1, 1), I_3x3 * R(2, 1), //
64  I_3x3 * R(0, 2), I_3x3 * R(1, 2), I_3x3 * R(2, 2);
65  return H;
66 }
67 
68 GTSAM_EXPORT Matrix3 compose(const Matrix3& M, const SO3& R,
70  Matrix3 MR = M * R.matrix();
71  if (H) *H = Dcompose(R);
72  return MR;
73 }
74 
75 void ExpmapFunctor::init(double nearZeroThresholdSq) {
76  nearZero = (theta2 <= nearZeroThresholdSq);
77 
78  if (!nearZero) {
79  // General case: Use standard stable formulas for A and B
80  const double sin_theta = std::sin(theta);
81  A = sin_theta / theta;
82  const double s2 = std::sin(theta / 2.0);
83  const double one_minus_cos =
84  2.0 * s2 * s2; // numerically better than [1 - cos(theta)]
85  B = one_minus_cos / theta2;
86  } else {
87  // Taylor expansion at 0 for A, B (Order theta^2)
88  A = 1.0 - theta2 * one_6th;
89  B = 0.5 - theta2 * one_24th;
90  }
91 }
92 
94 
95 ExpmapFunctor::ExpmapFunctor(double nearZeroThresholdSq, const Vector3& omega)
96  : theta2(omega.dot(omega)),
97  theta(std::sqrt(theta2)),
99  WW(W * W) {
100  init(nearZeroThresholdSq);
101 }
102 
103 ExpmapFunctor::ExpmapFunctor(const Vector3& axis, double angle)
104  : theta2(angle * angle),
105  theta(angle),
106  W(skewSymmetric(axis * angle)),
107  WW(W * W) {
109 }
110 
111 
112 Matrix3 ExpmapFunctor::expmap() const { return I_3x3 + A * W + B * WW; }
113 
114 DexpFunctor::DexpFunctor(const Vector3& omega, double nearZeroThresholdSq, double nearPiThresholdSq)
115  : ExpmapFunctor(nearZeroThresholdSq, omega), omega(omega) {
116  if (!nearZero) {
117  // General case or nearPi: Use standard stable formulas first
118  C = (1.0 - A) / theta2; // Usually stable, even near pi (1-0)/pi^2
119 
120  // Calculate delta = pi - theta (non-negative) for nearPi check
121  const double delta = M_PI > theta ? M_PI - theta : 0.0;
122  const double delta2 = delta * delta;
123  const bool nearPi = (delta2 < nearPiThresholdSq);
124  if (nearPi) {
125  // Taylor expansion near pi *only for D* (Order delta)
126  D = k1_Pi2 + (k2_Pi3 - k1_4Pi) * delta; // D ~ 1/pi^2 + delta*(2/pi^3 - 1/(4*pi))
127  } else {
128  // General case D:
129  D = (1.0 - A / (2.0 * B)) / theta2;
130  }
131  // Calculate E and F using standard formulas (stable near pi)
132  E = (2.0 * B - A) / theta2;
133  F = (3.0 * C - B) / theta2;
134  } else {
135  // Taylor expansion at 0
136  // TODO(Frank): flipping signs here does not trigger any tests: harden!
137  C = one_6th - theta2 * one_120th;
138  D = one_12th + theta2 * one_720th;
139  E = one_12th - theta2 * one_180th;
140  F = one_60th - theta2 * one_1260th;
141  }
142 }
143 
146 
148  if (theta > M_PI) return rightJacobian().inverse();
149  return I_3x3 + 0.5 * W + D * WW;
150 }
151 
153  if (theta > M_PI) return leftJacobian().inverse();
154  return I_3x3 - 0.5 * W + D * WW;
155 }
156 
157 // Multiplies v with left Jacobian through vector operations only.
159  OptionalJacobian<3, 3> H2) const {
160  const Vector3 Wv = gtsam::cross(omega, v);
161 
162  Matrix3 WWv_H_w;
163  const Vector3 WWv = gtsam::doubleCross(omega, v, H1 ? &WWv_H_w : nullptr);
164 
165  if (H1) {
166  // - E * omega.transpose() is 1x3 Jacobian of B with respect to omega
167  Matrix3 BWv_H_w = -Wv * E * omega.transpose() - B * skewSymmetric(v);
168  // - F * omega.transpose() is 1x3 Jacobian of C with respect to omega
169  Matrix3 CWWv_H_w = -WWv * F * omega.transpose() + C * WWv_H_w;
170  *H1 = -BWv_H_w + CWWv_H_w;
171  }
172 
173  if (H2) *H2 = rightJacobian();
174  return v - B * Wv + C * WWv;
175 }
176 
178  OptionalJacobian<3, 3> H2) const {
179  const Matrix3 invJr = rightJacobianInverse();
180  const Vector3 c = invJr * v;
181  if (H1) {
182  Matrix3 H;
183  applyRightJacobian(c, H); // get derivative H of forward mapping
184  *H1 = -invJr * H;
185  }
186  if (H2) *H2 = invJr;
187  return c;
188 }
189 
192  const Vector3 Wv = gtsam::cross(omega, v);
193 
194  Matrix3 WWv_H_w;
195  const Vector3 WWv = gtsam::doubleCross(omega, v, H1 ? &WWv_H_w : nullptr);
196 
197  if (H1) {
198  // - E * omega.transpose() is 1x3 Jacobian of B with respect to omega
199  Matrix3 BWv_H_w = -Wv * E * omega.transpose() - B * skewSymmetric(v);
200  // - F * omega.transpose() is 1x3 Jacobian of C with respect to omega
201  Matrix3 CWWv_H_w = -WWv * F * omega.transpose() + C * WWv_H_w;
202  *H1 = BWv_H_w + CWWv_H_w;
203  }
204 
205  if (H2) *H2 = leftJacobian();
206  return v + B * Wv + C * WWv;
207 }
208 
211  const Matrix3 invJl = leftJacobianInverse();
212  const Vector3 c = invJl * v;
213  if (H1) {
214  Matrix3 H;
215  applyLeftJacobian(c, H); // get derivative H of forward mapping
216  *H1 = -invJl * H;
217  }
218  if (H2) *H2 = invJl;
219  return c;
220 }
221 
222 } // namespace so3
223 
224 //******************************************************************************
225 template <>
226 GTSAM_EXPORT
227 SO3 SO3::AxisAngle(const Vector3& axis, double theta) {
228  return SO3(so3::ExpmapFunctor(axis, theta).expmap());
229 }
230 
231 //******************************************************************************
232 template <>
233 GTSAM_EXPORT
234 SO3 SO3::ClosestTo(const Matrix3& M) {
236  const auto& U = svd.matrixU();
237  const auto& V = svd.matrixV();
238  const double det = (U * V.transpose()).determinant();
239  return SO3(U * Vector3(1, 1, det).asDiagonal() * V.transpose());
240 }
241 
242 //******************************************************************************
243 template <>
244 GTSAM_EXPORT
245 SO3 SO3::ChordalMean(const std::vector<SO3>& rotations) {
246  // See Hartley13ijcv:
247  // Cost function C(R) = \sum sqr(|R-R_i|_F)
248  // Closed form solution = ClosestTo(C_e), where C_e = \sum R_i !!!!
249  Matrix3 C_e{Z_3x3};
250  for (const auto& R_i : rotations) {
251  C_e += R_i.matrix();
252  }
253  return ClosestTo(C_e);
254 }
255 
256 //******************************************************************************
257 template <>
258 GTSAM_EXPORT
259 Matrix3 SO3::Hat(const Vector3& xi) {
260  return skewSymmetric(xi);
261 }
262 
263 //******************************************************************************
264 template <>
265 GTSAM_EXPORT
266 Vector3 SO3::Vee(const Matrix3& X) {
267  Vector3 xi;
268  xi(0) = -X(1, 2);
269  xi(1) = +X(0, 2);
270  xi(2) = -X(0, 1);
271  return xi;
272 }
273 
274 //******************************************************************************
275 template <>
276 GTSAM_EXPORT
277 Matrix3 SO3::AdjointMap() const {
278  return matrix_;
279 }
280 
281 //******************************************************************************
282 template <>
283 GTSAM_EXPORT
284 SO3 SO3::Expmap(const Vector3& omega, ChartJacobian H) {
285  so3::DexpFunctor local(omega);
286  if (H) *H = local.rightJacobian();
287  return SO3(local.expmap());
288 }
289 
290 template <>
291 GTSAM_EXPORT
292 Matrix3 SO3::ExpmapDerivative(const Vector3& omega) {
293  return so3::DexpFunctor(omega).rightJacobian();
294 }
295 
296 //******************************************************************************
297 template <>
298 GTSAM_EXPORT
299 Matrix3 SO3::LogmapDerivative(const Vector3& omega) {
300  return so3::DexpFunctor(omega).rightJacobianInverse();
301 }
302 
303 template <>
304 GTSAM_EXPORT
305 Vector3 SO3::Logmap(const SO3& Q, ChartJacobian H) {
306  using std::sin;
307  using std::sqrt;
308 
309  // note switch to base 1
310  const Matrix3& R = Q.matrix();
311  const double &R11 = R(0, 0), R12 = R(0, 1), R13 = R(0, 2);
312  const double &R21 = R(1, 0), R22 = R(1, 1), R23 = R(1, 2);
313  const double &R31 = R(2, 0), R32 = R(2, 1), R33 = R(2, 2);
314 
315  const double tr = R.trace();
316  Vector3 omega;
317 
318  // when trace == -1, i.e., when theta = +-pi, +-3pi, +-5pi, etc.
319  // we do something special
320  if (tr + 1.0 < 1e-3) {
321  if (R33 > R22 && R33 > R11) {
322  // R33 is the largest diagonal, a=3, b=1, c=2
323  const double W = R21 - R12;
324  const double Q1 = 2.0 + 2.0 * R33;
325  const double Q2 = R31 + R13;
326  const double Q3 = R23 + R32;
327  const double r = sqrt(Q1);
328  const double one_over_r = 1 / r;
329  const double norm = sqrt(Q1*Q1 + Q2*Q2 + Q3*Q3 + W*W);
330  const double sgn_w = W < 0 ? -1.0 : 1.0;
331  const double mag = M_PI - (2 * sgn_w * W) / norm;
332  const double scale = 0.5 * one_over_r * mag;
333  omega = sgn_w * scale * Vector3(Q2, Q3, Q1);
334  } else if (R22 > R11) {
335  // R22 is the largest diagonal, a=2, b=3, c=1
336  const double W = R13 - R31;
337  const double Q1 = 2.0 + 2.0 * R22;
338  const double Q2 = R23 + R32;
339  const double Q3 = R12 + R21;
340  const double r = sqrt(Q1);
341  const double one_over_r = 1 / r;
342  const double norm = sqrt(Q1*Q1 + Q2*Q2 + Q3*Q3 + W*W);
343  const double sgn_w = W < 0 ? -1.0 : 1.0;
344  const double mag = M_PI - (2 * sgn_w * W) / norm;
345  const double scale = 0.5 * one_over_r * mag;
346  omega = sgn_w * scale * Vector3(Q3, Q1, Q2);
347  } else {
348  // R11 is the largest diagonal, a=1, b=2, c=3
349  const double W = R32 - R23;
350  const double Q1 = 2.0 + 2.0 * R11;
351  const double Q2 = R12 + R21;
352  const double Q3 = R31 + R13;
353  const double r = sqrt(Q1);
354  const double one_over_r = 1 / r;
355  const double norm = sqrt(Q1*Q1 + Q2*Q2 + Q3*Q3 + W*W);
356  const double sgn_w = W < 0 ? -1.0 : 1.0;
357  const double mag = M_PI - (2 * sgn_w * W) / norm;
358  const double scale = 0.5 * one_over_r * mag;
359  omega = sgn_w * scale * Vector3(Q1, Q2, Q3);
360  }
361  } else {
362  double magnitude;
363  const double tr_3 = tr - 3.0; // could be non-negative if the matrix is off orthogonal
364  if (tr_3 < -so3::kNearZeroThresholdSq) {
365  // this is the normal case -1 < trace < 3
366  double theta = acos((tr - 1.0) / 2.0);
367  magnitude = theta / (2.0 * sin(theta));
368  } else {
369  // when theta near 0, +-2pi, +-4pi, etc. (trace near 3.0)
370  // use Taylor expansion: theta \approx 1/2-(t-3)/12 + O((t-3)^2)
371  // see https://github.com/borglab/gtsam/issues/746 for details
372  magnitude = 0.5 - tr_3 * so3::one_12th + tr_3 * tr_3 * so3::one_60th;
373  }
374  omega = magnitude * Vector3(R32 - R23, R13 - R31, R21 - R12);
375  }
376 
377  if (H) *H = LogmapDerivative(omega);
378  return omega;
379 }
380 
381 //******************************************************************************
382 // Chart at origin for SO3 is *not* Cayley but actual Expmap/Logmap
383 
384 template <>
385 GTSAM_EXPORT
386 SO3 SO3::ChartAtOrigin::Retract(const Vector3& omega, ChartJacobian H) {
387  return Expmap(omega, H);
388 }
389 
390 template <>
391 GTSAM_EXPORT
392 Vector3 SO3::ChartAtOrigin::Local(const SO3& R, ChartJacobian H) {
393  return Logmap(R, H);
394 }
395 
396 //******************************************************************************
397 // local vectorize
398 static Vector9 vec3(const Matrix3& R) {
399  return Eigen::Map<const Vector9>(R.data());
400 }
401 
402 // so<3> generators
403 static std::vector<Matrix3> G3({SO3::Hat(Vector3::Unit(0)),
404  SO3::Hat(Vector3::Unit(1)),
405  SO3::Hat(Vector3::Unit(2))});
406 
407 // vectorized generators
408 static const Matrix93 P3 =
409  (Matrix93() << vec3(G3[0]), vec3(G3[1]), vec3(G3[2])).finished();
410 
411 //******************************************************************************
412 template <>
413 GTSAM_EXPORT
414 Vector9 SO3::vec(OptionalJacobian<9, 3> H) const {
415  const Matrix3& R = matrix_;
416  if (H) {
417  // As Luca calculated (for SO4), this is (I3 \oplus R) * P3
418  *H << R * P3.block<3, 3>(0, 0), R * P3.block<3, 3>(3, 0),
419  R * P3.block<3, 3>(6, 0);
420  }
421  return gtsam::vec3(R);
422 }
423 //******************************************************************************
424 
425 } // end namespace gtsam
gtsam::SO3
SO< 3 > SO3
Definition: SO3.h:33
H
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics set mxtics default set mytics default set mx2tics default set my2tics default set xtics border mirror norotate autofreq set ytics border mirror norotate autofreq set ztics border nomirror norotate autofreq set nox2tics set noy2tics set timestamp bottom norotate set rrange[*:*] noreverse nowriteback set trange[*:*] noreverse nowriteback set urange[*:*] noreverse nowriteback set vrange[*:*] noreverse nowriteback set xlabel matrix size set x2label set timefmt d m y n H
Definition: gnuplot_common_settings.hh:74
gtsam::SO< 3 >::AxisAngle
static SO AxisAngle(const Vector3 &axis, double theta)
Constructor from axis and angle. Only defined for SO3.
gtsam::so3::DexpFunctor::applyLeftJacobian
Vector3 applyLeftJacobian(const Vector3 &v, OptionalJacobian< 3, 3 > H1={}, OptionalJacobian< 3, 3 > H2={}) const
Multiplies with leftJacobian(), with optional derivatives.
Definition: SO3.cpp:190
gtsam::so3::one_180th
static constexpr double one_180th
Definition: SO3.cpp:41
Eigen::ComputeFullV
@ ComputeFullV
Definition: Constants.h:397
Vector.h
typedef and functions to augment Eigen's VectorXd
gtsam::so3::ExpmapFunctor::init
void init(double nearZeroThresholdSq)
Definition: SO3.cpp:75
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
gtsam::so3::ExpmapFunctor::B
double B
Definition: SO3.h:144
screwPose2::xi
Vector xi
Definition: testPose2.cpp:169
ceres::sin
Jet< T, N > sin(const Jet< T, N > &f)
Definition: jet.h:439
gtsam::so3::k2_Pi3
static constexpr double k2_Pi3
Definition: SO3.cpp:50
gtsam::so3::DexpFunctor::E
double E
Definition: SO3.h:175
c
Scalar Scalar * c
Definition: benchVecAdd.cpp:17
Matrix.h
typedef and functions to augment Eigen's MatrixXd
gtsam::abc_eqf_lib::State
State class representing the state of the Biased Attitude System.
Definition: ABC.h:128
gtsam::so3::DexpFunctor::rightJacobianInverse
Matrix3 rightJacobianInverse() const
Definition: SO3.cpp:147
B
Definition: test_numpy_dtypes.cpp:301
gtsam::so3::one_120th
static constexpr double one_120th
Definition: SO3.cpp:40
Eigen::ComputeFullU
@ ComputeFullU
Definition: Constants.h:393
gtsam::so3::ExpmapFunctor::expmap
Matrix3 expmap() const
Rodrigues formula.
Definition: SO3.cpp:112
gtsam::vec3
static Vector9 vec3(const Matrix3 &R)
Definition: SO3.cpp:398
gtsam::so3::one_24th
static constexpr double one_24th
Definition: SO3.cpp:38
X
#define X
Definition: icosphere.cpp:20
concepts.h
gtsam::so3::ExpmapFunctor::theta
const double theta
Definition: SO3.h:138
Point3.h
3D Point
gtsam::Vector3
Eigen::Vector3d Vector3
Definition: Vector.h:44
gtsam::so3::one_60th
static constexpr double one_60th
Definition: SO3.cpp:39
gtsam::skewSymmetric
Matrix3 skewSymmetric(double wx, double wy, double wz)
Definition: base/Matrix.h:381
P3
static double P3[]
Definition: jv.c:563
svd
cout<< "Here is the matrix m:"<< endl<< m<< endl;JacobiSVD< MatrixXf > svd(m, ComputeThinU|ComputeThinV)
ceres::acos
Jet< T, N > acos(const Jet< T, N > &f)
Definition: jet.h:432
determinant
void determinant(const MatrixType &m)
Definition: determinant.cpp:14
gtsam::utils.numerical_derivative.local
np.ndarray local(Y a, Y b)
Definition: numerical_derivative.py:33
gtsam::so3::DexpFunctor::DexpFunctor
DexpFunctor(const Vector3 &omega)
Constructor with element of Lie algebra so(3)
Definition: SO3.cpp:144
biased_x_rotation::omega
const double omega
Definition: testPreintegratedRotation.cpp:32
so3
Definition: testShonanFactor.cpp:38
SO3.h
3*3 matrix representation of SO(3)
gtsam::so3::one_720th
static constexpr double one_720th
Definition: SO3.cpp:42
Expmap
Pose2_ Expmap(const Vector3_ &xi)
Definition: InverseKinematicsExampleExpressions.cpp:47
A
Definition: test_numpy_dtypes.cpp:300
gtsam.examples.PlanarManipulatorExample.delta
def delta(g0, g1)
Definition: PlanarManipulatorExample.py:45
scale
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics scale
Definition: gnuplot_common_settings.hh:54
gtsam::cross
Point3 cross(const Point3 &p, const Point3 &q, OptionalJacobian< 3, 3 > H1, OptionalJacobian< 3, 3 > H2)
cross product
Definition: Point3.cpp:64
gtsam::so3::kPi2
static constexpr double kPi2
Definition: SO3.cpp:46
gtsam::SO::matrix
const MatrixNN & matrix() const
Return matrix.
Definition: SOn.h:161
gtsam::so3::ExpmapFunctor::A
double A
Definition: SO3.h:143
gtsam::so3::DexpFunctor::D
double D
Definition: SO3.h:172
gtsam::so3::k1_4Pi
static constexpr double k1_4Pi
Definition: SO3.cpp:51
gtsam::dot
double dot(const V1 &a, const V2 &b)
Definition: Vector.h:196
gtsam::so3::ExpmapFunctor::ExpmapFunctor
ExpmapFunctor(const Vector3 &omega)
Constructor with element of Lie algebra so(3)
Definition: SO3.cpp:93
gtsam::G3
static std::vector< Matrix3 > G3({SO3::Hat(Vector3::Unit(0)), SO3::Hat(Vector3::Unit(1)), SO3::Hat(Vector3::Unit(2))})
gtsam::so3::one_6th
static constexpr double one_6th
Definition: SO3.cpp:36
Eigen::Map
A matrix or vector expression mapping an existing array of data.
Definition: Map.h:94
gtsam::so3::k1_Pi3
static constexpr double k1_Pi3
Definition: SO3.cpp:49
gtsam::so3::DexpFunctor::applyLeftJacobianInverse
Vector3 applyLeftJacobianInverse(const Vector3 &v, OptionalJacobian< 3, 3 > H1={}, OptionalJacobian< 3, 3 > H2={}) const
Multiplies with leftJacobianInverse(), with optional derivatives.
Definition: SO3.cpp:209
gtsam::so3::DexpFunctor
Definition: SO3.h:165
gtsam::so3::DexpFunctor::omega
const Vector3 omega
Definition: SO3.h:166
Q2
static double Q2[8]
Definition: ndtri.c:122
Eigen::JacobiSVD
Two-sided Jacobi SVD decomposition of a rectangular matrix.
Definition: ForwardDeclarations.h:278
gtsam::so3::DexpFunctor::applyRightJacobian
Vector3 applyRightJacobian(const Vector3 &v, OptionalJacobian< 3, 3 > H1={}, OptionalJacobian< 3, 3 > H2={}) const
Multiplies with rightJacobian(), with optional derivatives.
Definition: SO3.cpp:158
Eigen::Quaternion
The quaternion class used to represent 3D orientations and rotations.
Definition: ForwardDeclarations.h:293
gtsam::so3::ExpmapFunctor::WW
const Matrix3 WW
Definition: SO3.h:139
gtsam::so3::DexpFunctor::leftJacobian
Matrix3 leftJacobian() const
Definition: SO3.h:193
gtsam::so3::DexpFunctor::applyRightJacobianInverse
Vector3 applyRightJacobianInverse(const Vector3 &v, OptionalJacobian< 3, 3 > H1={}, OptionalJacobian< 3, 3 > H2={}) const
Multiplies with rightJacobian().inverse(), with optional derivatives.
Definition: SO3.cpp:177
gtsam
traits
Definition: ABC.h:17
gtsam::so3::Dcompose
GTSAM_EXPORT Matrix99 Dcompose(const SO3 &Q)
(constant) Jacobian of compose wrpt M
Definition: SO3.cpp:59
gtsam::so3::DexpFunctor::C
double C
Definition: SO3.h:169
gtsam::OptionalJacobian
Definition: OptionalJacobian.h:38
gtsam::so3::DexpFunctor::rightJacobian
Matrix3 rightJacobian() const
Definition: SO3.h:190
gtsam::symbol_shorthand::W
Key W(std::uint64_t j)
Definition: inference/Symbol.h:170
gtsam::so3::DexpFunctor::F
double F
Definition: SO3.h:176
std
Definition: BFloat16.h:88
gtsam::so3::kPi_inv
static constexpr double kPi_inv
Definition: SO3.cpp:45
gtsam::so3::kNearPiThresholdSq
static constexpr double kNearPiThresholdSq
Definition: SO3.cpp:57
gtsam::so3::k1_Pi2
static constexpr double k1_Pi2
Definition: SO3.cpp:47
Q1
static double Q1[8]
Definition: ndtri.c:94
v
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
gtsam::so3::ExpmapFunctor::theta2
const double theta2
Definition: SO3.h:138
gtsam::SO< 3 >
U
@ U
Definition: testDecisionTree.cpp:342
V
MatrixXcd V
Definition: EigenSolver_EigenSolver_MatrixType.cpp:15
Eigen::Matrix< double, 9, 3 >
M_PI
#define M_PI
Definition: mconf.h:117
M
abc_eqf_lib::State< N > M
Definition: ABC_EQF_Demo.cpp:17
gtsam::so3::DexpFunctor::leftJacobianInverse
Matrix3 leftJacobianInverse() const
For |omega|>pi uses leftJacobian().inverse(), as unstable beyond pi!
Definition: SO3.cpp:152
gtsam::so3::ExpmapFunctor::nearZero
bool nearZero
Definition: SO3.h:140
so3::R12
SO3 R12
Definition: testShonanFactor.cpp:44
ceres::sqrt
Jet< T, N > sqrt(const Jet< T, N > &f)
Definition: jet.h:418
gtsam::so3::one_12th
static constexpr double one_12th
Definition: SO3.cpp:37
gtsam::so3::one_1260th
static constexpr double one_1260th
Definition: SO3.cpp:43
Matrix93
Eigen::Matrix< double, 9, 3 > Matrix93
Definition: testExpressionFactor.cpp:138
R
Rot2 R(Rot2::fromAngle(0.1))
gtsam::so3::kNearZeroThresholdSq
static constexpr double kNearZeroThresholdSq
Definition: SO3.cpp:55
gtsam::so3::compose
GTSAM_EXPORT Matrix3 compose(const Matrix3 &M, const SO3 &R, OptionalJacobian< 9, 9 > H)
Definition: SO3.cpp:68
gtsam::so3::ExpmapFunctor
Definition: SO3.h:137
gtsam::doubleCross
Point3 doubleCross(const Point3 &p, const Point3 &q, OptionalJacobian< 3, 3 > H1, OptionalJacobian< 3, 3 > H2)
double cross product
Definition: Point3.cpp:72
gtsam::so3::kPi3
static constexpr double kPi3
Definition: SO3.cpp:48
gtsam::so3::ExpmapFunctor::W
const Matrix3 W
Definition: SO3.h:139


gtsam
Author(s):
autogenerated on Wed May 28 2025 03:03:22