4#include <Eigen/Geometry>
51 q.
arr_ << 1., 0., 0., 0.;
61 x.
arr_.setConstant(std::numeric_limits<T>::quiet_NaN());
158 if (
d < (
T)0.99999999 &&
d > (
T)-0.99999999)
165 else if (
d < (
T)-0.99999999)
254 inline const T&
w()
const
262 inline const T&
x()
const
270 inline const T&
y()
const
278 inline const T&
z()
const
363 if (
arr_(0) < (
T)0.0)
392 out << 1. - 2. *
yy - 2. *
zz, 2. *
xy - 2. *
wz, 2. *
xz + 2. *
wy, 2. *
xy + 2. *
wz, 1. - 2. *
xx - 2. *
zz,
393 2. *
yz - 2. *
wx, 2. *
xz - 2. *
wy, 2. *
yz + 2. *
wx, 1. - 2. *
xx - 2. *
yy;
424 return atan2(
T(2.0) * (
w() *
x() +
y() *
z()),
T(1.0) -
T(2.0) * (
x() *
x() +
y() *
y()));
432 const T val =
T(2.0) * (
w() *
y() -
x() *
z());
446 return atan2(
T(2.0) * (
w() *
z() +
x() *
y()),
T(1.0) -
T(2.0) * (
y() *
y() +
z() *
z()));
467 qL <<
w(), -
x(), -
y(), -
z(),
x(),
w(), -
z(),
y(),
y(),
z(),
w(), -
x(),
z(), -
y(),
x(),
w();
475 template<
typename Tout = T,
typename T2>
480 w() * q.
x() +
x() * q.
w() +
y() * q.
z() -
z() * q.
y(),
481 w() * q.
y() -
x() * q.
z() +
y() * q.
w() +
z() * q.
x(),
482 w() * q.
z() +
x() * q.
y() -
y() * q.
x() +
z() * q.
w();
490 template<
typename Tout = T,
typename T2>
500 template<
typename Tout = T,
typename T2>
523 template<
typename T2>
532 template<
typename T2>
580 template<
typename Tout = T,
typename T2>
585 return v -
w() * t + t.cross(
qv);
595 Vec3T t = (
T)2.0 *
v.cross(
qv);
596 return v -
w() * t + t.cross(
qv);
619 template<
typename T2>
705 template<
typename T2>
748 os <<
"SO(3): [ " << q.
w() <<
", " << q.
x() <<
"i, " << q.
y() <<
"j, " << q.
z() <<
"k ]";
SO3< T > operator*(const double &l, const SO3< T > &r)
Scale a rotation by a scalar.
Definition SO3.h:721
std::ostream & operator<<(std::ostream &os, const SO3< T > &q)
Render the rotation in a stream.
Definition SO3.h:746
SO3< double > SO3d
Definition SO3.h:752
Class representing a member of the manifold, or a 3D rotation.
Definition SO3.h:15
static SO3 Exp(const Vec3T &omega)
Exponential chart map implementation: .
Definition SO3.h:681
static Vec3T vee(const Mat3T &Omega)
Vee operator implementation, which coverts the Lie algebra representation to a tangent-space vector r...
Definition SO3.h:640
T pitch() const
Obtain the pitch component of the yaw-pitch-roll successive-axes Euler angle representation.
Definition SO3.h:430
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Map< Vec4T > arr_
Memory-mapped array representing all rotation fields in .
Definition SO3.h:29
static SO3 nans()
Obtain a rotation full of NaNs.
Definition SO3.h:58
static Mat3T hat(const Vec3T &omega)
Hat operator implementation, which coverts the tangent-space vector representation to the correspondi...
Definition SO3.h:629
T & z()
Access the third imaginary element of the rotation.
Definition SO3.h:310
static SO3 fromQuat(const T qw, const T qx, const T qy, const T qz)
Construct a rotation from the individual fields.
Definition SO3.h:187
static SO3 fromR(const Mat3T &m)
Convert a rotation matrix to a rotation.
Definition SO3.h:94
SO3()
Create a rotation (with garbage data).
Definition SO3.h:219
Matrix< Tout, 3, 1 > operator*(const Matrix< T2, 3, 1 > &v) const
Transform a vector via multiplication: .
Definition SO3.h:581
const Vec4T elements() const
Access all elements of .
Definition SO3.h:318
SO3 & operator+=(const Vec3T &v)
Invocation of oplus via addition.
Definition SO3.h:610
T & operator[](int i)
Access a field from .
Definition SO3.h:246
SO3 & operator/=(const double &s)
Scale a rotation by a scalar.
Definition SO3.h:557
const T & w() const
Access the real element of the rotation.
Definition SO3.h:254
T yaw() const
Obtain the yaw component of the yaw-pitch-roll successive-axes Euler angle representation.
Definition SO3.h:444
SO3 operator/(const double &s) const
Scale a rotation by a scalar.
Definition SO3.h:569
Vec4T array() const
Access all elements of .
Definition SO3.h:326
T roll() const
Obtain the roll component of the yaw-pitch-roll successive-axes Euler angle representation.
Definition SO3.h:422
Vec3T toEuler() const
Obtain the Euler angle representation as a 3-vector.
Definition SO3.h:452
static SO3 random()
Obtain a random rotation.
Definition SO3.h:37
static SO3 exp(const Mat3T &Omega)
Exponential chart map implementation: .
Definition SO3.h:673
const T & y() const
Access the second imaginary element of the rotation.
Definition SO3.h:270
static SO3 identity()
Obtain an identity rotation.
Definition SO3.h:48
T & y()
Access the second imaginary element of the rotation.
Definition SO3.h:302
Mat3T R() const
Convert the rotation to matrix representation .
Definition SO3.h:380
void normalize()
Normalize the elements of to make it a valid rotation.
Definition SO3.h:360
SO3(const Ref< const Vec4T > &arr)
Create a transform from an array representing all rotation fields in .
Definition SO3.h:224
SO3 & operator*=(const SO3< T2 > &q)
Invocation of otimes via multiplication.
Definition SO3.h:533
SO3< T2 > cast() const
Cast the underlying numeric type.
Definition SO3.h:706
static Mat3T log(const SO3 &q)
Logarithmic chart map implementation: .
Definition SO3.h:650
SO3 & operator*=(const double &s)
Scale a rotation by a scalar.
Definition SO3.h:545
SO3 normalized()
Obtain a normalized copy of the current rotation.
Definition SO3.h:370
SO3 & operator=(const SO3 &q)
Copy constructor.
Definition SO3.h:514
SO3< Tout > otimes(const SO3< T2 > &q) const
Implementation of group composition: .
Definition SO3.h:476
SO3 operator*(const SO3< T2 > &q) const
Invocation of otimes via multiplication.
Definition SO3.h:524
const T & x() const
Access the first imaginary element of the rotation.
Definition SO3.h:262
SO3(const T *data)
Create a rotation from a pointer array representing all rotation fields in .
Definition SO3.h:241
static SO3 fromQuat(const Quaternion< T > quat)
Construct a rotation from an Eigen quaternion.
Definition SO3.h:209
T * data()
Access pointer to all elements of .
Definition SO3.h:334
Matrix< Tout, 3, 1 > ominus(const SO3< T2 > &q) const
Implementation of group subtraction: .
Definition SO3.h:501
static SO3 fromTwoUnitVectors(const Vec3T &u, const Vec3T &v)
Given two unit vectors , returns the rotation that rotates .
Definition SO3.h:153
T & x()
Access the first imaginary element of the rotation.
Definition SO3.h:294
SO3< Tout > oplus(const Matrix< T2, 3, 1 > &delta) const
Implementation of tangent space group perturbations: .
Definition SO3.h:491
static SO3 fromAxisAngle(const Vec3T &axis, const T angle)
Convert an angle (in radians) with accompanying axis (defined by a vector) into a rotation.
Definition SO3.h:68
SO3 inverse() const
Obtain the inverse rotation .
Definition SO3.h:400
T & w()
Access the real element of the rotation.
Definition SO3.h:286
static SO3 fromEuler(const T roll, const T pitch, const T yaw)
Construct a rotation from yaw-pitch-roll successive-axes Euler angles.
Definition SO3.h:81
Mat4T qMatLeft() const
Obtain an equivalent 4-by-4 matrix representation of such that .
Definition SO3.h:464
SO3 & invert()
Invert the current rotation .
Definition SO3.h:413
const T * data() const
Access pointer to all elements of .
Definition SO3.h:342
SO3 operator+(const Vec3T &v) const
Invocation of oplus via addition.
Definition SO3.h:602
Vec3T operator-(const SO3< T2 > &q) const
Invocation of ominus via subtraction.
Definition SO3.h:620
SO3(const SO3 &q)
Copy constructor from another rotation.
Definition SO3.h:232
SO3 copy() const
Get a deep copy of the current rotation.
Definition SO3.h:350
const T & z() const
Access the third imaginary element of the rotation.
Definition SO3.h:278
static SO3 fromQuat(const Vec4T &qvec)
Construct a rotation from a rotation fields vector.
Definition SO3.h:198
static Vec3T Log(const SO3 &q)
Logarithmic chart map implementation: .
Definition SO3.h:658
Vec3T operator*(const Vec3T &v) const
Transform a vector via multiplication: .
Definition SO3.h:592