Go to the documentation of this file.
26 #define QUATERNION_TYPE Eigen::Quaternion<_Scalar,_Options>
31 template<
typename _Scalar,
int _Options>
48 inline constexpr
static auto dimension = 3;
57 if (Hg) *Hg =
h.toRotationMatrix().transpose();
64 Q d =
g.inverse() *
h;
65 if (Hg) *Hg = -
d.toRotationMatrix().transpose();
72 if (
H) *
H = -
g.toRotationMatrix();
85 _Scalar ha = _Scalar(0.5) * theta;
87 return Q(
cos(ha), vec.x(), vec.y(), vec.z());
91 return Q(1.0, vec.x(), vec.y(), vec.z());
101 static const double twoPi = 2.0 *
M_PI, NearlyOne = 1.0 - 1
e-10,
102 NearlyNegativeOne = -1.0 + 1
e-10;
106 const _Scalar qw =
q.w();
108 if (qw > NearlyOne) {
111 omega = ( 8. / 3. - 2. / 3. * qw) *
q.vec();
112 }
else if (qw < NearlyNegativeOne) {
115 omega = (-8. / 3. - 2. / 3. * qw) *
q.vec();
119 _Scalar angle = 2 *
acos(qw),
s =
sqrt(1 - qw * qw);
123 else if (angle < -
M_PI)
128 _Scalar angle = 2 *
acos(-qw),
s =
sqrt(1 - qw * qw);
131 else if (angle < -
M_PI)
133 omega = (angle /
s) * -
q.vec();
149 TangentVector
v = Logmap(
b, (H1 || H2) ? &D_v_b : 0);
150 if (H1) *H1 = D_v_b * (*H1);
151 if (H2) *H2 = D_v_b * (*H2);
159 Q h = Compose(
g,
b, H1, H2);
160 if (H2) *H2 = (*H2) * D_h_v;
169 std::cout <<
"Eigen::Quaternion: ";
171 std::cout <<
str <<
" ";
172 std::cout <<
q.vec().transpose() << std::endl;
175 return Between(q1, q2).vec().array().abs().maxCoeff() <
tol;
multiplicative_group_tag group_flavor
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
Eigen::Quaternion< double, Eigen::DontAlign > Quaternion
Array< double, 1, 3 > e(1./3., 0.5, 2.)
static const double d[K][N]
Jet< T, N > sin(const Jet< T, N > &f)
static MatrixDD ExpmapDerivative(const TangentVector &omega)
Derivative of Expmap, currently only defined for SO3.
QUATERNION_TYPE ManifoldType
Jet< T, N > acos(const Jet< T, N > &f)
static void Print(const Q &q, const std::string &str="")
Jet< T, N > cos(const Jet< T, N > &f)
static MatrixDD LogmapDerivative(const TangentVector &omega)
Derivative of Logmap, currently only defined for SO3.
Group operator syntax flavors.
3*3 matrix representation of SO(3)
Eigen::Matrix< _Scalar, 3, 1, _Options, 3, 1 > TangentVector
Pose2_ Expmap(const Vector3_ &xi)
static Q Expmap(const Eigen::Ref< const TangentVector > &omega, ChartJacobian H={})
Exponential map, using the inlined code from Eigen's conversion from axis/angle.
EIGEN_DEVICE_FUNC const Scalar & q
static TangentVector Local(const Q &g, const Q &h, ChartJacobian H1={}, ChartJacobian H2={})
static Q Inverse(const Q &g, ChartJacobian H={})
static Q Compose(const Q &g, const Q &h, ChartJacobian Hg={}, ChartJacobian Hh={})
void g(const string &key, int i)
static bool Equals(const Q &q1, const Q &q2, double tol=1e-8)
BetweenFactor< Rot3 > Between
The quaternion class used to represent 3D orientations and rotations.
Base class and basic functions for Lie types.
A matrix or vector expression mapping an existing expression.
tag to assert a type is a Lie group
Array< int, Dynamic, 1 > v
lie_group_tag structure_category
The matrix class, also used for vectors and row-vectors.
OptionalJacobian< 3, 3 > ChartJacobian
static Q Retract(const Q &g, const TangentVector &v, ChartJacobian H1={}, ChartJacobian H2={})
static Q Between(const Q &g, const Q &h, ChartJacobian Hg={}, ChartJacobian Hh={})
Jet< T, N > sqrt(const Jet< T, N > &f)
static TangentVector Logmap(const Q &q, ChartJacobian H={})
We use our own Logmap, as there is a slight bug in Eigen.
gtsam
Author(s):
autogenerated on Thu Dec 19 2024 04:02:45