GSLAM  3.0.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Related Functions | List of all members
SE3_< Precision > Class Template Reference

Represent a three-dimensional Euclidean transformation (a rotation and a translation). More...

Public Types

typedef Point3_< Precision > Vec3
 

Public Member Functions

 SE3_ (const Precision &x, const Precision &y, const Precision &z, const Precision &wx, const Precision &wy, const Precision &wz, const Precision &w)
 
 SE3_ (const SO3_< Precision > &r, const Vec3 &t)
 
template<typename Scalar >
 operator SE3_< Scalar > ()
 
SO3_< Precision > & get_rotation ()
 Returns the rotation part of the transformation as a SO3.
 
const SO3_< Precision > & get_rotation () const
 
Vec3get_translation ()
 Returns the translation part of the transformation as a Vector.
 
const Vec3get_translation () const
 
SE3_ inverse () const
 
template<typename P >
SE3_operator*= (const SE3_< P > &rhs)
 Right-multiply by another SE3 (concatenate the two transformations) More...
 
template<typename P >
SE3_ operator* (const SE3_< P > &rhs) const
 
template<typename P >
bool operator< (const SE3_< P > &rhs) const
 
void fromMatrix (const Precision *m)
 R is described as follow, M is a 4*4 Homography matrix |r0 r1 r2| |r3 r4 r5| |r6 r7 r8|.
 
void getMatrix (Precision *m) const
 
Vector< Precision, 6 > log () const
 
Vector< Precision, 6 > ln () const
 
SO3_< Precision > getRotation () const
 
Point3_< Precision > getTranslation () const
 
void setRotation (SO3_< Precision > R)
 
void setTranslation (Point3_< Precision > t)
 
SE3_ mul (const SE3_ &rq) const
 
Point3_< Precision > trans (const Point3_< Precision > &p) const
 
std::string toString () const
 

Static Public Member Functions

template<typename Scalar >
static SE3_< Scalar > exp (const Vector< Scalar, 6 > &l)
 
template<typename Scalar >
static SE3_< Scalar > expFast (const Vector< Scalar, 6 > &l)
 

Protected Attributes

SO3_< Precision > my_rotation
 
Vec3 my_translation
 

Related Functions

(Note that these are not member functions.)

Vec3 operator* (const SE3_< Precision > &lhs, const Vec3 &rhs)
 Right-multiply by a Vector. More...
 
std::ostream & operator<< (std::ostream &os, const SE3_ &rhs)
 Write an SE3 to a stream. More...
 
std::istream & operator>> (std::istream &is, SE3_ &rhs)
 Write an SE3 from a stream. More...
 

Detailed Description

template<class Precision = double>
class GSLAM::SE3_< Precision >

Represent a three-dimensional Euclidean transformation (a rotation and a translation).

| r00 r01 r02 t0 | M = | R T |= | r10 r11 r12 t1 | = | Rx Ry Rz T | | 0 1 | | r20 r21 r22 t2 | | 0 0 0 1 | | 0 0 0 1 | Here R=(Rx,Ry,Rz) is the rotation , T=(x,y,z)^T is the translation.

For the matrix M (only if the matrix means a camera to world transform): Rx means the direction of X axis; Ry means the direction of Y axis; Rz means the direction of Z axis; T means the translation of this coordinate.

The coordinates of point P=(X,Y,Z)^T in this coordinate can be computed by left-multiply the matrix M:

SE3<double> C2W; // Camera to world SE3
Point3d P_cam(1,2,3); // Coordinates in the camera coordinate
cout<<"Coordinates in the world coordinate:"<<C2W*P_cam<<endl;
SE3<double> W2C=C2W.inv(); // It also can present a world to camera transform
Point3d P_w(4,5,6); // A point in the world
cout<<"The coodinates in the camera is "<<W2C*P_w;

It should be noticed that when a SE3 is representing the world-to-camera transform, the function get_translation() does not acqually return the translation.

Member Function Documentation

const SO3_<Precision>& get_rotation ( ) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

const Vec3& get_translation ( ) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

SE3_& operator*= ( const SE3_< P > &  rhs)

Right-multiply by another SE3 (concatenate the two transformations)

Parameters
rhsThe multipier

References SE3_< Precision >::get_rotation(), and SE3_< Precision >::get_translation().

Friends And Related Function Documentation

Vec3 operator* ( const SE3_< Precision > &  lhs,
const Vec3 rhs 
)
friend

Right-multiply by a Vector.

std::ostream& operator<< ( std::ostream &  os,
const SE3_< Precision > &  rhs 
)
friend

Write an SE3 to a stream.

std::istream& operator>> ( std::istream &  is,
SE3_< Precision > &  rhs 
)
friend

Write an SE3 from a stream.