Helios++
Helios software for LiDAR simulations
DynMotionEngine Class Reference

Adapter which wraps a rigid motion engine to make it fit the dynamic Helios context. More...

#include <DynMotionEngine.h>

Collaboration diagram for DynMotionEngine:

Public Member Functions

 DynMotionEngine ()=default
 Default constructor for dynamic motion engine. It uses a default rigid motion engine.
 
 DynMotionEngine (RigidMotionEngine const &rme)
 Construct a dynamic motion engine from given rigid motion engine. More...
 
arma::mat apply (DynMotion const &f, arma::mat const &X, DynObject &dynObj)
 Apply dynamic motion \(f\) to a matrix of points \(X\) belonging to given dynamic object. More...
 
DynMotion compose (DynMotion const &f, DynMotion const &g, DynObject const &dynObj)
 Compose given dynamic motions considering they belong to given dynamic object. More...
 

Protected Member Functions

DynMotion _compose (DynMotion const &f, DynMotion const &g, DynObject const &dynObj)
 Assist compose method do its stuff. More...
 

Protected Attributes

RigidMotionEngine rme
 The rigid motion engine which is the core of the dynamic motion engine. More...
 
RigidMotionR3Factory rm3f
 The factory for rigid motions in \(\mathbb{R}^3\) of the dynamic motion engine. More...
 

Private Member Functions

template<typename Archive >
void serialize (Archive &ar, const unsigned int version)
 Serialize a dynamic motion engine to a stream of bytes. More...
 

Friends

class boost::serialization::access
 

Detailed Description

Adapter which wraps a rigid motion engine to make it fit the dynamic Helios context.

Author
Alberto M. Esmoris Pena
Version
1.0
See also
rigidmotion::RigidMotionEngine
DynObject
DynMotion
DynMovingObject
DynSequentiableMovingObject

Constructor & Destructor Documentation

◆ DynMotionEngine()

DynMotionEngine::DynMotionEngine ( RigidMotionEngine const &  rme)
inline

Construct a dynamic motion engine from given rigid motion engine.

Parameters
rmeRigid motion engine composing the dynamic motion engine

Member Function Documentation

◆ _compose()

DynMotion DynMotionEngine::_compose ( DynMotion const &  f,
DynMotion const &  g,
DynObject const &  dynObj 
)
protected

Assist compose method do its stuff.

It takes care of the composition itself so the main compose method implements the proper configuration of composition depending on the dynamic object and given dynamic motions

See also
compose(DynMotion const &, DynMotion const &, DynObject const &)

◆ apply()

mat DynMotionEngine::apply ( DynMotion const &  f,
arma::mat const &  X,
DynObject dynObj 
)

Apply dynamic motion \(f\) to a matrix of points \(X\) belonging to given dynamic object.

To explain different applications let \(o\) be the centroid of the dynamic object.

If the dynamic motion has no modes enabled, it will be applied straight forward to both \(X\) and \(O\).

If the dynamic motion has self mode enabled but not normal mode enabled, it will be applied to both \(X\) and \(O\). However, when applied to \(X\) instead of computing \(f(X) = C + AX\) it will compute \(f(X) = O + C + A(X-O)\). On the other hand, updating \(O\) leads to \(f(O) = O + C + A(O-O) = O + C\)

If the dynamic motion has both self mode and normal mode enabled, then it will be applied to \(X\) but not to \(O\), using the basic affine application \(f(X) = C + AX\).

If the dynamic motion hast self mode disabled but normal mode enabled, then it will behave exactly as if both self mode and normal mode were enabled.

Parameters
fDynamic motion to be applied
XMatrix of points to be transformed
dynObjDynamic object associated with the matrix of points. It will be updated according to given dynamic motion, if necessary
Returns
Result of applying the dynamic motion to the matrix of points
See also
rigidmotion::RigidMotionEngine::apply(RigidMotion const &, mat const &)
DynMotion::selfMode
DynMotion::normalMode

◆ compose()

DynMotion DynMotionEngine::compose ( DynMotion const &  f,
DynMotion const &  g,
DynObject const &  dynObj 
)

Compose given dynamic motions considering they belong to given dynamic object.

To explain how dynamic motion composition works, let \(f\) and \(g\) be dynamic motions with self mode disabled and \(f'\) and \(g'\) their counterpart dynamic motions with self mode enabled. Also, let \(O\) be the centroid of given dynamic object. Now, there are four different cases that must be handled:

Case \(f \circ g\)

\[ \left(f \circ g\right)\left(X\right) = f\left(g\left(X\right)\right) \]

Case \(f' \circ g\)

\[ \left(f' \circ g\right)\left(X\right) = g(O) + f\left[g(X)-g(O)\right] \]

Case \(f \circ g'\)

\[ \left(f \circ g\right)\left(X\right) = f\left[O+g(X-O)\right] \]

Case \(f' \circ g'\)

\[ \left(f' \circ g'\right) = g(O) + f\left[O + g(X-O) - g(O)\right] \]

Finally, in case any dynamic motion involved in the composition has normal mode enabled, then resulting dynamic motion will have normal mode enabled too. It is called the normal mode transitivity property of dynamic motions.

Parameters
fThe dynamic motion in second place of composition
gThe dynamic motion in first place of composition
dynObjDynamic object associated with given dynamic motions to be composed
Returns
Composition of given dynamic motions
See also
rigidmotion::RigidMotionEngine::compose
rigidmotion::RigidMotion::compose

◆ serialize()

template<typename Archive >
void DynMotionEngine::serialize ( Archive &  ar,
const unsigned int  version 
)
inlineprivate

Serialize a dynamic motion engine to a stream of bytes.

Template Parameters
ArchiveType of rendering
Parameters
arSpecific rendering for the stream of bytes
versionVersion number for the dynamic motion engine

Member Data Documentation

◆ rm3f

RigidMotionR3Factory DynMotionEngine::rm3f
protected

The factory for rigid motions in \(\mathbb{R}^3\) of the dynamic motion engine.

See also
rigidmotion::RigidMotionR3Factory

◆ rme

RigidMotionEngine DynMotionEngine::rme
protected

The rigid motion engine which is the core of the dynamic motion engine.

See also
rigidmotion::RigidMotionEngine

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