Kindr Kinematics and Dynamics for Robotics
Time Derivatives of Rotations

This library defines an interface for time derivatives of rotations to enable different representations of the time derivative (angular velocity, time derivatives of Euler angles, time derivative of quaternion, etc.). The section Interface describes the functionalities, whereas the section Parameterization shows some examples.

Generic Interface

The class kindr::RotationDiffBase serves as an interface for the time derivative of a rotation. All types of representations of a time derivative of a rotation, such as angular velocity and time derivatives of Euler angles, are derived from this base class.

Type of a Time Derivative of a Rotation

The type of a rotation is defined by

• the kind of parameterization (derivative of quaternion, rotation matrix, etc.),
• the primitive data type of the parameters (float/double, etc.) and

Construction of a Time Derivative of a Rotation

The default constructor always initializes all derivatives with zero.

Zero Time Derivatives

All derivatives can be set to zero by the function setZero().

Addition and subtraction of the time derivatives are provided by the kindr::RotationDiffBase::operator+ and kindr::RotationDiffBase::operator-, respectively.

Conversion between Time Derivatives of Rotations

There are three kinds of conversions:

• Conversion between different representations, i.e. between different parameterizations (e.g. rotation quaternion - angle-axis)
• Conversion between different primitive data types (e.g. float - double)

Conversion between Representations

The following methods allow to convert between different representations of a rotation:

LocalAngularVelocityD angularVelocity; // representation of the time derivative
RotationQuaternionD rotationQuaternion; // the rotation the derivative is taken
RotationQuaternionDiffD rotationQuaternionDiff(rotationQuaternion, angularVelocity); // convert using the constructor
rotationQuaternionDiff = angularVelocity.cast<RotationQuaternionDiffD>(rotationQuaternion); // convert using the cast method

Conversion between Primitive Data Types

Not yet supported.

Representations of Time Derivatives of Rotations

The following representations are currently provided by the library:

Local Angular Velocity

The class kindr::LocalAngularVelocity implements the local angular velocity in 3D-Space. The angular velocity expressed in body-fixed frame can be stated as: It stores the three coordinates of the angular velocity in Eigen::Matrix<PrimType, 3, 1>.

The following two typedefs are provided for convenience:

• AngularVelocityD for primitive type double
• AngularVelocityF for primitive type float

An angular velocity can be created as follows:

double w_x = 1.0;
double w_y = 2.0;
double w_z = 3.0;
LocalAngularVelocityD velocity1(); // creates a 3D-Velocity with all coordinates equal to zero
LocalAngularVelocityD velocity2(w_x, w_y, w_z); // initializes the three coordinates
LocalAngularVelocityD velocity3(Eigen::Vector3d(w_x, w_y, w_z)); // creates a velocity from an Eigen vector

The coordinates can be obtained as follows:

w_x = velocity1.x();
w_y = velocity1.y();
w_z = velocity1.z();
Eigen::Vector3d vector = velocity1.toImplementation(); // [w_x;w_y;w_z]

Operations with angular velocities:

LocalAngularVelocityD velocity4 = velocity1 + velocity2; // addition
LocalAngularVelocityD velocity3 -= velocity1; // subtraction
std::cout << "Velocity 3 is: " << velocity3; // print velocity

Time Derivative of Rotation Quaternion

The class kindr::RotationQuaternionDiff implements the time derivative of a Hamiltonian unit quaternion representation of a rotation: Time Derivative of Rotation Matrix

The class kindr::RotationMatrixDiff implements the time derivative of a 3x3 rotation matrix representation of a rotation: Time derivative of Euler Angles ZYX

The class kindr::EulerAnglesZyxDiff implements the time derivatives of the Euler angles with the Z-Y-X convention: where is the time derivative of the yaw angle, is the time derivative of the pitch angle, and is the time derivative of the roll angle.

Time Derivative of Euler Angles XYZ

The class kindr::EulerAnglesXyzDiff implements the time derivatives of the Euler angles with the X-Y-Z convention: where is the time derivative of the yaw angle, is the time derivative of the pitch angle, and is the time derivative of the roll angle.