38 H << I_3x3 *
R(0, 0), I_3x3 *
R(1, 0), I_3x3 *
R(2, 0),
39 I_3x3 *
R(0, 1), I_3x3 *
R(1, 1), I_3x3 *
R(2, 1),
40 I_3x3 *
R(0, 2), I_3x3 *
R(1, 2), I_3x3 *
R(2, 2);
45 Matrix3 MR = M * R.
matrix();
62 const double wx = omega.x(), wy = omega.y(), wz = omega.z();
63 W << 0.0, -wz, +wy, +wz, 0.0, -wx, -wy, +wx, 0.0;
74 const double ax = axis.x(), ay = axis.y(), az = axis.z();
75 K << 0.0, -az, +ay, +az, 0.0, -ax, -ay, +ax, 0.0;
85 return SO3(I_3x3 +
W);
111 *H1 = (Db *
K - Da * I_3x3) * Kv *
omega.transpose() -
122 const Matrix3 invDexp =
dexp_.inverse();
125 Matrix3 D_dexpv_omega;
127 *H1 = -invDexp * D_dexpv_omega;
129 if (H2) *H2 = invDexp;
150 return SO3(
U *
Vector3(1, 1, det).asDiagonal() *
V.transpose());
161 for (
const auto& R_i : rotations) {
164 return ClosestTo(C_e);
176 return Y - Y.transpose();
233 double theta2 = omega.dot(omega);
238 const Matrix3
W = Hat(omega);
239 return I_3x3 + 0.5 * W +
240 (1 / (theta *
theta) - (1 +
cos(theta)) / (2 * theta *
sin(theta))) *
253 const double &R11 =
R(0, 0),
R12 =
R(0, 1), R13 =
R(0, 2);
254 const double &R21 =
R(1, 0), R22 =
R(1, 1), R23 =
R(1, 2);
255 const double &R31 =
R(2, 0), R32 =
R(2, 1), R33 =
R(2, 2);
258 const double tr = R.trace();
264 if (tr + 1.0 < 1
e-10) {
274 const double tr_3 = tr - 3.0;
276 double theta =
acos((tr - 1.0) / 2.0);
277 magnitude = theta / (2.0 *
sin(theta));
281 magnitude = 0.5 - tr_3 * tr_3 / 12.0;
283 omega = magnitude *
Vector3(R32 - R23, R13 - R31, R21 -
R12);
286 if (H) *H = LogmapDerivative(omega);
295 SO3 SO3::ChartAtOrigin::Retract(
const Vector3& omega, ChartJacobian H) {
301 Vector3 SO3::ChartAtOrigin::Local(
const SO3&
R, ChartJacobian H) {
307 static Vector9
vec3(
const Matrix3& R) {
312 static std::vector<Matrix3>
G3({
SO3::Hat(Vector3::Unit(0)),
324 const Matrix3& R = matrix_;
327 *H << R * P3.block<3, 3>(0, 0), R * P3.block<3, 3>(3, 0),
328 R * P3.block<3, 3>(6, 0);
static MatrixNN Hat(const TangentVector &xi)
static SO ChordalMean(const std::vector< SO > &rotations)
Matrix< RealScalar, Dynamic, Dynamic > M
VectorN2 vec(OptionalJacobian< internal::NSquaredSO(N), dimension > H=boost::none) const
static SO AxisAngle(const Vector3 &axis, double theta)
Constructor from axis and angle. Only defined for SO3.
double dot(const V1 &a, const V2 &b)
static MatrixDD ExpmapDerivative(const TangentVector &omega)
Derivative of Expmap, currently only defined for SO3.
A matrix or vector expression mapping an existing array of data.
void determinant(const MatrixType &m)
ExpmapFunctor(const Vector3 &omega, bool nearZeroApprox=false)
Constructor with element of Lie algebra so(3)
static MatrixDD LogmapDerivative(const TangentVector &omega)
Derivative of Logmap, currently only defined for SO3.
Rot2 R(Rot2::fromAngle(0.1))
EIGEN_DEVICE_FUNC const SqrtReturnType sqrt() const
Pose2_ Expmap(const Vector3_ &xi)
const MatrixNN & matrix() const
Return matrix.
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
GTSAM_EXPORT DexpFunctor(const Vector3 &omega, bool nearZeroApprox=false)
Constructor with element of Lie algebra so(3)
3*3 matrix representation of SO(3)
Functor implementing Exponential map.
EIGEN_DEVICE_FUNC const CosReturnType cos() const
MatrixDD AdjointMap() const
Adjoint map.
void init(bool nearZeroApprox=false)
GTSAM_EXPORT Matrix99 Dcompose(const SO3 &Q)
(constant) Jacobian of compose wrpt M
SO3 expmap() const
Rodrigues formula.
Eigen::Matrix< double, 9, 3 > Matrix93
GTSAM_EXPORT Vector3 applyDexp(const Vector3 &v, OptionalJacobian< 3, 3 > H1=boost::none, OptionalJacobian< 3, 3 > H2=boost::none) const
Multiplies with dexp(), with optional derivatives.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
const MatrixVType & matrixV() const
const MatrixUType & matrixU() const
const Matrix3 & dexp() const
static SO Expmap(const TangentVector &omega, ChartJacobian H=boost::none)
EIGEN_DEVICE_FUNC const AcosReturnType acos() const
Matrix3 skewSymmetric(double wx, double wy, double wz)
Functor that implements Exponential map and its derivatives.
static std::vector< Matrix3 > G3({SO3::Hat(Vector3::Unit(0)), SO3::Hat(Vector3::Unit(1)), SO3::Hat(Vector3::Unit(2))})
The quaternion class used to represent 3D orientations and rotations.
void svd(const Matrix &A, Matrix &U, Vector &S, Matrix &V)
GTSAM_EXPORT Vector3 applyInvDexp(const Vector3 &v, OptionalJacobian< 3, 3 > H1=boost::none, OptionalJacobian< 3, 3 > H2=boost::none) const
Multiplies with dexp().inverse(), with optional derivatives.
Two-sided Jacobi SVD decomposition of a rectangular matrix.
static TangentVector Logmap(const SO &R, ChartJacobian H=boost::none)
static Vector9 vec3(const Matrix3 &R)
EIGEN_DEVICE_FUNC const SinReturnType sin() const
static SO ClosestTo(const MatrixNN &M)
static TangentVector Vee(const MatrixNN &X)
Inverse of Hat. See note about xi element order in Hat.
GTSAM_EXPORT Matrix3 compose(const Matrix3 &M, const SO3 &R, OptionalJacobian< 9, 9 > H)