Helios++
Helios software for LiDAR simulations
|
Adapter which wraps a rigid motion engine to make it fit the dynamic Helios context. More...
#include <DynMotionEngine.h>
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 |
Adapter which wraps a rigid motion engine to make it fit the dynamic Helios context.
|
inline |
Construct a dynamic motion engine from given rigid motion engine.
rme | Rigid motion engine composing the dynamic motion engine |
|
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
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.
f | Dynamic motion to be applied |
X | Matrix of points to be transformed |
dynObj | Dynamic object associated with the matrix of points. It will be updated according to given dynamic motion, if necessary |
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.
f | The dynamic motion in second place of composition |
g | The dynamic motion in first place of composition |
dynObj | Dynamic object associated with given dynamic motions to be composed |
|
inlineprivate |
Serialize a dynamic motion engine to a stream of bytes.
Archive | Type of rendering |
ar | Specific rendering for the stream of bytes |
version | Version number for the dynamic motion engine |
|
protected |
The factory for rigid motions in \(\mathbb{R}^3\) of the dynamic motion engine.
|
protected |
The rigid motion engine which is the core of the dynamic motion engine.