chrono::ChCoordsys< Real > Class Template Reference

Description

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

COORDSYS:

This class contains both translational variable (the origin of the axis) and the rotational variable (that is the unitary quaternion which represent the special-orthogonal transformation matrix). Basic features for point-coordinate transformations are provided. However, for more advanced features, the heavier classes ChFrame() or ChFrameMoving() may suit better. The coordsys object comes either with the template "ChCoordsys<type>" mode, either in the 'shortcut' flavor, that is "Coordsys", which assumes the type of the four scalars is double precision, so it is faster to type.

Further info at the Coordinate transformations manual page.

#include <ChCoordsys.h>

Public Member Functions

 ChCoordsys (const ChVector< Real > &mv, const ChQuaternion< Real > &mq=ChQuaternion< Real >(1, 0, 0, 0))
 
 ChCoordsys (const ChVector< Real > &mv, const Real alpha, const ChVector< Real > &mu)
 
 ChCoordsys (const ChCoordsys< Real > &other)
 Copy constructor.
 
template<typename Derived >
 ChCoordsys (const Eigen::MatrixBase< Derived > &vec, typename std::enable_if<(Derived::MaxRowsAtCompileTime==1||Derived::MaxColsAtCompileTime==1), Derived >::type *=0)
 Construct a coordsys from an Eigen vector expression.
 
template<typename Derived >
ChCoordsysoperator= (const Eigen::MatrixBase< Derived > &vec)
 Assign an Eigen vector expression to this coordsys.
 
ChCoordsys< Real > & operator= (const ChCoordsys< Real > &other)
 Assignment operator: copy from another coordsys.
 
bool operator<= (const ChCoordsys< Real > &other) const
 
bool operator>= (const ChCoordsys< Real > &other) const
 
bool operator== (const ChCoordsys< Real > &other) const
 
bool operator!= (const ChCoordsys< Real > &other) const
 
ChCoordsys< Real > operator>> (const ChCoordsys< 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. More...
 
ChCoordsys< Real > operator* (const ChCoordsys< Real > &Fb) const
 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. More...
 
ChVector< 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. More...
 
ChCoordsys< Real > & operator>>= (const ChCoordsys< Real > &T)
 Performs pre-multiplication of this frame by another frame, for example: A>>=T means A'=T*A ; or A'=A >> T.
 
ChCoordsys< Real > & operator*= (const ChCoordsys< Real > &T)
 Performs post-multiplication of this frame by another frame, for example: A*=T means A'=A*T ; or A'=T >> A.
 
ChCoordsys< Real > & operator>>= (const ChVector< Real > &D)
 Performs pre-multiplication of this frame by a vector D, to 'move' by a displacement D:
 
ChCoordsys< Real > & operator>>= (const ChQuaternion< Real > &R)
 Performs pre-multiplication of this frame by a quaternion R, to 'rotate' it by R:
 
void Force2D ()
 Force to z=0, and z rotation only. No normalization to quaternion, however.
 
bool Equals (const ChCoordsys< Real > &other) const
 Returns true if coordsys is identical to other coordsys.
 
bool Equals (const ChCoordsys< Real > &other, Real tol) const
 Returns true if coordsys is equal to other coordsys, within a tolerance 'tol'.
 
void SetIdentity ()
 Sets to no translation and no rotation.
 
void ConcatenatePreTransformation (const ChCoordsys< Real > &T)
 Apply a transformation (rotation and translation) represented by another ChCoordsys T. More...
 
void ConcatenatePostTransformation (const ChCoordsys< Real > &T)
 Apply a transformation (rotation and translation) represented by another ChCoordsys T in local coordinate. More...
 
ChVector< Real > TransformLocalToParent (const ChVector< Real > &local) const
 This function transforms a point from the local coordinate system to the parent coordinate system. More...
 
ChVector< Real > TransformPointLocalToParent (const ChVector< Real > &local) const
 
ChVector< Real > TransformParentToLocal (const ChVector< Real > &parent) const
 This function transforms a point from the parent coordinate system to a local coordinate system, whose relative position is given by this coodsys, i.e. More...
 
ChVector< Real > TransformPointParentToLocal (const ChVector< Real > &parent) const
 
ChVector< Real > TransformDirectionLocalToParent (const ChVector< Real > &local) const
 This function transforms a direction from 'this' local coordinate system to the parent coordinate system.
 
ChVector< Real > TransformDirectionParentToLocal (const ChVector< Real > &parent) const
 This function transforms a direction from the parent coordinate system to 'this' local coordinate system.
 
ChCoordsys< Real > TransformLocalToParent (const ChCoordsys< Real > &local) const
 This function transforms a coordsys given in 'this' coordinate system to the parent coordinate system.
 
ChCoordsys< Real > TransformParentToLocal (const ChCoordsys< Real > &parent) const
 This function transforms a coordsys given in the parent coordinate system to 'this' coordinate system.
 
void ArchiveOUT (ChArchiveOut &marchive)
 Method to allow serialization of transient data in archives.
 
void ArchiveIN (ChArchiveIn &marchive)
 Method to allow de-serialization of transient data from archives.
 

Public Attributes

ChVector< Real > pos
 
ChQuaternion< Real > rot
 

Member Function Documentation

◆ ConcatenatePostTransformation()

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

Apply a transformation (rotation and translation) represented by another ChCoordsys T in local coordinate.

This is equivalent to post-multiply this csys by the other csys T: this'= this * T; or this'= T >> this

◆ ConcatenatePreTransformation()

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

Apply a transformation (rotation and translation) represented by another ChCoordsys T.

This is equivalent to pre-multiply this csys by the other csys T: this'= T * this; or this' = this >> T

◆ operator*()

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

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. 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;

◆ operator/()

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

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; 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;

◆ operator>>()

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

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.

◆ TransformLocalToParent()

template<class Real = double>
ChVector<Real> chrono::ChCoordsys< Real >::TransformLocalToParent ( const ChVector< Real > &  local) const
inline

This function transforms a point from the local coordinate system to the parent coordinate system.

Relative position of local respect to parent is given by this coordys, i.e. 'origin' translation and 'alignment' quaternion.

Returns
The point in parent coordinate, as parent=origin +q*[0,(local)]*q'

◆ TransformParentToLocal()

template<class Real = double>
ChVector<Real> chrono::ChCoordsys< Real >::TransformParentToLocal ( const ChVector< Real > &  parent) const
inline

This function transforms a point from the parent coordinate system to a local coordinate system, whose relative position is given by this coodsys, i.e.

'origin' translation and 'alignment' quaternion.

Returns
The point in local coordinate, as local=q'*[0,(parent-origin)]*q

The documentation for this class was generated from the following file:
  • /builds/uwsbel/chrono/src/chrono/core/ChCoordsys.h