Go to the documentation of this file.
42 constexpr
double kSmallAngleThreshold = 1
e-10;
68 H1->block<3, 3>(6, 0) = Matrix3::Identity();
72 H2->block<3, 3>(0, 0) =
R.transpose();
76 H3->block<3, 3>(3, 0) =
R.transpose();
81 H4->block<3, 1>(0, 0) = drho_dt;
95 H1->block<3, 3>(6, 0) = Matrix3::Identity();
96 H1->block<3, 3>(0, 3) = Matrix3::Identity();
100 H2->block<3, 3>(3, 0) =
R.transpose();
105 H3->block<3, 1>(0, 0) = drho_dt;
117 M.row(4).head(4).norm() > 1
e-9 ||
M.row(3).head(3).norm() > 1
e-9) {
118 throw std::invalid_argument(
"Invalid Gal3 matrix structure: Check zero blocks and diagonal ones.");
120 R_ =
Rot3(
M.block<3, 3>(0, 0));
121 v_ =
M.block<3, 1>(0, 3);
132 H->block<3, 3>(0, 6) = Matrix3::Identity();
142 H->block<3,1>(0, 9) =
v_;
172 M.block<3, 1>(0, 3) =
v_;
184 os <<
"R: " <<
state.R_ <<
"\n";
185 os <<
"r: " <<
state.r_.transpose() <<
"\n";
186 os <<
"v: " <<
state.v_.transpose() <<
"\n";
195 std::cout << (
s.empty() ?
"" :
s +
" ");
196 std::cout << *
this << std::endl;
215 const double t_inv = -
t_;
216 return Gal3(Rinv, r_inv, v_inv, t_inv);
225 const Rot3 R_comp =
g1.R_.compose(
g2.R_);
228 const Vector3 r_comp_vec =
g1.R_.rotate(r2_vec) +
g2.t_ *
g1.v_ + r1_vec;
230 const double t_comp =
g1.t_ +
g2.t_;
232 return Gal3(R_comp,
Point3(r_comp_vec), v_comp, t_comp);
243 const double t_tan_val = t_tan(
xi)(0);
252 E = 0.5 * Matrix3::Identity() + (1.0 / 6.0) * dexp_functor.
W + (1.0 / 24.0) * dexp_functor.
WW;
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;
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;
282 E = 0.5 * Matrix3::Identity() + (1.0 / 6.0) * dexp_functor_log.
W + (1.0 / 24.0) * dexp_functor_log.
WW;
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;
291 const double& t_val =
g.t_;
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;
301 theta(
xi) = theta_vec;
302 t_tan(
xi)(0) = t_tan_val;
320 Ad.block<3,3>(0,0) = Rmat;
321 Ad.block<3,3>(0,3) = -
t_ * Rmat;
323 Ad.block<3,1>(0,9) = v_vec;
325 Ad.block<3,3>(3,3) = Rmat;
328 Ad.block<3,3>(6,6) = Rmat;
363 const double t_val = t_tan(
xi)(0);
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;
373 ad.block<3,3>(3,3) = Theta_hat;
374 ad.block<3,3>(3,6) = Nu_hat;
376 ad.block<3,3>(6,6) = Theta_hat;
397 if (
xi.norm() < kSmallAngleThreshold)
return Matrix10::Identity();
400 return numericalDerivative11<Gal3, Vector10>(
fn,
xi, 1
e-5);
410 if (
xi.norm() < kSmallAngleThreshold)
return Matrix10::Identity();
413 return numericalDerivative11<Vector10, Gal3>(
fn,
g, 1
e-5);
424 const double t_tan_val = t_tan(
xi)(0);
428 X.block<3, 1>(0, 3) = nu_tan;
429 X.block<3, 1>(0, 4) = rho_tan;
437 if (
X.row(4).norm() > 1
e-9 ||
X.row(3).head(3).norm() > 1
e-9 ||
std::abs(
X(3,3)) > 1
e-9) {
438 throw std::invalid_argument(
"Matrix is not in sgal(3)");
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);
466 const double& t_in =
e.time();
467 const Point3& p_in =
e.location();
469 const double t_out = t_in +
t_;
475 He->block<3, 1>(1, 0) =
v_;
476 He->block<3, 3>(1, 1) =
R_.
matrix();
483 (*Hself)(0, 9) = 1.0;
484 Hself->block<3, 3>(1, 0) = Rmat;
485 Hself->block<3, 3>(1, 3) = Rmat * t_in;
487 Hself->block<3, 1>(1, 9) =
v_;
490 return Event(t_out, p_out);
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
3D Galilean Group SGal(3) state (attitude, position, velocity, time)
const double & time(OptionalJacobian< 1, 10 > H={}) const
Access time component (double)
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.
static const Pose3 pose(Rot3(Vector3(1, -1, -1).asDiagonal()), Point3(0, 0, 0.5))
Expression of a fixed-size or dynamic-size block.
Matrix3 R() const
Return rotation matrix (Matrix3)
Concept-checking macros for geometric objects Each macro instantiates a concept check structure,...
void print(const std::string &s="") const
Print with optional string prefix.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
std::ostream & operator<<(std::ostream &os, const Dih6 &m)
Pose3 g1(Rot3(), Point3(100.0, 0.0, 300.0))
Vector3 Velocity3
Velocity is currently typedef'd to Vector3.
OptionalJacobian< N, N > ChartJacobian
typedef and functions to augment Eigen's MatrixXd
static Matrix10 adjointMap(const Vector10 &xi)
Compute the adjoint map ad(xi) associated with tangent vector xi.
static Vector10 Local(const Gal3 &g, ChartJacobian Hg={})
Event act(const Event &e, OptionalJacobian< 4, 10 > Hself={}, OptionalJacobian< 4, 4 > He={}) const
Eigen::Matrix< double, 5, 5 > Matrix5
Gal3 operator*(const Gal3 &other) const
Group composition operator.
Vector3 r() const
Return position as Vector3.
static Vector10 Logmap(const Gal3 &g, OptionalJacobian< 10, 10 > Hg={})
Logarithmic map at identity: manifold element g -> tangent vector xi.
ofstream os("timeSchurFactors.csv")
Matrix3 skewSymmetric(double wx, double wy, double wz)
static Rot3 Expmap(const Vector3 &v, OptionalJacobian< 3, 3 > H={})
Eigen::Matrix< double, 10, 1 > Vector10
static Matrix5 Hat(const Vector10 &xi)
Hat operator: maps tangent vector xi to Lie algebra matrix.
3*3 matrix representation of SO(3)
const Point3 & translation(OptionalJacobian< 3, 10 > H={}) const
Access translation component (Point3)
static Gal3 Expmap(const Vector10 &xi, OptionalJacobian< 10, 10 > Hxi={})
Exponential map at identity: tangent vector xi -> manifold element g.
Some functions to compute numerical derivatives.
Common expressions, both linear and non-linear.
Matrix10 AdjointMap() const
Calculate Adjoint map Ad_g.
Point3 rotate(const Point3 &p, OptionalJacobian< 3, 3 > H1={}, OptionalJacobian< 3, 3 > H2={}) const
Rot3 is a 3D rotation represented as a rotation matrix if the preprocessor symbol GTSAM_USE_QUATERNIO...
static Matrix10 ExpmapDerivative(const Vector10 &xi)
Derivative of Expmap(xi) w.r.t. xi evaluated at xi.
Pose3 g2(g1.expmap(h *V1_g1))
const Vector3 & v() const
Return velocity as Vector3.
Velocity3 v_
Velocity in world frame, n_v_b.
Matrix5 matrix() const
Return 5x5 homogeneous matrix representation.
const Velocity3 & velocity(OptionalJacobian< 3, 10 > H={}) const
Access velocity component (Vector3)
static Matrix10 LogmapDerivative(const Gal3 &g)
Derivative of Logmap(g) w.r.t. g.
Rot3 inverse() const
inverse of a rotation
void g(const string &key, int i)
Gal3()
Default constructor: Identity element.
bool equals(const Gal3 &other, double tol=1e-9) const
Check equality within tolerance.
Matrix3 leftJacobian() const
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)
const Rot3 & rotation(OptionalJacobian< 3, 10 > H={}) const
Access rotation component (Rot3)
static Vector10 Vee(const Matrix5 &X)
Vee operator: maps Lie algebra matrix to tangent vector xi.
Array< int, Dynamic, 1 > v
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.
static Vector3 Logmap(const Rot3 &R, OptionalJacobian< 3, 3 > H={})
The matrix class, also used for vectors and row-vectors.
Gal3 inverse() const
Return the inverse of this element.
Point3 r_
Position in world frame, n_r_b.
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.
abc_eqf_lib::State< N > M
Matrix3 leftJacobianInverse() const
For |omega|>pi uses leftJacobian().inverse(), as unstable beyond pi!
bool equals(const Rot3 &p, double tol=1e-9) const
static Gal3 Retract(const Vector10 &xi, ChartJacobian Hxi={})
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
Rot3 R_
Rotation world R body.
Rot2 R(Rot2::fromAngle(0.1))
const double & t() const
Return time scalar.
gtsam
Author(s):
autogenerated on Wed May 28 2025 03:01:18