MULTIBODY SIMULATION SOFTWARE - API documentation
Public Member Functions | Static Public Member Functions | Public Attributes | Friends
chrono::ChFrame< Real > Class Template Reference

#include <CHframe.h>

Inheritance diagram for chrono::ChFrame< Real >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 ChFrame (const ChVector< Real > &mv=VNULL, const ChQuaternion< Real > &mq=QUNIT)
 ChFrame (const ChVector< Real > &mv, ChMatrix33< Real > &ma)
 ChFrame (const ChCoordsys< Real > &mc)
 ChFrame (const ChFrame< Real > &other)
ChFrame< Real > & operator= (const ChFrame< Real > &other)
virtual bool operator== (const ChFrame< Real > &other) const
virtual bool operator!= (const ChFrame< Real > &other) const
ChFrame< Real > operator>> (const ChFrame< Real > &Fb) const
ChFrame< Real > operator* (const ChFrame< Real > &Fb) const
ChVector< Real > operator* (const ChVector< Real > &V) const
ChVector< Real > operator/ (const ChVector< Real > &V) const
ChFrame< Real > & operator%= (const ChFrame< Real > &T)
ChFrame< Real > & operator*= (const ChFrame< Real > &T)
ChCoordsys< Real > GetCoord ()
ChVector< Real > GetPos ()
ChQuaternion< Real > GetRot ()
ChMatrix33< Real > * GetA ()
ChVector< Real > GetRotAxis ()
double GetRotAngle ()
virtual void SetCoord (const ChCoordsys< Real > &mcoord)
virtual void SetCoord (const ChVector< Real > &mv, const ChQuaternion< Real > &mq)
virtual void SetRot (const ChQuaternion< Real > &mrot)
virtual void SetRot (ChMatrix33< Real > &mA)
virtual void SetPos (const ChVector< Real > &mpos)
void ConcatenatePreTransformation (const ChFrame< Real > &T)
void ConcatenatePostTransformation (const ChFrame< Real > &T)
void Move (const ChVector< Real > &V)
void Move (ChCoordsys< Real > &VR)
virtual ChVector< Real > TrasformLocalToParent (const ChVector< Real > &local) const
virtual ChVector< Real > TrasformParentToLocal (const ChVector< Real > &parent) const
virtual void TrasformLocalToParent (const ChFrame< Real > &local, ChFrame< Real > &parent) const
virtual void TrasformParentToLocal (const ChFrame< Real > &parent, ChFrame< Real > &local) const
bool Equals (const ChFrame< Real > &other) const
bool Equals (const ChFrame< Real > &other, Real tol) const
void Normalize ()
virtual void SetIdentity ()
virtual void Invert ()
ChFrame< Real > GetInverse () const
virtual void StreamOUT (ChStreamOutAscii &mstream)
virtual void StreamOUT (ChStreamOutBinary &mstream)
virtual void StreamIN (ChStreamInBinary &mstream)

Static Public Member Functions

static void SetMatrix_Fp (ChMatrixNM< Real, 3, 4 > &Fp, const ChQuaternion< Real > &mq)
static void SetMatrix_Fm (ChMatrixNM< Real, 3, 4 > &Fm, const ChQuaternion< Real > &mq)
static void SetMatrix_Gl (ChMatrixNM< Real, 3, 4 > &Gl, const ChQuaternion< Real > &mq)
static void SetMatrix_Gw (ChMatrixNM< Real, 3, 4 > &Gw, const ChQuaternion< Real > &mq)
static ChVector< Real > Gl_x_Quat (const ChQuaternion< Real > &mq, const ChQuaternion< Real > &qb)
static ChQuaternion< Real > GlT_x_Vect (const ChQuaternion< Real > &mq, const ChVector< Real > &v)

Public Attributes

ChCoordsys< Real > coord
ChMatrix33< Real > Amatrix

Friends

ChVector< Real > operator>> (const ChVector< Real > &V, const ChFrame< Real > &mframe)

Detailed Description

template<class Real = double>
class chrono::ChFrame< Real >

ChFrame: a class for coordinate systems in 3D space.

A 'frame' coordinate system has a translation and a rotation respect to a 'parent' coordinate system, usually the absolute (world) coordinates.

Differently from a simple ChCoordsys() object, however, the ChFrame implements some optimizations because each ChFrame stores also a 3x3 rotation matrix, which can speed up coordinate transformations when a large amount of vectors must be transfomed by the same coordinate frame.


Member Function Documentation

template<class Real = double>
void chrono::ChFrame< Real >::ConcatenatePostTransformation ( const ChFrame< Real > &  T)

Apply a transformation (rotation and translation) represented by another ChFrame T in local coordinate. This is equivalent to post-multiply this frame by the other frame T: this'= this * T; or this'= T >> this

template<class Real = double>
void chrono::ChFrame< Real >::ConcatenatePreTransformation ( const ChFrame< Real > &  T)

Apply a transformation (rotation and translation) represented by another ChFrame T. This is equivalent to pre-multiply this frame by the other frame T: this'= T * this; or this' = this >> T

template<class Real = double>
ChCoordsys<Real> chrono::ChFrame< Real >::GetCoord ( )

Return both current rotation and translation as a coordsystem object, with vector and quaternion

template<class Real = double>
static ChVector<Real> chrono::ChFrame< Real >::Gl_x_Quat ( const ChQuaternion< Real > &  mq,
const ChQuaternion< Real > &  qb 
) [static]

Computes the product v=[Gl(mq)]*qb without the need of having the [Gl] matrix (just pass the mq quaternion, since Gl is function of mq)

template<class Real = double>
static ChQuaternion<Real> chrono::ChFrame< Real >::GlT_x_Vect ( const ChQuaternion< Real > &  mq,
const ChVector< Real > &  v 
) [static]

Computes the product q=[Gl(mq)]*v without the need of having the [Gl] matrix (just pass the mq quaternion, since Gl is function of mq)

template<class Real = double>
virtual void chrono::ChFrame< Real >::Invert ( ) [virtual]

The trasformation is inverted in place. That is if w=A*v, then A.Invert();v=A*w;

Reimplemented in chrono::ChFrameMoving< Real >, and chrono::ChFrameMoving< double >.

template<class Real = double>
void chrono::ChFrame< Real >::Move ( const ChVector< Real > &  V)

An easy way to move the frame by the amount specified by vector V, (assuming V expressed in parent coordinates)

template<class Real = double>
void chrono::ChFrame< Real >::Move ( ChCoordsys< Real > &  VR)

Apply both translation and rotation, assuming both expressed in parent coordinates, as a vector for translation and quaternion for rotation,

template<class Real = double>
ChFrame<Real>& chrono::ChFrame< Real >::operator%= ( const ChFrame< Real > &  T)

Performs pre-multiplication of this frame by another frame, for example: A%=T means A'=T*A ; or A'=A >> T

template<class Real = double>
ChFrame<Real> chrono::ChFrame< Real >::operator* ( const ChFrame< Real > &  Fb) const

The '*' operator transforms a coordinate system, so transformations can be represented with this syntax: new_frame = tr_frame * old_frame; For a sequence of transformations, i.e. a chain of coordinate systems, you can also write this (just like you would do with a sequence of Denavitt-Hartemberg matrix multiplications!) new_frame = frame1to0 * frame2to1 * frame3to2 * old_frame; This operation is not commutative. NOTE: since c++ operator execution is from left to right, in case of multiple transformations like w=A*B*C*v, the >> operator performs faster, like w=v>>C>>B>>A;

template<class Real = double>
ChVector<Real> chrono::ChFrame< Real >::operator* ( const ChVector< Real > &  V) const

The '*' operator transforms a vector, so transformations can be represented with this syntax: new_v = tr_frame * old_v; For a sequence of transformations, i.e. a chain of coordinate systems, you can also write this (just like you would do with a sequence of Denavitt-Hartemberg matrix multiplications!) new_v = frame1to0 * frame2to1 * frame3to2 * old_v; This operation is not commutative. NOTE: since c++ operator execution is from left to right, in case of multiple transformations like w=A*B*C*v, the >> operator performs faster, like w=v>>C>>B>>A;

template<class Real = double>
ChFrame<Real>& chrono::ChFrame< Real >::operator*= ( const ChFrame< Real > &  T)

Performs post-multiplication of this frame by another frame, for example: A*=T means A'=A*T ; or A'=T >> A

template<class Real = double>
ChVector<Real> chrono::ChFrame< Real >::operator/ ( const ChVector< Real > &  V) const

The '/' is like the '*' operator (see), but uses the inverse transformation for A, in A/b. (with A ChFrame, b ChVector) That is: c=A*b ; b=A/c;

template<class Real = double>
ChFrame<Real> chrono::ChFrame< Real >::operator>> ( const ChFrame< Real > &  Fb) const

The '>>' operator transforms a coordinate system, so transformations can be represented with this syntax: new_frame = old_frame >> tr_frame; For a sequence of transformations, i.e. a chain of coordinate systems, you can also write this (like you would do with a sequence of Denavitt-Hartemberg matrix multiplications, but in the _opposite_ order...) new_frame = old_frame >> frame3to2 >> frame2to1 >> frame1to0; This operation is not commutative.

template<class Real = double>
virtual void chrono::ChFrame< Real >::SetCoord ( const ChCoordsys< Real > &  mcoord) [virtual]

Impose both translation and rotation as a single ChCoordsys. Note: the quaternion part must be already normalized!

template<class Real = double>
virtual void chrono::ChFrame< Real >::SetCoord ( const ChVector< Real > &  mv,
const ChQuaternion< Real > &  mq 
) [virtual]

Impose both translation and rotation. Note: the quaternion part must be already normalized!

template<class Real = double>
static void chrono::ChFrame< Real >::SetMatrix_Gl ( ChMatrixNM< Real, 3, 4 > &  Gl,
const ChQuaternion< Real > &  mq 
) [static]

Fast fill a 3x4 matrix [Gl(q)], as in local angular speed conversion Wl=[Gl]*q_dt (btw: [Gl(q)] = 2*[Fp(q')] = 2*[G] with G matrix as in Shabana)

template<class Real = double>
static void chrono::ChFrame< Real >::SetMatrix_Gw ( ChMatrixNM< Real, 3, 4 > &  Gw,
const ChQuaternion< Real > &  mq 
) [static]

Fast fill a 3x4 matrix [Gw(q)], as in absolute angular speed conversion Ww=[Gw]*q_dt (btw: [Gw(q)] = 2*[Fm(q')] = 2*[E] with E matrix as in Shabana)

template<class Real = double>
virtual void chrono::ChFrame< Real >::SetRot ( const ChQuaternion< Real > &  mrot) [virtual]

Impose the rotation as a quaternion. Note: the quaternion must be already normalized!

template<class Real = double>
virtual void chrono::ChFrame< Real >::SetRot ( ChMatrix33< Real > &  mA) [virtual]

Impose the rotation as a 3x3 matrix. Note: the rotation matrix must be already orthogonal!

template<class Real = double>
virtual void chrono::ChFrame< Real >::StreamIN ( ChStreamInBinary mstream) [virtual]

Operator to allow deserializing a persistent binary archive (ex: a file) into transient data.

Reimplemented in chrono::ChBody, chrono::ChFrameMoving< Real >, chrono::ChFrameMoving< double >, chrono::ChMarker, chrono::ChConveyor, chrono::ChBodyDEM, chrono::ChBodyAuxRef, chrono::ChBodyDEMMPI, and chrono::ChBodyMPI.

template<class Real = double>
virtual void chrono::ChFrame< Real >::StreamOUT ( ChStreamOutAscii mstream) [virtual]

Method to allow serializing transient data into in ascii as a readable item, for example "chrono::GetLog() << myobject;"

Reimplemented in chrono::ChBody, chrono::ChFrameMoving< Real >, chrono::ChFrameMoving< double >, and chrono::ChMarker.

template<class Real = double>
virtual void chrono::ChFrame< Real >::StreamOUT ( ChStreamOutBinary mstream) [virtual]

Method to allow serializing transient data into a persistent binary archive (ex: a file).

Reimplemented in chrono::ChBody, chrono::ChFrameMoving< Real >, chrono::ChFrameMoving< double >, chrono::ChMarker, chrono::ChConveyor, chrono::ChBodyDEM, chrono::ChBodyAuxRef, chrono::ChBodyDEMMPI, and chrono::ChBodyMPI.

template<class Real = double>
virtual ChVector<Real> chrono::ChFrame< Real >::TrasformLocalToParent ( const ChVector< Real > &  local) const [virtual]

This function transforms a point from the local frame coordinate system to the parent coordinate system. OPTIMIZED FOR SPEED. Since it will use the auxiliary rotation matrix of the ChFrame object, this function is about 50% faster than TrasformParentToLocal of a ChCoordsys.

Returns:
The point in parent coordinate
Parameters:
localpoint to transform, given in local frame coordinates
template<class Real = double>
virtual void chrono::ChFrame< Real >::TrasformLocalToParent ( const ChFrame< Real > &  local,
ChFrame< Real > &  parent 
) const [virtual]

This function transforms a frame from 'this' local coordinate system to parent frame coordinate system.

Returns:
The frame in parent frame coordinate
Parameters:
localframe to transform, given in local frame coordinates
parenttransformed frame, in parent coordinates, will be stored here
template<class Real = double>
virtual ChVector<Real> chrono::ChFrame< Real >::TrasformParentToLocal ( const ChVector< Real > &  parent) const [virtual]

This function transforms a point from the parent coordinate system to local frame coordinate system. OPTIMIZED FOR SPEED. Since it will use the auxiliary rotation matrix of the ChFrame object, this function is about 50% faster than TrasformParentToLocal method of a ChCoordsys.

Returns:
The point in local frame coordinate
Parameters:
parentpoint to transform, given in parent coordinates
template<class Real = double>
virtual void chrono::ChFrame< Real >::TrasformParentToLocal ( const ChFrame< Real > &  parent,
ChFrame< Real > &  local 
) const [virtual]

This function transforms a frame from the parent coordinate system to 'this' local frame coordinate system.

Returns:
The frame in local frame coordinate
Parameters:
parentframe to transform, given in parent coordinates
localtransformed frame, in local coordinates, will be stored here

Friends And Related Function Documentation

template<class Real = double>
ChVector<Real> operator>> ( const ChVector< Real > &  V,
const ChFrame< Real > &  mframe 
) [friend]

The '>>' operator transforms a vector, so transformations can be represented with this syntax: new_v = old_v >> tr_frame; For a sequence of transformations, i.e. a chain of coordinate systems, you can also write this (like you would do with a sequence of Denavitt-Hartemberg matrix multiplications, but in the opposite order...) new_v = old_v >> frame3to2 >> frame2to1 >> frame1to0; This operation is not commutative.


Member Data Documentation

template<class Real = double>
ChMatrix33<Real> chrono::ChFrame< Real >::Amatrix

Rotation as 3x3 orthogonal matrix (auxiliary, for faster transformation of many coordinates )


CHRONO::ENGINE
C++ library for multibody simulation, (C) Alessandro Tasora
This API documentation has been generated on Tue Jul 10 2012 by Doxygen