Class RotationVector#

Class Documentation#

class RotationVector#

The (n * theta) Rotation Vector attitude representation minimal coordinate representation for orientations, where n is a unit vector, and theta is an angle. See.

Pose representations section for more discussion on attitude representations.

It is recommended that the angle be in [0, PI] range to preserve 1-1 mapping in the space of orientations, and to stay from singularities at multiples of 2*PI. There is however no angle range restriction imposed in this class. This is the representation used for exponential map representations of orientation.

Public Functions

RotationVector()#

Default constructor

RotationVector(const Vec3 &vec)#

Constructor from 3 vector.

Parameters:

vec – the 3-vector of coefficients

RotationVector(const RotationVector &rv)#

Copy constructor.

Parameters:

rv – Other RotationVector to copy from.

RotationVector &operator=(const RotationVector &other)#

Copy assignment operator.

Parameters:

other – Other RotationVector to copy from.

Returns:

Reference to this object.

RotationVector(RotationVector &&rv) noexcept#

Move constructor.

Parameters:

rvRotationVector to move from.

RotationVector &operator=(RotationVector &&other) noexcept#

Move assignment operator.

Parameters:

otherRotationVector to move from.

Returns:

Reference to this object.

bool operator==(const RotationVector &other) const#

Equality operator.

Parameters:

otherRotationVector to compare with.

Returns:

True if equal, false otherwise.

bool isApprox(const RotationVector &other, double prec = MATH_EPSILON)#

Approximate equality check.

Parameters:
  • otherRotationVector to compare with.

  • prec – Precision threshold.

Returns:

True if approximately equal, false otherwise.

std::string_view typeString() const#

Get the type string of this class.

Returns:

“RotationVector”

double angle() const#

Return rotation angle.

Returns:

The rotation angle.

Vec3 unitAxis() const#

Return the unit axis of rotation.

Returns:

The unit axis of rotation.

const Vec3 &toVec3() const#

Return the RotationVector as a Vec3.

Returns:

This RotationVector as a Vec3.

void makeNotReady()#

Mark this RotationVector as not ready.

bool isReady() const#

Check whether this RotationVector is initialized.

Returns:

True if initialized, false otherwise.

Vec3 ratesToOmega(const Vec3 &rates, bool oframe) const#

Compute the angular velocity from coeff rates.

Parameters:
  • rates – The 3-vector with coefficient rates.

  • oframe – If true, the angular velocity is in the ‘from’ frame, else in the ‘to’ frame.

Returns:

The angular velocity that corresponds to the rates.

Vec3 omegaToRates(const Vec3 &omega, bool oframe) const#

Compute the coeff rates from the angular velocity.

Parameters:
  • omega – The 3-vector angular velocity.

  • oframe – If true, the angular velocity is in the ‘from’ frame, else in the ‘to’ frame.

Returns:

The coefficient rates from the omega angular velocity

Mat33 ratesToOmegaMap(bool oframe) const#

The 3x3 matrix that maps the coefficient rates to the angular velocity.

Parameters:

oframe – If true, the angular velocity is in the ‘from’ frame, else the ‘to’ frame.

Returns:

The 3x3 matrix map

Mat33 omegaToRatesMap(bool oframe) const#

The 3x3 matrix that maps the angular velocity to the coefficient rates.

Parameters:

oframe – If true, the angular velocity is in the ‘from’ frame, else the ‘to’ frame

Returns:

The 3x3 matrix map

Mat ratesToQuatRatesMap() const#

The 4x3 matrix that maps the rotation vector rates to quaternion rates.

Returns:

The 4x3 matrix map.

std::string dumpString(std::string_view prefix = "", unsigned int precision = 10, bool exponential = false) const#

Get a string representation of the RotationVector.

Parameters:
  • prefix – String prefix for each line.

  • precision – Number of digits to use for floating point values.

  • exponential – Use exponential notation if true.

Returns:

String with information about this RotationVector.