= Using Eigen types in Rock =
Rock is based extensively on Eigen types.
In libraries, the [http://eigen.tuxfamily.org/dox-2.0/StructHavingEigenMembers.html normal Eigen rules apply]
In components, there are two constraints:
1. Eigen types should not have any alignment requirements
2. they should be registered as [http://rock-robotics.org/orogen/opaque_types.html opaque types] in oroGen
== 1. Removing alignment requirements from Eigen types ==
Eigen's fixed-size Matrix type can be marked as non-aligned (and therefore not vectorized). Benchmarking showed that for small vectors (< 10 elements) it has no negative impact (and even has a small positive impact).
This is done by providing the fourth template parameter as Eigen::DontAlign. For instance, Vector4 is defined
In Rock, these "dont't align" types are defined in the [http://www.rock-robotics.org/package_directory/packages/base_types/index.html base/types] package, in base/eigen.h. We are using the same typedefs as Eigen itself, but put inside the base:: namespace.
For instance, the non-aligned version of Eigen::Vector4d is base::Vector4d.
'''Using the base variants of the types is encouraged, but not mandatory, in rock libraries.'''
'''In Eigen 2.x, one cannot do that for Quaternion. Eigen 3.x does have that ability, but is not yet integrated in Rock'''
== 2. Publishing the types in oroGen ==