From e3a1d67444b1ae4f56cd92b78a9fd60c3737e5ff Mon Sep 17 00:00:00 2001 From: Andreas Bircher Date: Thu, 5 May 2016 11:04:12 +0200 Subject: [PATCH] adding detailed comments on rotation classes --- matrix/Dcm.hpp | 19 ++++++++-------- matrix/Euler.hpp | 27 +++++++++++----------- matrix/Quaternion.hpp | 53 ++++++++++++++++--------------------------- 3 files changed, 43 insertions(+), 56 deletions(-) diff --git a/matrix/Dcm.hpp b/matrix/Dcm.hpp index edf165bbdd..c5c112d793 100644 --- a/matrix/Dcm.hpp +++ b/matrix/Dcm.hpp @@ -23,7 +23,8 @@ class Euler; /** * Direction cosine matrix class * - * More elaborate class description + * The rotation between two coordinate frames is + * described by this class. */ template class Dcm : public Matrix @@ -46,8 +47,6 @@ public: /** * Constructor from array * - * More elaborate function description - * * @param other array */ Dcm(const Type *data_) : Matrix(data_) @@ -57,8 +56,6 @@ public: /** * Copy constructor * - * More elaborate function description - * * @param other Matrix33 to set dcm to */ Dcm(const Matrix &other) : Matrix(other) @@ -68,7 +65,8 @@ public: /** * Constructor from quaternion * - * More elaborate function description + * Instance is initialized from quaternion representing + * transformation from inertial frame to body frame. * * @param q quaternion to set dcm to */ @@ -79,7 +77,8 @@ public: /** * Constructor from euler angles * - * More elaborate function description + * Instance is initialized from angle tripplet (3,2,1) representing + * transformation from body frame to inertial frame. * * @param euler euler angles to set dcm to */ @@ -91,7 +90,8 @@ public: /** * Set from quaternion * - * More elaborate function description + * Instance is set from quaternion representing + * transformation from inertial frame to body frame. * * @param q quaternion to set dcm to */ @@ -119,7 +119,8 @@ public: /** * Set from euler angles * - * More elaborate function description + * Instance is set from angle tripplet (3,2,1) representing + * transformation from body frame to inertial frame. * * @param euler euler angles to set dcm to */ diff --git a/matrix/Euler.hpp b/matrix/Euler.hpp index 24ffd326df..887749b61e 100644 --- a/matrix/Euler.hpp +++ b/matrix/Euler.hpp @@ -26,7 +26,8 @@ class Quaternion; /** * Euler angles class * - * More elaborate class description + * This class describes the transformation from the body fixed frame + * to the inertial frame via 3-2-1 tait brian euler angles. */ template class Euler : public Vector @@ -36,8 +37,6 @@ public: /** * Standard constructor - * - * More elaborate function description */ Euler() : Vector() { @@ -46,8 +45,6 @@ public: /** * Copy constructor * - * More elaborate function description - * * @param other vector to copy */ Euler(const Vector & other) : @@ -58,8 +55,6 @@ public: /** * Constructor from Matrix31 * - * More elaborate function description - * * @param other Matrix31 to copy */ Euler(const Matrix & other) : @@ -70,7 +65,8 @@ public: /** * Constructor from euler angles * - * More elaborate function description + * Instance is initialized from angle tripplet (3,2,1) + * representing transformation from body frame to inertial frame. * * @param phi_ roll * @param theta_ pitch @@ -84,7 +80,8 @@ public: /** * Constructor from dcm * - * More elaborate function description + * Instance is initialized from dcm representing transformation + * from body frame to inertial frame. * * @param dcm_ dcm to set angles to */ @@ -96,7 +93,8 @@ public: /** * Constructor from quaternion * - * More elaborate function description + * Instance is initialized from quaternion representing + * transformation from body frame to inertial frame. * * @param q quaternion to set angles to */ @@ -109,7 +107,8 @@ public: /** * Set from euler angles * - * More elaborate function description + * Instance is set from angle tripplet (3,2,1) representing + * transformation from body frame to inertial frame. * * @param phi_ roll * @param theta_ pitch @@ -125,7 +124,8 @@ public: /** * Set from dcm * - * More elaborate function description + * Instance is set from dcm representing transformation + * from body frame to inertial frame. * * @param dcm_ dcm to set angles to */ @@ -152,7 +152,8 @@ public: /** * Set from dcm * - * More elaborate function description + * Instance is set from quaternion representing + * transformation from body frame to inertial frame. * * @param q quaternion to set angles to */ diff --git a/matrix/Quaternion.hpp b/matrix/Quaternion.hpp index 835c97a3d1..a161b42e22 100644 --- a/matrix/Quaternion.hpp +++ b/matrix/Quaternion.hpp @@ -23,7 +23,8 @@ class Euler; /** * Quaternion class * - * More elaborate class description + * The rotation between two coordinate frames is + * described by this class. */ template class Quaternion : public Vector @@ -37,8 +38,6 @@ public: /** * Constructor from array * - * More elaborate function description - * * @param data_ array */ Quaternion(const Type *data_) : @@ -48,8 +47,6 @@ public: /** * Standard constructor - * - * More elaborate function description */ Quaternion() : Vector() @@ -64,8 +61,6 @@ public: /** * Constructor from Matrix41 * - * More elaborate function description - * * @param other Matrix41 to copy */ Quaternion(const Matrix41 & other) : @@ -76,7 +71,8 @@ public: /** * Constructor from dcm * - * More elaborate function description + * Instance is initialized from a dcm representing transformation + * from inertial frame to body frame. * * @param dcm dcm to set quaternion to */ @@ -89,7 +85,8 @@ public: /** * Constructor from euler angles * - * More elaborate function description + * Instance is initialized from angle tripplet (3,2,1) representing + * transformation from body frame to inertial frame. * * @param euler euler angles to set quaternion to */ @@ -102,7 +99,8 @@ public: /** * Constructor from quaternion values * - * More elaborate function description + * Instance is initialized from quaternion values representing + * transformation from inertial frame to body frame. * * @param a set quaternion value 0 * @param b set quaternion value 1 @@ -118,7 +116,8 @@ public: /** * Set from dcm * - * More elaborate function description + * Instance is set from a dcm representing transformation + * from inertial frame to body frame. * * @param dcm dcm to set quaternion to */ @@ -138,7 +137,8 @@ public: /** * Set from euler angles * - * More elaborate function description + * Instance is set from angle tripplet (3,2,1) representing + * transformation from body frame to inertial frame. * * @param euler euler angles to set quaternion to */ @@ -164,7 +164,8 @@ public: /** * Set from quaternion values * - * More elaborate function description + * Instance is set from quaternion values representing + * transformation from inertial frame to body frame. * * @param a set quaternion value 0 * @param b set quaternion value 1 @@ -183,8 +184,6 @@ public: /** * Quaternion multiplication operator * - * More elaborate function description - * * @param q quaternion to multiply with * @return product */ @@ -202,8 +201,6 @@ public: /** * Self-multiplication operator * - * More elaborate function description - * * @param other quaternion to multiply with */ void operator*=(const Quaternion & other) @@ -215,8 +212,6 @@ public: /** * Scalar multiplication operator * - * More elaborate function description - * * @param scalar scalar to multiply with * @return product */ @@ -229,8 +224,6 @@ public: /** * Scalar self-multiplication operator * - * More elaborate function description - * * @param scalar scalar to multiply with */ void operator*=(Type scalar) @@ -242,8 +235,6 @@ public: /** * Computes the derivative * - * More elaborate function description - * * @param w direction */ Matrix41 derivative(const Matrix31 & w) const { @@ -265,8 +256,6 @@ public: /** * Invert quaternion - * - * More elaborate function description */ void invert() { Quaternion &q = *this; @@ -278,8 +267,6 @@ public: /** * Invert quaternion * - * More elaborate function description - * * @return inverted quaternion */ Quaternion inversed() { @@ -295,8 +282,6 @@ public: /** * Rotate quaternion from rotation vector * - * More elaborate function description - * * @param vec rotation vector */ void rotate(const Vector &vec) { @@ -308,7 +293,8 @@ public: /** * Rotation quaternion from vector * - * More elaborate function description + * The axis of rotation is given by vector direction and + * the angle is given by the norm. * * @param vec rotation vector * @return quaternion representing the rotation @@ -326,9 +312,7 @@ public: } /** - * Rotation quaternion from axis and scalar - * - * More elaborate function description + * Rotation quaternion from axis and angle * * @param axis axis of rotation * @param theta scalar describing angle of rotation @@ -352,7 +336,8 @@ public: /** * Rotation vector from quaternion * - * More elaborate function description + * The axis of rotation is given by vector direction and + * the angle is given by the norm. * * @return vector, direction representing rotation axis and norm representing angle */