eXperiment robotics framework

Frame Class Reference
[Frame]

A position and orientation in the world. More...

#include <erf/erf_frame.hpp>>

Collaboration diagram for Frame:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Frame ()
virtual ~Frame ()
 Frame (const Frame &frame)
Frameoperator= (const Frame &frame)
World coordinates position and orientation
 Frame (const Vec3 &position, const Quaternion &orientation)
void setPosition (const Vec3 &position)
void setPosition (float x, float y, float z)
void setPositionWithConstraint (Vec3 &position)
void setOrientation (const Quaternion &orientation)
void setOrientation (float q0, float q1, float q2, float q3)
void setOrientationWithConstraint (Quaternion &orientation)
void setPositionAndOrientation (const Vec3 &position, const Quaternion &orientation)
void setPositionAndOrientationWithConstraint (Vec3 &position, Quaternion &orientation)
Vec3 position () const
 Returns the position of the Frame, defined in the world coordinate system.
Quaternion orientation () const
Local translation and rotation w/r reference Frame
void setTranslation (const Vec3 &translation)
 Sets the translation() of the frame, locally defined with respect to the referenceFrame().
void setTranslationWithConstraint (Vec3 &translation)
void setRotation (const Quaternion &rotation)
 Set the current rotation Quaternion.
void setRotationWithConstraint (Quaternion &rotation)
void setTranslationAndRotation (const Vec3 &translation, const Quaternion &rotation)
void setTranslationAndRotationWithConstraint (Vec3 &translation, Quaternion &rotation)
Vec3 translation () const
 Returns the Frame translation, defined with respect to the referenceFrame().
Quaternion rotation () const
 Returns the Frame rotation, defined with respect to the referenceFrame().
Frame hierarchy
const FramereferenceFrame () const
 Returns the reference Frame, in which coordinates system the Frame is defined.
void setReferenceFrame (const Frame *const refFrame)
bool settingAsReferenceFrameWillCreateALoop (const Frame *const frame)
Frame modification
void translate (Vec3 &t)
void translate (const Vec3 &t)
void rotate (Quaternion &q)
void rotate (const Quaternion &q)
void rotateAroundPoint (Quaternion &rotation, const Vec3 &point)
void rotateAroundPoint (const Quaternion &rotation, const Vec3 &point)
void alignWithFrame (const Frame *const frame, bool move=false, float threshold=0.85f)
void projectOnLine (const Vec3 &origin, const Vec3 &direction)
Coordinate system transformation of 3D coordinates
Vec3 coordinatesOf (const Vec3 &src) const
Vec3 inverseCoordinatesOf (const Vec3 &src) const
Vec3 localCoordinatesOf (const Vec3 &src) const
Vec3 localInverseCoordinatesOf (const Vec3 &src) const
Vec3 coordinatesOfIn (const Vec3 &src, const Frame *const in) const
Vec3 coordinatesOfFrom (const Vec3 &src, const Frame *const from) const
Coordinate system transformation of vectors
Vec3 transformOf (const Vec3 &src) const
Vec3 inverseTransformOf (const Vec3 &src) const
Vec3 localTransformOf (const Vec3 &src) const
Vec3 localInverseTransformOf (const Vec3 &src) const
Vec3 transformOfIn (const Vec3 &src, const Frame *const in) const
Vec3 transformOfFrom (const Vec3 &src, const Frame *const from) const
Constraint on the displacement
Constraintconstraint () const
 Returns the current constraint applied to the Frame.
void setConstraint (Constraint *const constraint)
 Sets the constraint() attached to the Frame.
Associated matrices
const GLfloat * matrix () const
void getMatrix (GLfloat m[4][4]) const
void getMatrix (GLfloat m[16]) const
const GLfloat * worldMatrix () const
void getWorldMatrix (GLfloat m[4][4]) const
void getWorldMatrix (GLfloat m[16]) const
void setFromMatrix (const GLfloat m[4][4])
void setFromMatrix (const GLfloat m[16])
Inversion of the transformation
Frame inverse () const
Frame worldInverse () const
 Returns the inverse() of the Frame world transformation.

Public Attributes

Vec3 t_
Quaternion q_
Constraintconstraint_
const FramereferenceFrame_

Friends

std::ostream & operator<< (std::ostream &os, const Frame &c)


Detailed Description

A position and orientation in the world.

Definition at line 63 of file erf_frame.hpp.


Constructor & Destructor Documentation

Frame::Frame (  ) 

Referenced by worldInverse().

virtual Frame::~Frame (  )  [inline, virtual]

Definition at line 67 of file erf_frame.hpp.

References MSG_OK.

Frame::Frame ( const Frame frame  ) 

Frame::Frame ( const Vec3 position,
const Quaternion orientation 
)


Member Function Documentation

Frame& Frame::operator= ( const Frame frame  ) 

void Frame::setPosition ( const Vec3 position  ) 

Referenced by Camera::setPosition().

void Frame::setPosition ( float  x,
float  y,
float  z 
)

void Frame::setPositionWithConstraint ( Vec3 position  ) 

void Frame::setOrientation ( const Quaternion orientation  ) 

void Frame::setOrientation ( float  q0,
float  q1,
float  q2,
float  q3 
)

void Frame::setOrientationWithConstraint ( Quaternion orientation  ) 

void Frame::setPositionAndOrientation ( const Vec3 position,
const Quaternion orientation 
)

void Frame::setPositionAndOrientationWithConstraint ( Vec3 position,
Quaternion orientation 
)

Vec3 Frame::position (  )  const [inline]

Returns the position of the Frame, defined in the world coordinate system.

See also orientation(), setPosition() and translation().

Definition at line 92 of file erf_frame.hpp.

References inverseCoordinatesOf().

Referenced by Camera::position(), and worldInverse().

Quaternion Frame::orientation (  )  const

void Frame::setTranslation ( const Vec3 translation  )  [inline]

Sets the translation() of the frame, locally defined with respect to the referenceFrame().

Use setPosition() to define the world coordinates position(). Use setTranslationWithConstraint() to take into account the potential constraint() of the Frame.

Definition at line 105 of file erf_frame.hpp.

References t_.

void Frame::setTranslationWithConstraint ( Vec3 translation  ) 

void Frame::setRotation ( const Quaternion rotation  )  [inline]

Set the current rotation Quaternion.

See rotation() and the different Quaternion constructors. Sets the rotation() of the Frame, locally defined with respect to the referenceFrame().

Use setOrientation() to define the world coordinates orientation(). The potential constraint() of the Frame is not taken into account, use setRotationWithConstraint() instead.

Definition at line 115 of file erf_frame.hpp.

References q_.

void Frame::setRotationWithConstraint ( Quaternion rotation  ) 

void Frame::setTranslationAndRotation ( const Vec3 translation,
const Quaternion rotation 
)

void Frame::setTranslationAndRotationWithConstraint ( Vec3 translation,
Quaternion rotation 
)

Vec3 Frame::translation (  )  const [inline]

Returns the Frame translation, defined with respect to the referenceFrame().

Use position() to get the result in the world coordinates. These two values are identical when the referenceFrame() is NULL (default).

See also setTranslation() and setTranslationWithConstraint().

Definition at line 128 of file erf_frame.hpp.

References t_.

Quaternion Frame::rotation (  )  const [inline]

Returns the Frame rotation, defined with respect to the referenceFrame().

Use orientation() to get the result in the world coordinates. These two values are identical when the referenceFrame() is NULL (default).

See also setRotation() and setRotationWithConstraint(). Returns the current Quaternion orientation. See setRotation().

Definition at line 138 of file erf_frame.hpp.

References q_.

const Frame* Frame::referenceFrame (  )  const [inline]

Returns the reference Frame, in which coordinates system the Frame is defined.

The translation() and rotation() of the Frame are defined with respect to the referenceFrame() coordinate system. A NULL referenceFrame() (default value) means that the Frame is defined in the world coordinate system.

Use position() and orientation() to recursively convert values along the referenceFrame() chain and to get values expressed in the world coordinate system. The values match when the referenceFrame() is NULL.

Use setReferenceFrame() to set this value and create a Frame hierarchy. Convenient functions allow you to convert 3D coordinates from one Frame to an other: see coordinatesOf(), localCoordinatesOf(), coordinatesOfIn() and their inverse functions.

Vec3tors can also be converted using transformOf(), transformOfIn, localTransformOf() and their inverse functions.

Definition at line 156 of file erf_frame.hpp.

References referenceFrame_.

void Frame::setReferenceFrame ( const Frame *const   refFrame  ) 

bool Frame::settingAsReferenceFrameWillCreateALoop ( const Frame *const   frame  ) 

void Frame::translate ( Vec3 t  ) 

void Frame::translate ( const Vec3 t  ) 

void Frame::rotate ( Quaternion q  ) 

void Frame::rotate ( const Quaternion q  ) 

void Frame::rotateAroundPoint ( Quaternion rotation,
const Vec3 point 
)

void Frame::rotateAroundPoint ( const Quaternion rotation,
const Vec3 point 
)

void Frame::alignWithFrame ( const Frame *const   frame,
bool  move = false,
float  threshold = 0.85f 
)

void Frame::projectOnLine ( const Vec3 origin,
const Vec3 direction 
)

Vec3 Frame::coordinatesOf ( const Vec3 src  )  const

Vec3 Frame::inverseCoordinatesOf ( const Vec3 src  )  const

Vec3 Frame::localCoordinatesOf ( const Vec3 src  )  const

Vec3 Frame::localInverseCoordinatesOf ( const Vec3 src  )  const

Vec3 Frame::coordinatesOfIn ( const Vec3 src,
const Frame *const   in 
) const

Vec3 Frame::coordinatesOfFrom ( const Vec3 src,
const Frame *const   from 
) const

Vec3 Frame::transformOf ( const Vec3 src  )  const

Vec3 Frame::inverseTransformOf ( const Vec3 src  )  const

Referenced by Camera::viewDirection().

Vec3 Frame::localTransformOf ( const Vec3 src  )  const

Vec3 Frame::localInverseTransformOf ( const Vec3 src  )  const

Vec3 Frame::transformOfIn ( const Vec3 src,
const Frame *const   in 
) const

Vec3 Frame::transformOfFrom ( const Vec3 src,
const Frame *const   from 
) const

Constraint* Frame::constraint (  )  const [inline]

Returns the current constraint applied to the Frame.

A NULL value (default) means that no Constraint is used to filter Frame translation and rotation. See the Constraint class documentation for details.

You may have to use a dynamic_cast to convert the result to a Constraint derived class.

Definition at line 220 of file erf_frame.hpp.

References constraint_.

void Frame::setConstraint ( Constraint *const   constraint  )  [inline]

Sets the constraint() attached to the Frame.

A NULL value means no constraint. The previous constraint() should be deleted by the calling method if needed.

Definition at line 227 of file erf_frame.hpp.

References constraint_.

const GLfloat* Frame::matrix (  )  const

void Frame::getMatrix ( GLfloat  m[4][4]  )  const

void Frame::getMatrix ( GLfloat  m[16]  )  const

const GLfloat* Frame::worldMatrix (  )  const

void Frame::getWorldMatrix ( GLfloat  m[4][4]  )  const

void Frame::getWorldMatrix ( GLfloat  m[16]  )  const

void Frame::setFromMatrix ( const GLfloat  m[4][4]  ) 

void Frame::setFromMatrix ( const GLfloat  m[16]  ) 

Frame Frame::inverse (  )  const

Referenced by worldInverse().

Frame Frame::worldInverse (  )  const [inline]

Returns the inverse() of the Frame world transformation.

The orientation() of the new Frame is the Quaternion::inverse() of the original orientation. Its position() is the negated and inverse rotated image of the original position. The result Frame has a NULL referenceFrame() and a NULL constraint().

Use inverse() for a local (i.e. with respect to referenceFrame()) transformation inverse.

Definition at line 255 of file erf_frame.hpp.

References Frame(), inverse(), orientation(), and position().


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Frame c 
) [friend]


Member Data Documentation

Definition at line 264 of file erf_frame.hpp.

Referenced by setTranslation(), and translation().

Definition at line 265 of file erf_frame.hpp.

Referenced by rotation(), and setRotation().

Definition at line 268 of file erf_frame.hpp.

Referenced by constraint(), and setConstraint().

Definition at line 271 of file erf_frame.hpp.

Referenced by referenceFrame().


The documentation for this class was generated from the following file:

The miarn project - written by Joao Xavier