wuzp
Wrong Unit? Zero Points! Compile-time checks for units, coordinate systems and points vs. vectors.
Loading...
Searching...
No Matches
wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ > Class Template Reference

A passive rotation from the coordinate system From to the coordinate system To, which have the same origin: the dimensionless passive linear transformation whose matrix R, which transforms the components v of a vector in From into its components R v in To, is orthogonal with determinant 1, R R^T = I and det(R) = 1. More...

#include <wuzp/trafo/PassiveSpatialRotation.hpp>

Inherits wuzp::PassiveTransformation< PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >, FromT_, ToT_ >.

Public Types

using LinearTransformationT
 The passive linear transformation with the matrix of the rotation, whose transformations the rotation shares.
using ValueT = ValueT_
using ValuesT = typename LinearTransformationT::ValuesT
using UnitsT = typename LinearTransformationT::UnitsT
using QuantitiesT = typename LinearTransformationT::QuantitiesT
using QuaternionT = typename ParameterizationsT::QuaternionT
 A unit quaternion (w, x, y, z) of the matrix (see ActiveSpatialRotation::QuaternionT), e.g. q_AB of the rotation from B to A.
using QuaternionDerivativeT = typename ParameterizationsT::QuaternionDerivativeT
 The derivative dq/dt of a quaternion with respect to time, in the unit of an angular velocity.
using AngleT = typename ParameterizationsT::AngleT
 An angle, e.g. of a rotation around its axis, or between two rotations.
using AxisT = typename ParameterizationsT::template AxisT<ToT_>
 The unit axis of a rotation, expressed in To. The rotation leaves its axis unchanged, so its components in From are the same.
using AngleAxisT = std::pair<AngleT, AxisT>
 The angle and the unit axis of a rotation.
using RotationVectorT = typename ParameterizationsT::template RotationVectorT<ToT_>
 A rotation vector angle * axis, expressed in To, e.g. the logarithm of a rotation or an increment of boxPlus().
using EulerAnglesT = typename ParameterizationsT::EulerAnglesT
 Three Euler angles, in the order of the axes in their name, e.g. (yaw, pitch, roll) for ZYX.
using EulerAnglesDerivativeT = typename ParameterizationsT::EulerAnglesDerivativeT
 The derivatives of three Euler angles with respect to time.
using AngularVelocityT = typename ParameterizationsT::template AngularVelocityT<ToT_>
 The angular velocity of From relative to To, expressed in To. It may also be expressed in From.
using MatrixDerivativeT = typename ParameterizationsT::MatrixDerivativeT
 The derivative dR/dt of the matrix of a rotation with respect to time.
Public Types inherited from wuzp::PassiveTransformation< PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >, FromT_, ToT_ >
using From
using To

Public Member Functions

 PassiveSpatialRotation ()
 The identity: From and To have the same axes.
template<typename... Args>
requires (sizeof...(Args) > 0 && !CopiesOrMoves<PassiveSpatialRotation, Args...>)
 PassiveSpatialRotation (Args &&... args)
 The rotation whose matrix is constructed from the arguments, e.g. its elements row by row, or its quantities.
const QuantitiesT & getQuantities () const
 The matrix R, which transforms the components v of a vector in From into its components R v in To.
auto inverse () const
 The inverse rotation, from To to From, whose matrix is the transpose R^T = R^-1: it needs no matrix inverse.
bool isValid (const ValueT tolerance=ValidityTolerance< ValueT >::value()) const
 Whether the matrix is a rotation: max_ij |(R R^T - I)_ij| <= tolerance, and det(R) > 0 (see internal::isRotation()).
template<template< typename, int, int > typename ValuesOtherT_, typename ValueOtherT_, typename FromOtherT_, typename ToOtherT_, int DimensionOtherV_>
bool isApprox (const PassiveSpatialRotation< ValuesOtherT_, ValueOtherT_, FromOtherT_, ToOtherT_, DimensionOtherV_ > &other, const ValueT precision=Precision< ValueT >::value()) const
 Whether both rotations, which must transform between the same coordinate systems, are approximately equal: their matrices are compared like the components of tensors (see Tensor::isApprox()).
QuaternionT toQuaternion () const
 The unique unit quaternion of the matrix (see ActiveSpatialRotation::toQuaternion()).
AngleAxisT toAngleAxis () const
 The angle in [0, pi] and the unit axis of the matrix (see ActiveSpatialRotation::toAngleAxis()).
RotationVectorT toRotationVector () const
 The logarithmic map Log(R) of the matrix, the rotation vector of the rotation, with an angle in [0, pi].
EulerAnglesT toEulerAnglesZyx () const
 The Euler angles ZYX of the matrix (see ActiveSpatialRotation::toEulerAnglesZyx()).
EulerAnglesT toEulerAnglesXyz () const
 The Euler angles XYZ of the matrix (see ActiveSpatialRotation::toEulerAnglesXyz()).
template<AnyTensor RotationVectorOtherT_>
PassiveSpatialRotation boxPlus (const RotationVectorOtherT_ &rotationVector) const
 The rotation whose matrix R is rotated further by the rotation vector v: Exp(v) R for v in To, which equals R Exp(v) for v in From, so that the same rotation vector gives the same result in both, like kindr's boxPlus() of C_TF with v in To.
template<typename CoordinateSystemT_ = ToT_, typename FromOtherT_, typename ToOtherT_>
auto boxMinus (const PassiveSpatialRotation< ValuesT_, ValueT_, FromOtherT_, ToOtherT_, DimensionV_ > &other) const
 The rotation vector Log(R S^T) of the matrices R of this rotation and S of the other one, expressed in To or, with the template argument From, in From: other.boxPlus(boxMinus(other)) is this rotation, like kindr's boxMinus() of C_TF in To.
template<typename FromOtherT_, typename ToOtherT_>
AngleT angularDistance (const PassiveSpatialRotation< ValuesT_, ValueT_, FromOtherT_, ToOtherT_, DimensionV_ > &other) const
 The angle in [0, pi] of the rotation between this and the other rotation, the norm of boxMinus(other), like kindr's getDisparityAngle().
template<AnyTensor AngularVelocityOtherT_>
MatrixDerivativeT matrixDerivative (const AngularVelocityOtherT_ &angularVelocity) const
 The derivative dR/dt = [w]x R of the matrix for the angular velocity w in To, which equals R [w]x for w in From, like kindr's RotationMatrixDiff.
template<typename CoordinateSystemT_ = ToT_, AnyQuantities MatrixDerivativeOtherT_>
auto angularVelocityFromMatrixDerivative (const MatrixDerivativeOtherT_ &derivative) const
 The angular velocity of the derivative dR/dt of the matrix, [w]x = dR/dt R^T in To, expressed in To or, with the template argument From, in From, the inverse of matrixDerivative().
Public Member Functions inherited from wuzp::PassiveTransformation< PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >, FromT_, ToT_ >
auto transform (ObjectT_ &&object) const
 The object in To.

Static Public Member Functions

template<typename... Args>
static PassiveSpatialRotation makeUnchecked (Args &&... args)
 The rotation whose matrix is constructed from the arguments, without checking it, like Drake's RotationMatrix::MakeUnchecked(): the caller guarantees that the matrix is a rotation, e.g. a product of rotations.
template<typename... Args>
static PassiveSpatialRotation projectToRotation (Args &&... args)
 The rotation nearest to the matrix constructed from the arguments, e.g. to a rotation whose rounding errors accumulated, by the Newton-Schulz iteration (see internal::projectToRotation()).
template<AnyQuantities QuaternionOtherT_>
static PassiveSpatialRotation fromQuaternion (const QuaternionOtherT_ &quaternion)
 The rotation of the unit quaternion q, whose matrix is that of ActiveSpatialRotation::fromQuaternion(): e.g. the quaternion q_AB of the passive rotation from B to A gives R_AB, like Drake's RotationMatrix(q_AB) and kindr's C_AB.
template<AnyQuantities AngleOtherT_, AnyTensor AxisOtherT_>
static PassiveSpatialRotation fromAngleAxis (const AngleOtherT_ &angle, const AxisOtherT_ &axis)
 The rotation whose matrix rotates by an angle around a unit axis, right-handed, which is expressed in To or in From, where its components are the same.
template<AnyTensor RotationVectorOtherT_>
static PassiveSpatialRotation fromRotationVector (const RotationVectorOtherT_ &rotationVector)
 The rotation whose matrix is the exponential map Exp(v) of the rotation vector v, which is expressed in To or in From, where its components are the same, since it is along the axis of the rotation.
template<AnyQuantities EulerAnglesOtherT_>
static PassiveSpatialRotation fromEulerAnglesZyx (const EulerAnglesOtherT_ &angles)
 The rotation whose matrix has the Euler angles ZYX (yaw, pitch, roll), R = R_z(yaw) R_y(pitch) R_x(roll) (see ActiveSpatialRotation::fromEulerAnglesZyx()), like kindr's EulerAnglesZyx.
template<AnyQuantities EulerAnglesOtherT_>
static PassiveSpatialRotation fromEulerAnglesXyz (const EulerAnglesOtherT_ &angles)
 The rotation whose matrix has the Euler angles XYZ (a0, a1, a2), R = R_x(a0) R_y(a1) R_z(a2) (see ActiveSpatialRotation::fromEulerAnglesXyz()), like kindr's EulerAnglesXyz.
template<AnyTensor FromVectorT_, AnyTensor ToVectorT_>
static PassiveSpatialRotation fromTwoVectors (const FromVectorT_ &from, const ToVectorT_ &to)
 The rotation with the smallest angle under which the direction of the vector from, expressed in From, has the direction of the vector to, expressed in To: transform(from) has the direction of to, e.g. the gravity measured by an accelerometer in From and the gravity in To.
template<AnyTensor RotationVectorOtherT_>
static auto exponentialMapJacobian (const RotationVectorOtherT_ &rotationVector)
 The Jacobian J of the exponential map at the rotation vector v, a linear map in the coordinate system of v, To or From, in which it maps the derivative of v to the angular velocity, w = J dv/dt, and in which J dv is the increment of boxPlus(), Exp(v + dv) = Exp(v).boxPlus(J dv) to first order.
template<AnyQuantities QuaternionOtherT_, AnyTensor AngularVelocityOtherT_>
static QuaternionDerivativeT quaternionDerivative (const QuaternionOtherT_ &quaternion, const AngularVelocityOtherT_ &angularVelocity)
 The derivative dq/dt = (0, w) q / 2 of the unit quaternion q for the angular velocity w in To, which equals q (0, w) / 2 for w in From, like kindr's RotationQuaternionDiff of a GlobalAngularVelocity or a LocalAngularVelocity.
template<typename CoordinateSystemT_ = ToT_, AnyQuantities QuaternionOtherT_, AnyQuantities QuaternionDerivativeOtherT_>
static auto angularVelocityFromQuaternionDerivative (const QuaternionOtherT_ &quaternion, const QuaternionDerivativeOtherT_ &derivative)
 The angular velocity of the derivative dq/dt of the unit quaternion q, expressed in To or, with the template argument From, in From, the inverse of quaternionDerivative().
template<AnyQuantities EulerAnglesOtherT_, AnyTensor AngularVelocityOtherT_>
static EulerAnglesDerivativeT eulerAnglesZyxDerivative (const EulerAnglesOtherT_ &angles, const AngularVelocityOtherT_ &angularVelocity)
 The derivatives of the Euler angles ZYX of the matrix for the angular velocity w, in To or in From, like kindr's EulerAnglesZyxDiff (see ActiveSpatialRotation::eulerAnglesZyxDerivative()).
template<typename CoordinateSystemT_ = ToT_, AnyQuantities EulerAnglesOtherT_, AnyQuantities EulerAnglesDerivativeOtherT_>
static auto angularVelocityFromEulerAnglesZyxDerivative (const EulerAnglesOtherT_ &angles, const EulerAnglesDerivativeOtherT_ &derivative)
 The angular velocity of the derivatives of the Euler angles ZYX of the matrix, expressed in To or, with the template argument From, in From, the inverse of eulerAnglesZyxDerivative().
template<AnyQuantities EulerAnglesOtherT_, AnyTensor AngularVelocityOtherT_>
static EulerAnglesDerivativeT eulerAnglesXyzDerivative (const EulerAnglesOtherT_ &angles, const AngularVelocityOtherT_ &angularVelocity)
 The derivatives of the Euler angles XYZ of the matrix for the angular velocity w, in To or in From, like kindr's EulerAnglesXyzDiff (see ActiveSpatialRotation::eulerAnglesXyzDerivative()).
template<typename CoordinateSystemT_ = ToT_, AnyQuantities EulerAnglesOtherT_, AnyQuantities EulerAnglesDerivativeOtherT_>
static auto angularVelocityFromEulerAnglesXyzDerivative (const EulerAnglesOtherT_ &angles, const EulerAnglesDerivativeOtherT_ &derivative)
 The angular velocity of the derivatives of the Euler angles XYZ of the matrix, expressed in To or, with the template argument From, in From, the inverse of eulerAnglesXyzDerivative().

Detailed Description

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
requires AnyValueMatrix<ValuesT_>
class wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >

A passive rotation from the coordinate system From to the coordinate system To, which have the same origin: the dimensionless passive linear transformation whose matrix R, which transforms the components v of a vector in From into its components R v in To, is orthogonal with determinant 1, R R^T = I and det(R) = 1.

Orthogonality is defined by the Euclidean metric, so From and To must be Euclidean (EuclideanCoordinateSystem, see Metric); between Minkowski coordinate systems, a spatial rotation is a LorentzTransformation. Its rows are the basis vectors of To, expressed in From. It transforms the same tensors as the passive linear transformation with its matrix (see PassiveLinearTransformation). It composes with rotations into rotations, with linear transformations into linear transformations, with Jacobians into Jacobians, and with translations and proper rigid transformations into proper rigid transformations (see CompositionTraits). Its inverse, from To to From, is its transpose, which every value matrix backend provides, also for integer matrices, and with which it transforms covectors and tensors with lower indices. In debug builds, i.e. if NDEBUG is not defined, the constructors check that the matrix is a rotation (see isValid()), like Drake's RotationMatrix (https://drake.mit.edu/doxygen_cxx/classdrake_1_1math_1_1_rotation_matrix.html): they throw std::invalid_argument if it is not, e.g. for a shear, a scaling or a reflection. Release builds do not check. makeUnchecked() skips the check, e.g. in hot paths, and projectToRotation() computes the rotation nearest to a matrix, e.g. to one whose rounding errors accumulated. In three dimensions, a rotation converts from and to unit quaternions, angle-axis, rotation vectors and Euler angles ZYX and XYZ, has the manifold operations boxPlus(), boxMinus() and angularDistance(), and maps between its angular velocity and the time derivatives of its matrix, its quaternion and its Euler angles, like ActiveSpatialRotation. Its parameters describe its matrix R in the convention of robotics, like those of the active rotation with the same matrix: e.g. the quaternion q_AB of the passive rotation from B to A gives R_AB = R(q_AB), the orientation of B relative to A, like Drake's RotationMatrix R_AB (https://drake.mit.edu/doxygen_cxx/group__multibody__notation.html) and kindr's C_AB. Its angular velocity w is that of From relative to To, dR/dt = [w]x R for w expressed in To and R [w]x for w expressed in From, which replaces kindr's global (To) and local (From) angular velocities (see "Parameterizations of rotations" in DESIGN.md and docs/conventions.md). These need floating-point values.

Definition at line 53 of file PassiveSpatialRotation.hpp.

Member Typedef Documentation

◆ AngleAxisT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
using wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::AngleAxisT = std::pair<AngleT, AxisT>

The angle and the unit axis of a rotation.

Definition at line 78 of file PassiveSpatialRotation.hpp.

◆ AngleT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
using wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::AngleT = typename ParameterizationsT::AngleT

An angle, e.g. of a rotation around its axis, or between two rotations.

Definition at line 74 of file PassiveSpatialRotation.hpp.

◆ AngularVelocityT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
using wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::AngularVelocityT = typename ParameterizationsT::template AngularVelocityT<ToT_>

The angular velocity of From relative to To, expressed in To. It may also be expressed in From.

Definition at line 87 of file PassiveSpatialRotation.hpp.

◆ AxisT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
using wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::AxisT = typename ParameterizationsT::template AxisT<ToT_>

The unit axis of a rotation, expressed in To. The rotation leaves its axis unchanged, so its components in From are the same.

Definition at line 76 of file PassiveSpatialRotation.hpp.

◆ EulerAnglesDerivativeT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
using wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::EulerAnglesDerivativeT = typename ParameterizationsT::EulerAnglesDerivativeT

The derivatives of three Euler angles with respect to time.

Definition at line 85 of file PassiveSpatialRotation.hpp.

◆ EulerAnglesT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
using wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::EulerAnglesT = typename ParameterizationsT::EulerAnglesT

Three Euler angles, in the order of the axes in their name, e.g. (yaw, pitch, roll) for ZYX.

They are not a vector, so they have no coordinate system.

Definition at line 83 of file PassiveSpatialRotation.hpp.

◆ LinearTransformationT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
using wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::LinearTransformationT
Initial value:
PassiveLinearTransformation<ValuesT_, ValueT_, FromT_, ToT_, DimensionV_,
A passive linear transformation, i.e. a change of basis, from the coordinate system From to the coord...
The units for values of the arithmetic type ValueT_, e.g. double, specialized for AccessImplementatio...
Definition traits.hpp:338

The passive linear transformation with the matrix of the rotation, whose transformations the rotation shares.

Definition at line 62 of file PassiveSpatialRotation.hpp.

◆ MatrixDerivativeT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
using wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::MatrixDerivativeT = typename ParameterizationsT::MatrixDerivativeT

The derivative dR/dt of the matrix of a rotation with respect to time.

Definition at line 89 of file PassiveSpatialRotation.hpp.

◆ QuantitiesT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
using wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::QuantitiesT = typename LinearTransformationT::QuantitiesT

Definition at line 67 of file PassiveSpatialRotation.hpp.

◆ QuaternionDerivativeT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
using wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::QuaternionDerivativeT = typename ParameterizationsT::QuaternionDerivativeT

The derivative dq/dt of a quaternion with respect to time, in the unit of an angular velocity.

Definition at line 72 of file PassiveSpatialRotation.hpp.

◆ QuaternionT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
using wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::QuaternionT = typename ParameterizationsT::QuaternionT

A unit quaternion (w, x, y, z) of the matrix (see ActiveSpatialRotation::QuaternionT), e.g. q_AB of the rotation from B to A.

Definition at line 70 of file PassiveSpatialRotation.hpp.

◆ RotationVectorT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
using wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::RotationVectorT = typename ParameterizationsT::template RotationVectorT<ToT_>

A rotation vector angle * axis, expressed in To, e.g. the logarithm of a rotation or an increment of boxPlus().

Definition at line 80 of file PassiveSpatialRotation.hpp.

◆ UnitsT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
using wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::UnitsT = typename LinearTransformationT::UnitsT

Definition at line 66 of file PassiveSpatialRotation.hpp.

◆ ValuesT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
using wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::ValuesT = typename LinearTransformationT::ValuesT

Definition at line 65 of file PassiveSpatialRotation.hpp.

◆ ValueT

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
using wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::ValueT = ValueT_

Definition at line 64 of file PassiveSpatialRotation.hpp.

Constructor & Destructor Documentation

◆ PassiveSpatialRotation() [1/2]

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::PassiveSpatialRotation ( )
inline

The identity: From and To have the same axes.

Definition at line 92 of file PassiveSpatialRotation.hpp.

◆ PassiveSpatialRotation() [2/2]

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
template<typename... Args>
requires (sizeof...(Args) > 0 && !CopiesOrMoves<PassiveSpatialRotation, Args...>)
wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::PassiveSpatialRotation ( Args &&... args)
inlineexplicit

The rotation whose matrix is constructed from the arguments, e.g. its elements row by row, or its quantities.

Copies and moves are left to the implicit constructors, see CopiesOrMoves.

Exceptions
std::invalid_argumentIn debug builds, if the matrix is not a rotation (see isValid()).

Definition at line 99 of file PassiveSpatialRotation.hpp.

Member Function Documentation

◆ angularDistance()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
template<typename FromOtherT_, typename ToOtherT_>
AngleT wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::angularDistance ( const PassiveSpatialRotation< ValuesT_, ValueT_, FromOtherT_, ToOtherT_, DimensionV_ > & other) const
inline

The angle in [0, pi] of the rotation between this and the other rotation, the norm of boxMinus(other), like kindr's getDisparityAngle().

Definition at line 265 of file PassiveSpatialRotation.hpp.

◆ angularVelocityFromEulerAnglesXyzDerivative()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
template<typename CoordinateSystemT_ = ToT_, AnyQuantities EulerAnglesOtherT_, AnyQuantities EulerAnglesDerivativeOtherT_>
auto wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::angularVelocityFromEulerAnglesXyzDerivative ( const EulerAnglesOtherT_ & angles,
const EulerAnglesDerivativeOtherT_ & derivative )
inlinestatic

The angular velocity of the derivatives of the Euler angles XYZ of the matrix, expressed in To or, with the template argument From, in From, the inverse of eulerAnglesXyzDerivative().

Definition at line 368 of file PassiveSpatialRotation.hpp.

◆ angularVelocityFromEulerAnglesZyxDerivative()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
template<typename CoordinateSystemT_ = ToT_, AnyQuantities EulerAnglesOtherT_, AnyQuantities EulerAnglesDerivativeOtherT_>
auto wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::angularVelocityFromEulerAnglesZyxDerivative ( const EulerAnglesOtherT_ & angles,
const EulerAnglesDerivativeOtherT_ & derivative )
inlinestatic

The angular velocity of the derivatives of the Euler angles ZYX of the matrix, expressed in To or, with the template argument From, in From, the inverse of eulerAnglesZyxDerivative().

Definition at line 346 of file PassiveSpatialRotation.hpp.

◆ angularVelocityFromMatrixDerivative()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
template<typename CoordinateSystemT_ = ToT_, AnyQuantities MatrixDerivativeOtherT_>
auto wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::angularVelocityFromMatrixDerivative ( const MatrixDerivativeOtherT_ & derivative) const
inline

The angular velocity of the derivative dR/dt of the matrix, [w]x = dR/dt R^T in To, expressed in To or, with the template argument From, in From, the inverse of matrixDerivative().

Definition at line 305 of file PassiveSpatialRotation.hpp.

◆ angularVelocityFromQuaternionDerivative()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
template<typename CoordinateSystemT_ = ToT_, AnyQuantities QuaternionOtherT_, AnyQuantities QuaternionDerivativeOtherT_>
auto wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::angularVelocityFromQuaternionDerivative ( const QuaternionOtherT_ & quaternion,
const QuaternionDerivativeOtherT_ & derivative )
inlinestatic

The angular velocity of the derivative dq/dt of the unit quaternion q, expressed in To or, with the template argument From, in From, the inverse of quaternionDerivative().

Definition at line 325 of file PassiveSpatialRotation.hpp.

◆ boxMinus()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
template<typename CoordinateSystemT_ = ToT_, typename FromOtherT_, typename ToOtherT_>
auto wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::boxMinus ( const PassiveSpatialRotation< ValuesT_, ValueT_, FromOtherT_, ToOtherT_, DimensionV_ > & other) const
inline

The rotation vector Log(R S^T) of the matrices R of this rotation and S of the other one, expressed in To or, with the template argument From, in From: other.boxPlus(boxMinus(other)) is this rotation, like kindr's boxMinus() of C_TF in To.

Definition at line 255 of file PassiveSpatialRotation.hpp.

◆ boxPlus()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
template<AnyTensor RotationVectorOtherT_>
PassiveSpatialRotation wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::boxPlus ( const RotationVectorOtherT_ & rotationVector) const
inline

The rotation whose matrix R is rotated further by the rotation vector v: Exp(v) R for v in To, which equals R Exp(v) for v in From, so that the same rotation vector gives the same result in both, like kindr's boxPlus() of C_TF with v in To.

Definition at line 246 of file PassiveSpatialRotation.hpp.

◆ eulerAnglesXyzDerivative()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
template<AnyQuantities EulerAnglesOtherT_, AnyTensor AngularVelocityOtherT_>
EulerAnglesDerivativeT wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::eulerAnglesXyzDerivative ( const EulerAnglesOtherT_ & angles,
const AngularVelocityOtherT_ & angularVelocity )
inlinestatic

The derivatives of the Euler angles XYZ of the matrix for the angular velocity w, in To or in From, like kindr's EulerAnglesXyzDiff (see ActiveSpatialRotation::eulerAnglesXyzDerivative()).

Definition at line 358 of file PassiveSpatialRotation.hpp.

◆ eulerAnglesZyxDerivative()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
template<AnyQuantities EulerAnglesOtherT_, AnyTensor AngularVelocityOtherT_>
EulerAnglesDerivativeT wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::eulerAnglesZyxDerivative ( const EulerAnglesOtherT_ & angles,
const AngularVelocityOtherT_ & angularVelocity )
inlinestatic

The derivatives of the Euler angles ZYX of the matrix for the angular velocity w, in To or in From, like kindr's EulerAnglesZyxDiff (see ActiveSpatialRotation::eulerAnglesZyxDerivative()).

Definition at line 336 of file PassiveSpatialRotation.hpp.

◆ exponentialMapJacobian()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
template<AnyTensor RotationVectorOtherT_>
auto wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::exponentialMapJacobian ( const RotationVectorOtherT_ & rotationVector)
inlinestatic

The Jacobian J of the exponential map at the rotation vector v, a linear map in the coordinate system of v, To or From, in which it maps the derivative of v to the angular velocity, w = J dv/dt, and in which J dv is the increment of boxPlus(), Exp(v + dv) = Exp(v).boxPlus(J dv) to first order.

In To, it is the left Jacobian J_l(v) (see ActiveSpatialRotation::exponentialMapJacobian()), and in From the right Jacobian J_r(v) = J_l(-v) = J_l(v)^T = R^T J_l(v) (SolĂ , Deray and Atchuthan, "A micro Lie theory for state estimation in robotics", https://arxiv.org/abs/1812.01537, eqs. 143 and 145). The components of v are the same in both.

Definition at line 280 of file PassiveSpatialRotation.hpp.

◆ fromAngleAxis()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
template<AnyQuantities AngleOtherT_, AnyTensor AxisOtherT_>
PassiveSpatialRotation wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::fromAngleAxis ( const AngleOtherT_ & angle,
const AxisOtherT_ & axis )
inlinestatic

The rotation whose matrix rotates by an angle around a unit axis, right-handed, which is expressed in To or in From, where its components are the same.

Exceptions
std::invalid_argumentIn debug builds, if the axis does not have unit length (see ActiveSpatialRotation::fromAngleAxis()).

Definition at line 169 of file PassiveSpatialRotation.hpp.

◆ fromEulerAnglesXyz()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
template<AnyQuantities EulerAnglesOtherT_>
PassiveSpatialRotation wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::fromEulerAnglesXyz ( const EulerAnglesOtherT_ & angles)
inlinestatic

The rotation whose matrix has the Euler angles XYZ (a0, a1, a2), R = R_x(a0) R_y(a1) R_z(a2) (see ActiveSpatialRotation::fromEulerAnglesXyz()), like kindr's EulerAnglesXyz.

Definition at line 215 of file PassiveSpatialRotation.hpp.

◆ fromEulerAnglesZyx()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
template<AnyQuantities EulerAnglesOtherT_>
PassiveSpatialRotation wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::fromEulerAnglesZyx ( const EulerAnglesOtherT_ & angles)
inlinestatic

The rotation whose matrix has the Euler angles ZYX (yaw, pitch, roll), R = R_z(yaw) R_y(pitch) R_x(roll) (see ActiveSpatialRotation::fromEulerAnglesZyx()), like kindr's EulerAnglesZyx.

Definition at line 201 of file PassiveSpatialRotation.hpp.

◆ fromQuaternion()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
template<AnyQuantities QuaternionOtherT_>
PassiveSpatialRotation wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::fromQuaternion ( const QuaternionOtherT_ & quaternion)
inlinestatic

The rotation of the unit quaternion q, whose matrix is that of ActiveSpatialRotation::fromQuaternion(): e.g. the quaternion q_AB of the passive rotation from B to A gives R_AB, like Drake's RotationMatrix(q_AB) and kindr's C_AB.

Exceptions
std::invalid_argumentIn debug builds, if the quaternion does not have unit length (see ActiveSpatialRotation::fromQuaternion()).

Definition at line 151 of file PassiveSpatialRotation.hpp.

◆ fromRotationVector()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
template<AnyTensor RotationVectorOtherT_>
PassiveSpatialRotation wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::fromRotationVector ( const RotationVectorOtherT_ & rotationVector)
inlinestatic

The rotation whose matrix is the exponential map Exp(v) of the rotation vector v, which is expressed in To or in From, where its components are the same, since it is along the axis of the rotation.

Definition at line 187 of file PassiveSpatialRotation.hpp.

◆ fromTwoVectors()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
template<AnyTensor FromVectorT_, AnyTensor ToVectorT_>
PassiveSpatialRotation wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::fromTwoVectors ( const FromVectorT_ & from,
const ToVectorT_ & to )
inlinestatic

The rotation with the smallest angle under which the direction of the vector from, expressed in From, has the direction of the vector to, expressed in To: transform(from) has the direction of to, e.g. the gravity measured by an accelerometer in From and the gravity in To.

Its matrix is that of ActiveSpatialRotation::fromTwoVectors(), like kindr's C_TF.setFromVectors(from, to).

Exceptions
std::invalid_argumentIn debug builds, if a vector is zero, so that it has no direction (see isValid()).

Definition at line 234 of file PassiveSpatialRotation.hpp.

◆ getQuantities()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
const QuantitiesT & wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::getQuantities ( ) const
inline

The matrix R, which transforms the components v of a vector in From into its components R v in To.

Definition at line 120 of file PassiveSpatialRotation.hpp.

◆ inverse()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
auto wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::inverse ( ) const
inline

The inverse rotation, from To to From, whose matrix is the transpose R^T = R^-1: it needs no matrix inverse.

Definition at line 123 of file PassiveSpatialRotation.hpp.

◆ isApprox()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
template<template< typename, int, int > typename ValuesOtherT_, typename ValueOtherT_, typename FromOtherT_, typename ToOtherT_, int DimensionOtherV_>
bool wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::isApprox ( const PassiveSpatialRotation< ValuesOtherT_, ValueOtherT_, FromOtherT_, ToOtherT_, DimensionOtherV_ > & other,
const ValueT precision = Precision<ValueT>::value() ) const
inline

Whether both rotations, which must transform between the same coordinate systems, are approximately equal: their matrices are compared like the components of tensors (see Tensor::isApprox()).

Definition at line 135 of file PassiveSpatialRotation.hpp.

◆ isValid()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
bool wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::isValid ( const ValueT tolerance = ValidityTolerance<ValueT>::value()) const
inline

Whether the matrix is a rotation: max_ij |(R R^T - I)_ij| <= tolerance, and det(R) > 0 (see internal::isRotation()).

The constructors check it in debug builds, with the tolerance ValidityTolerance.

Definition at line 127 of file PassiveSpatialRotation.hpp.

◆ makeUnchecked()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
template<typename... Args>
PassiveSpatialRotation wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::makeUnchecked ( Args &&... args)
inlinestatic

The rotation whose matrix is constructed from the arguments, without checking it, like Drake's RotationMatrix::MakeUnchecked(): the caller guarantees that the matrix is a rotation, e.g. a product of rotations.

Definition at line 106 of file PassiveSpatialRotation.hpp.

◆ matrixDerivative()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
template<AnyTensor AngularVelocityOtherT_>
MatrixDerivativeT wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::matrixDerivative ( const AngularVelocityOtherT_ & angularVelocity) const
inline

The derivative dR/dt = [w]x R of the matrix for the angular velocity w in To, which equals R [w]x for w in From, like kindr's RotationMatrixDiff.

Definition at line 296 of file PassiveSpatialRotation.hpp.

◆ projectToRotation()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
template<typename... Args>
PassiveSpatialRotation wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::projectToRotation ( Args &&... args)
inlinestatic

The rotation nearest to the matrix constructed from the arguments, e.g. to a rotation whose rounding errors accumulated, by the Newton-Schulz iteration (see internal::projectToRotation()).

Exceptions
std::invalid_argumentIn every build, if the matrix A is not close enough to a rotation, i.e. ||I - A^T A|| is not smaller than 1 in the Frobenius norm, or if its determinant is not positive.

Definition at line 115 of file PassiveSpatialRotation.hpp.

◆ quaternionDerivative()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
template<AnyQuantities QuaternionOtherT_, AnyTensor AngularVelocityOtherT_>
QuaternionDerivativeT wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::quaternionDerivative ( const QuaternionOtherT_ & quaternion,
const AngularVelocityOtherT_ & angularVelocity )
inlinestatic

The derivative dq/dt = (0, w) q / 2 of the unit quaternion q for the angular velocity w in To, which equals q (0, w) / 2 for w in From, like kindr's RotationQuaternionDiff of a GlobalAngularVelocity or a LocalAngularVelocity.

Definition at line 315 of file PassiveSpatialRotation.hpp.

◆ toAngleAxis()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
AngleAxisT wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::toAngleAxis ( ) const
inline

The angle in [0, pi] and the unit axis of the matrix (see ActiveSpatialRotation::toAngleAxis()).

Definition at line 178 of file PassiveSpatialRotation.hpp.

◆ toEulerAnglesXyz()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
EulerAnglesT wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::toEulerAnglesXyz ( ) const
inline

The Euler angles XYZ of the matrix (see ActiveSpatialRotation::toEulerAnglesXyz()).

Definition at line 221 of file PassiveSpatialRotation.hpp.

◆ toEulerAnglesZyx()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
EulerAnglesT wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::toEulerAnglesZyx ( ) const
inline

The Euler angles ZYX of the matrix (see ActiveSpatialRotation::toEulerAnglesZyx()).

Definition at line 207 of file PassiveSpatialRotation.hpp.

◆ toQuaternion()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
QuaternionT wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::toQuaternion ( ) const
inline

The unique unit quaternion of the matrix (see ActiveSpatialRotation::toQuaternion()).

Definition at line 159 of file PassiveSpatialRotation.hpp.

◆ toRotationVector()

template<template< typename, int, int > typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FromT_, EuclideanCoordinateSystem ToT_, int DimensionV_>
RotationVectorT wuzp::PassiveSpatialRotation< ValuesT_, ValueT_, FromT_, ToT_, DimensionV_ >::toRotationVector ( ) const
inline

The logarithmic map Log(R) of the matrix, the rotation vector of the rotation, with an angle in [0, pi].

Definition at line 193 of file PassiveSpatialRotation.hpp.


The documentation for this class was generated from the following file: