GSLAM
3.0.0
|
3D rotation represented by the quaternion. More...
Public Member Functions | |
SO3_ () | |
Default constructor, Idendity Matrix. | |
SO3_ (const Precision &X, const Precision &Y, const Precision &Z, const Precision &W) | |
Construct from Quaternion. | |
SO3_ (const Point3_< Precision > &direction, Precision angle) | |
Construct from a direction and angle in radius. | |
SO3_ (const Precision *M) | |
Construct from a rotation matrix data (ColMajor). | |
SO3_ (const Matrix< Precision, 3, 3 > &M) | |
Construct from a rotation matrix. | |
template<typename Scalar > | |
SO3_ (const SO3_< Scalar > &r) | |
Construct from another precision. | |
Point3_< Precision > | log () const |
void | fromMatrix (const Precision *m) |
This is an unsafe operation. Please make sure that your pointer is both valid and has an appropriate size Wrong usage: Precision* p; getMatrix(p);. More... | |
Matrix< Precision, 3, 3 > | getMatrix () const |
void | getMatrix (Precision *m) const |
return the matrix M | |
Precision | getRoll () const |
Precision | getPitch () const |
Precision | getYaw () const |
SO3_ | operator* (const SO3_ &rq) const |
Point3_< Precision > | operator* (const Point3_< Precision > &p) const |
bool | operator== (const SO3_ &rq) const |
void | normalise () |
SO3_ | inverse () const |
void | getValue (Precision &X, Precision &Y, Precision &Z, Precision &W) const |
operator std::string () const | |
Precision | getX () const |
Precision | getY () const |
Precision | getZ () const |
Precision | getW () const |
void | setX (Precision X) |
void | setY (Precision Y) |
void | setZ (Precision Z) |
void | setW (Precision W) |
SO3_ | mul (const SO3_ &rq) const |
Point3_< Precision > | trans (const Point3_< Precision > &p) const |
std::string | toString () const |
Static Public Member Functions | |
template<typename Scalar > | |
static SO3_< Precision > | exp (const Point3_< Scalar > &r) |
Construct from lie algebra representation. | |
template<typename T > | |
static T | sine (T x) |
template<typename T > | |
static T | cosine (T x) |
template<typename Scalar > | |
static SO3_< Scalar > | expFast (const Point3_< Scalar > &l) |
static SO3_ | fromPitchYawRollAngle (const Precision &pitch, const Precision &yaw, const Precision &roll) |
static SO3_ | fromPitchYawRoll (const Point3d &pyr) |
static SO3_ | fromPitchYawRoll (const Precision &pitch, const Precision &yaw, const Precision &roll) |
Convert from Euler Angles, Please use "Radian" rather than degree to present angle. | |
static SO3_ | FromAxis (const Point3_< Precision > &p, Precision angle) |
Public Attributes | |
Precision | x |
Precision | y |
Precision | z |
Precision | w |
3D rotation represented by the quaternion.
For the rotational component, there are several choices for representation, including the matrix, Euler angle, unit quaternion and Lie algebra \(so(3)\). For a given transformation, we can use any of these for representation and can convert one to another.:
This implementation use Quaternion for computation. Class SO3 use 4 paraments to present a 3 dimesion rotation matrix, since 3D rotation matrices are members of the Special Orthogonal Lie group SO3.
Every rotation in the 3D euclidean space can be represented by a rotation with one direction. Consider a rotation with direction \((a,b,c)^T\) and angle theta in radians.
this ensures that \(x^2+y^2+z^2+w^2=1\). A quaternion \(q(x,y,z,w)\) is used to present a 3d rotation.
Users can construct a SO3 from different data structure:
The following testing codes demonstrated the basic usages of SO3:
Point3_<Precision> log | ( | ) | const |
Referenced by SO3_< Precision >::fromPitchYawRoll().
void fromMatrix | ( | const Precision * | m | ) |
This is an unsafe operation. Please make sure that your pointer is both valid and has an appropriate size Wrong usage: Precision* p; getMatrix(p);.
Correct: Precision p[9]; getMatrix(p);
M is curved as follow |m0 m1 m2| |m3 m4 m5| |m6 m7 m8|
Referenced by SO3_< Precision >::getMatrix(), and SO3_< Precision >::SO3_().