Class SpatialVector

Class Documentation

class SpatialVector

Public Functions

inline SpatialVector()
inline explicit SpatialVector(const Eigen::Vector3d &position)
inline SpatialVector(const Eigen::Vector3d &position, const Eigen::Quaterniond &orientation)
~SpatialVector() = default
inline const Eigen::Vector3d &getPosition() const
inline const Eigen::Quaterniond &getOrientation() const
Eigen::Vector3d getOrientationEuler() const

Returns the internal quaternion converted to euler angles [yaw, pitch, roll].

Returns:

Eigen::Vector3d The euler angles representing the orientation as [yaw, pitch, roll]

inline void setPosition(const Eigen::Vector3d &position)
void setOrientation(const Eigen::Quaterniond &orientation)

Set the orientation of the spatial vector using an Eigen::Quaterniond.

Note

The quaternion is normalized upon setting to maintain validity.

Parameters:

orientation – The Eigen::Quaterniond representing the orientation

void setOrientationEuler(double yaw, double pitch, double roll)

Sets the internal quaternion rotation given an euler angle representation.

Note

That euler angles are represented with the intrinsic order [Z→Y→X] = [yaw, pitch, roll]

Parameters:
  • yaw – The rotation around the Z-axis [rad]

  • pitch – The rotation around the Y-axis [rad]

  • roll – The rotation around the X-axis [rad]

void normalizePosition()
double euclideanDistance(const SpatialVector &other) const

Computes the euclidean distance between this spatial vector’s position and the other spatial vector’s position.

Parameters:

other – the other spatial vector to compare its position

Returns:

double the euclidean distance in the same units as the position vector [m]

double angularDistance(const SpatialVector &other) const

Returns the geodesic (angular) distance between this spatial vector’s orientation and the other spatial vector’s orientation.

Note

The distance is in radians and bounded by [0, pi]

Parameters:

other – the other spatial vector to compare its orientation

Returns:

double the geodesic distance [rad]

inline bool operator==(const SpatialVector &other) const
inline bool operator!=(const SpatialVector &other) const