Gal3.cpp
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * GTSAM Copyright 2010, Georgia Tech Research Corporation,
3  * Atlanta, Georgia 30332-0415
4  * All Rights Reserved
5  * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
6  * See LICENSE for the license information
7  * -------------------------------------------------------------------------- */
8 
24 #include <gtsam/geometry/Gal3.h>
25 #include <gtsam/geometry/SO3.h>
26 #include <gtsam/geometry/Event.h>
28 #include <gtsam/base/Matrix.h>
31 
32 #include <iostream>
33 #include <cmath>
34 #include <functional>
35 
36 namespace gtsam {
37 
38 //------------------------------------------------------------------------------
39 // Constants and Helper function for Expmap/Logmap
40 //------------------------------------------------------------------------------
41 namespace { // Anonymous namespace for internal linkage
42  constexpr double kSmallAngleThreshold = 1e-10;
43 
44  // The type of the Lie algebra (matrix representation)
45  using LieAlgebra = Matrix5;
46 
47  // Helper functions for accessing tangent vector components
48  Eigen::Block<Vector10, 3, 1> rho(Vector10& v) { return v.block<3, 1>(0, 0); }
49  Eigen::Block<Vector10, 3, 1> nu(Vector10& v) { return v.block<3, 1>(3, 0); }
50  Eigen::Block<Vector10, 3, 1> theta(Vector10& v) { return v.block<3, 1>(6, 0); }
51  Eigen::Block<Vector10, 1, 1> t_tan(Vector10& v) { return v.block<1, 1>(9, 0); }
52  // Const versions
53  Eigen::Block<const Vector10, 3, 1> rho(const Vector10& v) { return v.block<3, 1>(0, 0); }
54  Eigen::Block<const Vector10, 3, 1> nu(const Vector10& v) { return v.block<3, 1>(3, 0); }
55  Eigen::Block<const Vector10, 3, 1> theta(const Vector10& v) { return v.block<3, 1>(6, 0); }
56  Eigen::Block<const Vector10, 1, 1> t_tan(const Vector10& v) { return v.block<1, 1>(9, 0); }
57 
58 } // end anonymous namespace
59 
60 //------------------------------------------------------------------------------
61 // Static Constructor/Create functions
62 //------------------------------------------------------------------------------
63 Gal3 Gal3::Create(const Rot3& R, const Point3& r, const Velocity3& v, double t,
66  if (H1) {
67  H1->setZero();
68  H1->block<3, 3>(6, 0) = Matrix3::Identity();
69  }
70  if (H2) {
71  H2->setZero();
72  H2->block<3, 3>(0, 0) = R.transpose();
73  }
74  if (H3) {
75  H3->setZero();
76  H3->block<3, 3>(3, 0) = R.transpose();
77  }
78  if (H4) {
79  H4->setZero();
80  Vector3 drho_dt = -R.transpose() * v;
81  H4->block<3, 1>(0, 0) = drho_dt;
82  (*H4)(9, 0) = 1.0;
83  }
84  return Gal3(R, r, v, t);
85 }
86 
87 //------------------------------------------------------------------------------
91  const Rot3& R = pose.rotation();
92  const Point3& r = pose.translation();
93  if (H1) {
94  H1->setZero();
95  H1->block<3, 3>(6, 0) = Matrix3::Identity();
96  H1->block<3, 3>(0, 3) = Matrix3::Identity();
97  }
98  if (H2) {
99  H2->setZero();
100  H2->block<3, 3>(3, 0) = R.transpose();
101  }
102  if (H3) {
103  H3->setZero();
104  Vector3 drho_dt = -R.transpose() * v;
105  H3->block<3, 1>(0, 0) = drho_dt;
106  (*H3)(9, 0) = 1.0;
107  }
108  return Gal3(R, r, v, t);
109 }
110 
111 //------------------------------------------------------------------------------
112 // Constructors
113 //------------------------------------------------------------------------------
115  // Constructor from 5x5 matrix representation (Equation 9, Page 5)
116  if (std::abs(M(3, 3) - 1.0) > 1e-9 || std::abs(M(4, 4) - 1.0) > 1e-9 ||
117  M.row(4).head(4).norm() > 1e-9 || M.row(3).head(3).norm() > 1e-9) {
118  throw std::invalid_argument("Invalid Gal3 matrix structure: Check zero blocks and diagonal ones.");
119  }
120  R_ = Rot3(M.block<3, 3>(0, 0));
121  v_ = M.block<3, 1>(0, 3);
122  r_ = Point3(M.block<3, 1>(0, 4));
123  t_ = M(3, 4);
124 }
125 
126 //------------------------------------------------------------------------------
127 // Component Access
128 //------------------------------------------------------------------------------
130  if (H) {
131  H->setZero();
132  H->block<3, 3>(0, 6) = Matrix3::Identity();
133  }
134  return R_;
135 }
136 
137 //------------------------------------------------------------------------------
139  if (H) {
140  H->setZero();
141  H->block<3,3>(0, 0) = R_.matrix();
142  H->block<3,1>(0, 9) = v_;
143  }
144  return r_;
145 }
146 
147 //------------------------------------------------------------------------------
149  if (H) {
150  H->setZero();
151  H->block<3, 3>(0, 3) = R_.matrix();
152  }
153  return v_;
154 }
155 
156 //------------------------------------------------------------------------------
157 const double& Gal3::time(OptionalJacobian<1, 10> H) const {
158  if (H) {
159  H->setZero();
160  (*H)(0, 9) = 1.0;
161  }
162  return t_;
163 }
164 
165 //------------------------------------------------------------------------------
166 // Matrix Representation
167 //------------------------------------------------------------------------------
169  // Returns 5x5 matrix representation as in Equation 9, Page 5
170  Matrix5 M = Matrix5::Identity();
171  M.block<3, 3>(0, 0) = R_.matrix();
172  M.block<3, 1>(0, 3) = v_;
173  M.block<3, 1>(0, 4) = Vector3(r_);
174  M(3, 4) = t_;
175  M.block<1,3>(3,0).setZero();
176  M.block<1,4>(4,0).setZero();
177  return M;
178 }
179 
180 //------------------------------------------------------------------------------
181 // Stream operator
182 //------------------------------------------------------------------------------
183 std::ostream& operator<<(std::ostream& os, const Gal3& state) {
184  os << "R: " << state.R_ << "\n";
185  os << "r: " << state.r_.transpose() << "\n";
186  os << "v: " << state.v_.transpose() << "\n";
187  os << "t: " << state.t_;
188  return os;
189 }
190 
191 //------------------------------------------------------------------------------
192 // Testable Requirements
193 //------------------------------------------------------------------------------
194 void Gal3::print(const std::string& s) const {
195  std::cout << (s.empty() ? "" : s + " ");
196  std::cout << *this << std::endl;
197 }
198 
199 //------------------------------------------------------------------------------
200 bool Gal3::equals(const Gal3& other, double tol) const {
201  return R_.equals(other.R_, tol) &&
204  std::abs(t_ - other.t_) < tol;
205 }
206 
207 //------------------------------------------------------------------------------
208 // Group Operations
209 //------------------------------------------------------------------------------
211  // Implements inverse formula from Equation 10, Page 5
212  const Rot3 Rinv = R_.inverse();
213  const Velocity3 v_inv = -(Rinv.rotate(v_));
214  const Point3 r_inv = -(Rinv.rotate(Vector3(r_) - t_ * v_));
215  const double t_inv = -t_;
216  return Gal3(Rinv, r_inv, v_inv, t_inv);
217 }
218 
219 //------------------------------------------------------------------------------
221  // Implements group composition through matrix multiplication
222  const Gal3& g1 = *this;
223  const Gal3& g2 = other;
224 
225  const Rot3 R_comp = g1.R_.compose(g2.R_);
226  const Vector3 r1_vec(g1.r_);
227  const Vector3 r2_vec(g2.r_);
228  const Vector3 r_comp_vec = g1.R_.rotate(r2_vec) + g2.t_ * g1.v_ + r1_vec;
229  const Velocity3 v_comp = g1.R_.rotate(g2.v_) + g1.v_;
230  const double t_comp = g1.t_ + g2.t_;
231 
232  return Gal3(R_comp, Point3(r_comp_vec), v_comp, t_comp);
233 }
234 
235 //------------------------------------------------------------------------------
236 // Lie Group Static Functions
237 //------------------------------------------------------------------------------
239  // Implements exponential map from Equations 16-19, Pages 7-8
240  const Vector3 rho_tan = rho(xi);
241  const Vector3 nu_tan = nu(xi);
242  const Vector3 theta_tan = theta(xi);
243  const double t_tan_val = t_tan(xi)(0);
244 
245  const gtsam::so3::DexpFunctor dexp_functor(theta_tan);
246  const Rot3 R = Rot3::Expmap(theta_tan);
247  const Matrix3 Jl_theta = dexp_functor.leftJacobian();
248 
249  Matrix3 E;
250  if (dexp_functor.nearZero) {
251  // Small angle approximation for E matrix (from Equation 19, Page 8)
252  E = 0.5 * Matrix3::Identity() + (1.0 / 6.0) * dexp_functor.W + (1.0 / 24.0) * dexp_functor.WW;
253  } else {
254  // Closed form for E matrix (from Equation 19, Page 8)
255  const double B_E = (1.0 - 2.0 * dexp_functor.B) / (2.0 * dexp_functor.theta2);
256  E = 0.5 * Matrix3::Identity() + dexp_functor.C * dexp_functor.W + B_E * dexp_functor.WW;
257  }
258 
259  const Point3 r_final = Point3(Jl_theta * rho_tan + E * (t_tan_val * nu_tan));
260  const Velocity3 v_final = Jl_theta * nu_tan;
261  const double t_final = t_tan_val;
262 
263  Gal3 result(R, r_final, v_final, t_final);
264 
265  if (Hxi) {
266  *Hxi = Gal3::ExpmapDerivative(xi);
267  }
268 
269  return result;
270 }
271 
272 //------------------------------------------------------------------------------
274  // Implements logarithmic map from Equations 20-23, Page 8
275  const Vector3 theta_vec = Rot3::Logmap(g.R_);
276  const gtsam::so3::DexpFunctor dexp_functor_log(theta_vec);
277  const Matrix3 Jl_theta_inv = dexp_functor_log.leftJacobianInverse();
278 
279  Matrix3 E;
280  if (dexp_functor_log.nearZero) {
281  // Small angle approximation for E matrix
282  E = 0.5 * Matrix3::Identity() + (1.0 / 6.0) * dexp_functor_log.W + (1.0 / 24.0) * dexp_functor_log.WW;
283  } else {
284  // Closed form for E matrix (from Equation 19, Page 8)
285  const double B_E = (1.0 - 2.0 * dexp_functor_log.B) / (2.0 * dexp_functor_log.theta2);
286  E = 0.5 * Matrix3::Identity() + dexp_functor_log.C * dexp_functor_log.W + B_E * dexp_functor_log.WW;
287  }
288 
289  const Vector3 r_vec = Vector3(g.r_);
290  const Velocity3& v_vec = g.v_;
291  const double& t_val = g.t_;
292 
293  // Implementation of Equation 23, Page 8
294  const Vector3 nu_tan = Jl_theta_inv * v_vec;
295  const Vector3 rho_tan = Jl_theta_inv * (r_vec - E * (t_val * nu_tan));
296  const double t_tan_val = t_val;
297 
298  Vector10 xi;
299  rho(xi) = rho_tan;
300  nu(xi) = nu_tan;
301  theta(xi) = theta_vec;
302  t_tan(xi)(0) = t_tan_val;
303 
304  if (Hg) {
305  *Hg = Gal3::LogmapDerivative(g);
306  }
307 
308  return xi;
309 }
310 
311 //------------------------------------------------------------------------------
313  // Implements adjoint map as in Equation 26, Page 9
314  const Matrix3 Rmat = R_.matrix();
315  const Vector3 v_vec = v_;
316  const Vector3 r_minus_tv = Vector3(r_) - t_ * v_;
317 
318  Matrix10 Ad = Matrix10::Zero();
319 
320  Ad.block<3,3>(0,0) = Rmat;
321  Ad.block<3,3>(0,3) = -t_ * Rmat;
322  Ad.block<3,3>(0,6) = skewSymmetric(r_minus_tv) * Rmat;
323  Ad.block<3,1>(0,9) = v_vec;
324 
325  Ad.block<3,3>(3,3) = Rmat;
326  Ad.block<3,3>(3,6) = skewSymmetric(v_vec) * Rmat;
327 
328  Ad.block<3,3>(6,6) = Rmat;
329 
330  Ad(9,9) = 1.0;
331 
332  return Ad;
333 }
334 
335 //------------------------------------------------------------------------------
337  Matrix10 Ad = AdjointMap();
338  Vector10 y = Ad * xi;
339 
340  if (H_xi) {
341  *H_xi = Ad;
342  }
343 
344  if (H_g) {
345  // NOTE: Using numerical derivative for the Jacobian with respect to
346  // the group element instead of deriving the analytical expression.
347  // Future work to use analytical instead.
348  std::function<Vector10(const Gal3&, const Vector10&)> adjoint_action_wrt_g =
349  [&](const Gal3& g_in, const Vector10& xi_in) {
350  return g_in.Adjoint(xi_in);
351  };
352  *H_g = numericalDerivative21(adjoint_action_wrt_g, *this, xi, 1e-7);
353  }
354  return y;
355 }
356 
357 //------------------------------------------------------------------------------
359  // Implements adjoint representation as in Equation 28, Page 10
360  const Matrix3 Theta_hat = skewSymmetric(theta(xi));
361  const Matrix3 Nu_hat = skewSymmetric(nu(xi));
362  const Matrix3 Rho_hat = skewSymmetric(rho(xi));
363  const double t_val = t_tan(xi)(0);
364  const Vector3 nu_vec = nu(xi);
365 
366  Matrix10 ad = Matrix10::Zero();
367 
368  ad.block<3,3>(0,0) = Theta_hat;
369  ad.block<3,3>(0,3) = -t_val * Matrix3::Identity();
370  ad.block<3,3>(0,6) = Rho_hat;
371  ad.block<3,1>(0,9) = nu_vec;
372 
373  ad.block<3,3>(3,3) = Theta_hat;
374  ad.block<3,3>(3,6) = Nu_hat;
375 
376  ad.block<3,3>(6,6) = Theta_hat;
377 
378  return ad;
379 }
380 
381 //------------------------------------------------------------------------------
383  Matrix10 ad_xi = adjointMap(xi);
384  if (Hy) *Hy = ad_xi;
385  if (Hxi) {
386  *Hxi = -adjointMap(y);
387  }
388  return ad_xi * y;
389 }
390 
391 //------------------------------------------------------------------------------
393  // Related to the left Jacobian in Equations 31-36, Pages 10-11
394  // NOTE: Using numerical approximation instead of implementing the analytical
395  // expression for the Jacobian. Future work to replace this
396  // with analytical derivative.
397  if (xi.norm() < kSmallAngleThreshold) return Matrix10::Identity();
398  std::function<Gal3(const Vector10&)> fn =
399  [](const Vector10& v) { return Gal3::Expmap(v); };
400  return numericalDerivative11<Gal3, Vector10>(fn, xi, 1e-5);
401 }
402 
403 //------------------------------------------------------------------------------
405  // Related to the inverse of left Jacobian in Equations 31-36, Pages 10-11
406  // NOTE: Using numerical approximation instead of implementing the analytical
407  // expression for the inverse Jacobian. Future work to replace this
408  // with analytical derivative.
410  if (xi.norm() < kSmallAngleThreshold) return Matrix10::Identity();
411  std::function<Vector10(const Gal3&)> fn =
412  [](const Gal3& g_in) { return Gal3::Logmap(g_in); };
413  return numericalDerivative11<Vector10, Gal3>(fn, g, 1e-5);
414 }
415 
416 //------------------------------------------------------------------------------
417 // Lie Algebra (Hat/Vee maps)
418 //------------------------------------------------------------------------------
420  // Implements hat operator as in Equation 13, Page 6
421  const Vector3 rho_tan = rho(xi);
422  const Vector3 nu_tan = nu(xi);
423  const Vector3 theta_tan = theta(xi);
424  const double t_tan_val = t_tan(xi)(0);
425 
426  Matrix5 X = Matrix5::Zero();
427  X.block<3, 3>(0, 0) = skewSymmetric(theta_tan);
428  X.block<3, 1>(0, 3) = nu_tan;
429  X.block<3, 1>(0, 4) = rho_tan;
430  X(3, 4) = t_tan_val;
431  return X;
432 }
433 
434 //------------------------------------------------------------------------------
436  // Implements vee operator (inverse of hat operator in Equation 13, Page 6)
437  if (X.row(4).norm() > 1e-9 || X.row(3).head(3).norm() > 1e-9 || std::abs(X(3,3)) > 1e-9) {
438  throw std::invalid_argument("Matrix is not in sgal(3)");
439  }
440 
441  Vector10 xi;
442  rho(xi) = X.block<3, 1>(0, 4);
443  nu(xi) = X.block<3, 1>(0, 3);
444  const Matrix3& S = X.block<3, 3>(0, 0);
445  theta(xi) << S(2, 1), S(0, 2), S(1, 0);
446  t_tan(xi)(0) = X(3, 4);
447  return xi;
448 }
449 
450 //------------------------------------------------------------------------------
451 // ChartAtOrigin
452 //------------------------------------------------------------------------------
453 Gal3 Gal3::ChartAtOrigin::Retract(const Vector10& xi, ChartJacobian Hxi) {
454  return Gal3::Expmap(xi, Hxi);
455 }
456 
457 //------------------------------------------------------------------------------
459  return Gal3::Logmap(g, Hg);
460 }
461 
462 //------------------------------------------------------------------------------
464  OptionalJacobian<4, 4> He) const {
465  // Implements group action on events (spacetime points) as described in Section 4.1, Page 3-4
466  const double& t_in = e.time();
467  const Point3& p_in = e.location();
468 
469  const double t_out = t_in + t_;
470  const Point3 p_out = R_.rotate(p_in) + v_ * t_in + r_;
471 
472  if (He) {
473  He->setZero();
474  (*He)(0, 0) = 1.0;
475  He->block<3, 1>(1, 0) = v_;
476  He->block<3, 3>(1, 1) = R_.matrix();
477  }
478 
479  if (Hself) {
480  Hself->setZero();
481  const Matrix3 Rmat = R_.matrix();
482 
483  (*Hself)(0, 9) = 1.0;
484  Hself->block<3, 3>(1, 0) = Rmat;
485  Hself->block<3, 3>(1, 3) = Rmat * t_in;
486  Hself->block<3, 3>(1, 6) = -Rmat * skewSymmetric(p_in);
487  Hself->block<3, 1>(1, 9) = v_;
488  }
489 
490  return Event(t_out, p_out);
491 }
492 
493 } // namespace gtsam
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
Gal3.h
3D Galilean Group SGal(3) state (attitude, position, velocity, time)
gtsam::Gal3::time
const double & time(OptionalJacobian< 1, 10 > H={}) const
Access time component (double)
Definition: Gal3.cpp:157
gtsam::Gal3::FromPoseVelocityTime
static Gal3 FromPoseVelocityTime(const Pose3 &pose, const Velocity3 &v, double t, OptionalJacobian< 10, 6 > H1={}, OptionalJacobian< 10, 3 > H2={}, OptionalJacobian< 10, 1 > H3={})
Named constructor from Pose3, velocity, and time with derivatives.
Definition: Gal3.cpp:88
pose
static const Pose3 pose(Rot3(Vector3(1, -1, -1).asDiagonal()), Point3(0, 0, 0.5))
Eigen::Block
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:103
gtsam::Gal3::R
Matrix3 R() const
Return rotation matrix (Matrix3)
Definition: Gal3.h:108
concepts.h
Concept-checking macros for geometric objects Each macro instantiates a concept check structure,...
s
RealScalar s
Definition: level1_cplx_impl.h:126
gtsam::Gal3::print
void print(const std::string &s="") const
Print with optional string prefix.
Definition: Gal3.cpp:194
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
gtsam::operator<<
std::ostream & operator<<(std::ostream &os, const Dih6 &m)
Definition: testGroup.cpp:109
gtsam::so3::ExpmapFunctor::B
double B
Definition: SO3.h:144
screwPose2::xi
Vector xi
Definition: testPose2.cpp:169
g1
Pose3 g1(Rot3(), Point3(100.0, 0.0, 300.0))
gtsam::Velocity3
Vector3 Velocity3
Velocity is currently typedef'd to Vector3.
Definition: Gal3.h:33
fn
static double fn[10]
Definition: fresnl.c:103
gtsam::LieGroup< Gal3, 10 >::ChartJacobian
OptionalJacobian< N, N > ChartJacobian
Definition: Lie.h:40
Matrix.h
typedef and functions to augment Eigen's MatrixXd
gtsam::Gal3::adjointMap
static Matrix10 adjointMap(const Vector10 &xi)
Compute the adjoint map ad(xi) associated with tangent vector xi.
Definition: Gal3.cpp:358
gtsam::Gal3::ChartAtOrigin::Local
static Vector10 Local(const Gal3 &g, ChartJacobian Hg={})
Definition: Gal3.cpp:458
gtsam::Gal3::act
Event act(const Event &e, OptionalJacobian< 4, 10 > Hself={}, OptionalJacobian< 4, 4 > He={}) const
Definition: Gal3.cpp:463
gtsam::Matrix5
Eigen::Matrix< double, 5, 5 > Matrix5
Definition: Gal3.h:37
gtsam::Gal3::operator*
Gal3 operator*(const Gal3 &other) const
Group composition operator.
Definition: Gal3.cpp:220
gtsam::Gal3::r
Vector3 r() const
Return position as Vector3.
Definition: Gal3.h:111
X
#define X
Definition: icosphere.cpp:20
gtsam::Vector3
Eigen::Vector3d Vector3
Definition: Vector.h:44
gtsam::Gal3::Logmap
static Vector10 Logmap(const Gal3 &g, OptionalJacobian< 10, 10 > Hg={})
Logarithmic map at identity: manifold element g -> tangent vector xi.
Definition: Gal3.cpp:273
os
ofstream os("timeSchurFactors.csv")
gtsam::skewSymmetric
Matrix3 skewSymmetric(double wx, double wy, double wz)
Definition: base/Matrix.h:381
result
Values result
Definition: OdometryOptimize.cpp:8
gtsam::Rot3::Expmap
static Rot3 Expmap(const Vector3 &v, OptionalJacobian< 3, 3 > H={})
Definition: Rot3M.cpp:156
gtsam::Vector10
Eigen::Matrix< double, 10, 1 > Vector10
Definition: Gal3.h:35
gtsam::Gal3::Hat
static Matrix5 Hat(const Vector10 &xi)
Hat operator: maps tangent vector xi to Lie algebra matrix.
Definition: Gal3.cpp:419
SO3.h
3*3 matrix representation of SO(3)
gtsam::Gal3::translation
const Point3 & translation(OptionalJacobian< 3, 10 > H={}) const
Access translation component (Point3)
Definition: Gal3.cpp:138
gtsam::Gal3::Expmap
static Gal3 Expmap(const Vector10 &xi, OptionalJacobian< 10, 10 > Hxi={})
Exponential map at identity: tangent vector xi -> manifold element g.
Definition: Gal3.cpp:238
numericalDerivative.h
Some functions to compute numerical derivatives.
expressions.h
Common expressions, both linear and non-linear.
gtsam::Gal3::AdjointMap
Matrix10 AdjointMap() const
Calculate Adjoint map Ad_g.
Definition: Gal3.cpp:312
gtsam::Gal3::t_
double t_
Time component.
Definition: Gal3.h:50
gtsam::Rot3::rotate
Point3 rotate(const Point3 &p, OptionalJacobian< 3, 3 > H1={}, OptionalJacobian< 3, 3 > H2={}) const
Definition: Rot3M.cpp:148
gtsam::Rot3
Rot3 is a 3D rotation represented as a rotation matrix if the preprocessor symbol GTSAM_USE_QUATERNIO...
Definition: Rot3.h:58
gtsam::Pose3
Definition: Pose3.h:37
gtsam::Gal3::ExpmapDerivative
static Matrix10 ExpmapDerivative(const Vector10 &xi)
Derivative of Expmap(xi) w.r.t. xi evaluated at xi.
Definition: Gal3.cpp:392
g2
Pose3 g2(g1.expmap(h *V1_g1))
gtsam::Gal3::v
const Vector3 & v() const
Return velocity as Vector3.
Definition: Gal3.h:114
gtsam::Gal3::v_
Velocity3 v_
Velocity in world frame, n_v_b.
Definition: Gal3.h:49
gtsam::Gal3::matrix
Matrix5 matrix() const
Return 5x5 homogeneous matrix representation.
Definition: Gal3.cpp:168
gtsam::Gal3::velocity
const Velocity3 & velocity(OptionalJacobian< 3, 10 > H={}) const
Access velocity component (Vector3)
Definition: Gal3.cpp:148
gtsam::Gal3::LogmapDerivative
static Matrix10 LogmapDerivative(const Gal3 &g)
Derivative of Logmap(g) w.r.t. g.
Definition: Gal3.cpp:404
Event.h
Space-time event.
gtsam::Gal3
Definition: Gal3.h:45
gtsam::Event
Definition: Event.h:37
gtsam::Rot3::inverse
Rot3 inverse() const
inverse of a rotation
Definition: Rot3.h:312
g
void g(const string &key, int i)
Definition: testBTree.cpp:41
gtsam::Gal3::Gal3
Gal3()
Default constructor: Identity element.
Definition: Gal3.h:61
y
Scalar * y
Definition: level1_cplx_impl.h:124
gtsam::so3::DexpFunctor
Definition: SO3.h:165
E
DiscreteKey E(5, 2)
gtsam::so3::ExpmapFunctor::WW
const Matrix3 WW
Definition: SO3.h:139
gtsam::Gal3::equals
bool equals(const Gal3 &other, double tol=1e-9) const
Check equality within tolerance.
Definition: Gal3.cpp:200
gtsam::so3::DexpFunctor::leftJacobian
Matrix3 leftJacobian() const
Definition: SO3.h:193
gtsam
traits
Definition: ABC.h:17
gtsam::so3::DexpFunctor::C
double C
Definition: SO3.h:169
gtsam::traits
Definition: Group.h:36
gtsam::OptionalJacobian
Definition: OptionalJacobian.h:38
gtsam::numericalDerivative21
internal::FixedSizeMatrix< Y, X1 >::type numericalDerivative21(const std::function< Y(const X1 &, const X2 &)> &h, const X1 &x1, const X2 &x2, double delta=1e-5)
Definition: numericalDerivative.h:166
gtsam::Gal3::rotation
const Rot3 & rotation(OptionalJacobian< 3, 10 > H={}) const
Access rotation component (Rot3)
Definition: Gal3.cpp:129
gtsam::Gal3::Vee
static Vector10 Vee(const Matrix5 &X)
Vee operator: maps Lie algebra matrix to tangent vector xi.
Definition: Gal3.cpp:435
v
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
gtsam::Rot3::matrix
Matrix3 matrix() const
Definition: Rot3M.cpp:222
gtsam::Gal3::Create
static Gal3 Create(const Rot3 &R, const Point3 &r, const Velocity3 &v, double t, OptionalJacobian< 10, 3 > H1={}, OptionalJacobian< 10, 3 > H2={}, OptionalJacobian< 10, 3 > H3={}, OptionalJacobian< 10, 1 > H4={})
Named constructor from components with derivatives.
Definition: Gal3.cpp:63
gtsam::so3::ExpmapFunctor::theta2
const double theta2
Definition: SO3.h:138
gtsam::tol
const G double tol
Definition: Group.h:79
gtsam::Point3
Vector3 Point3
Definition: Point3.h:38
gtsam::Rot3::Logmap
static Vector3 Logmap(const Rot3 &R, OptionalJacobian< 3, 3 > H={})
Definition: Rot3M.cpp:161
Eigen::Matrix
The matrix class, also used for vectors and row-vectors.
Definition: 3rdparty/Eigen/Eigen/src/Core/Matrix.h:178
gtsam::Gal3::inverse
Gal3 inverse() const
Return the inverse of this element.
Definition: Gal3.cpp:210
setZero
v setZero(3)
abs
#define abs(x)
Definition: datatypes.h:17
gtsam::Gal3::r_
Point3 r_
Position in world frame, n_r_b.
Definition: Gal3.h:48
gtsam::Gal3::Adjoint
Vector10 Adjoint(const Vector10 &xi_base, OptionalJacobian< 10, 10 > H_g={}, OptionalJacobian< 10, 10 > H_xi={}) const
Apply this element's AdjointMap Ad_g to a tangent vector xi_base at identity.
Definition: Gal3.cpp:336
M
abc_eqf_lib::State< N > M
Definition: ABC_EQF_Demo.cpp:17
align_3::t
Point2 t(10, 10)
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
gtsam::Rot3::equals
bool equals(const Rot3 &p, double tol=1e-9) const
Definition: Rot3.cpp:100
gtsam::Gal3::ChartAtOrigin::Retract
static Gal3 Retract(const Vector10 &xi, ChartJacobian Hxi={})
Definition: Gal3.cpp:453
gtsam::Gal3::adjoint
static Vector10 adjoint(const Vector10 &xi, const Vector10 &y, OptionalJacobian< 10, 10 > Hxi={}, OptionalJacobian< 10, 10 > Hy={})
The adjoint action ad(xi, y) = adjointMap(xi) * y
Definition: Gal3.cpp:382
pybind_wrapper_test_script.other
other
Definition: pybind_wrapper_test_script.py:42
gtsam::Gal3::R_
Rot3 R_
Rotation world R body.
Definition: Gal3.h:47
R
Rot2 R(Rot2::fromAngle(0.1))
S
DiscreteKey S(1, 2)
gtsam::so3::ExpmapFunctor::W
const Matrix3 W
Definition: SO3.h:139
gtsam::Gal3::t
const double & t() const
Return time scalar.
Definition: Gal3.h:117
make_changelog.state
state
Definition: make_changelog.py:29


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