|
UFO 1.0.0
An Efficient Probabilistic 3D Mapping Framework That Embraces the Unknown
|
Rigid-body transform: a rotation matrix plus a translation vector. More...
#include <lib/numeric/include/ufo/numeric/transform.hpp>
Public Types | |
| using | size_type = std::size_t |
| using | value_type = T |
Public Member Functions | |
| constexpr | Transform () noexcept=default |
| Default constructor; initializes to the identity transform (zero translation and identity rotation). | |
| template<std::floating_point U> | |
| constexpr | Transform (Mat< Dim+1, Dim+1, U > const &m) |
Constructs from a (Dim+1) × (Dim+1) homogeneous matrix. | |
| constexpr | Transform (Mat< Dim, Dim, T > const &rotation) |
| Constructs a pure-rotation transform (zero translation). | |
| constexpr | Transform (Mat< Dim, Dim, T > const &rotation, Vec< Dim, T > const &translation) |
| Constructs from a rotation matrix and a translation vector (same scalar type). | |
| template<std::floating_point T1, std::floating_point T2> | |
| constexpr | Transform (Mat< Dim, Dim, T1 > const &rotation, Vec< Dim, T2 > const &translation) |
| Constructs from rotation and translation with potentially different scalar types. | |
| template<std::floating_point U> | |
| constexpr | Transform (Mat< Dim, Dim, U > const &rotation) |
| Constructs a pure-rotation transform from a rotation matrix of a different type. | |
| template<std::floating_point T1, std::floating_point T2> requires (Dim == 3) | |
| constexpr | Transform (Quat< T1 > const &rotation, Vec< 3, T2 > const &translation) |
| (3D only) Constructs from a quaternion and a translation vector. | |
| template<std::floating_point U> requires (Dim == 3) | |
| constexpr | Transform (Quat< U > const &rotation) |
| (3D only) Constructs a pure-rotation transform from a quaternion. | |
| template<std::floating_point T1, std::floating_point T2> requires (Dim == 2) | |
| constexpr | Transform (T1 const &angle, Vec< 2, T2 > const &translation) |
| (2D only) Constructs from a rotation angle and a translation vector. | |
| constexpr | Transform (Transform const &) noexcept=default |
| Copy constructor. | |
| template<std::floating_point U> | |
| constexpr | Transform (Transform< Dim, U > const &other) noexcept |
Converting constructor from a Transform<Dim, U> with a different scalar type. | |
| template<std::floating_point U> requires (Dim == 2) | |
| constexpr | Transform (U const &angle) |
| (2D only) Constructs a pure-rotation transform from an angle. | |
| template<std::floating_point U> | |
| constexpr | operator Mat< Dim+1, Dim+1, U > () const |
Converts to a (Dim+1) × (Dim+1) row-major homogeneous matrix. | |
| template<std::floating_point U> | |
| constexpr | operator Mat< Dim, Dim, U > () const |
Extracts the rotation component as a Dim × Dim matrix. | |
| template<std::floating_point U> requires (Dim == 3) | |
| constexpr | operator Quat< U > () const |
| (3D only) Converts the rotation component to a quaternion. | |
| template<std::floating_point U> requires (Dim == 3) | |
| constexpr Quat< U > | operator() (Quat< U > const &q) const |
| (3D only) Applies the rotation component to a quaternion. | |
| template<std::floating_point U> | |
| constexpr Vec< Dim, U > | operator() (Vec< Dim, U > const &v) const |
Applies the transform to a vector: result = R * v + t. | |
| constexpr Transform & | operator*= (Transform const &t) |
Composes this transform with t in place: *this = *this * t. | |
| constexpr Transform & | operator= (Transform const &) noexcept=default |
| Default copy assignment operator. | |
| template<std::floating_point U> | |
| constexpr Transform & | operator= (Transform< Dim, U > const &rhs) noexcept |
Converting assignment from a Transform<Dim, U> with a different scalar type. | |
| constexpr bool | operator== (Transform const &other) const noexcept=default |
| Equality comparison; two transforms are equal if their rotation and translation components are equal. | |
| constexpr T | theta () const |
(2D only) Returns the rotation angle θ in [-π, π]. | |
Public Attributes | |
| Mat< Dim, Dim, T > | rotation = Mat<Dim, Dim, T>::identity() |
Rotation component of the transform, represented as a Dim × Dim matrix. | |
| Vec< Dim, T > | translation {} |
| Translation component of the transform. | |
Rigid-body transform: a rotation matrix plus a translation vector.
| Dim | Spatial dimension; must be 2 or 3. |
| T | Floating-point scalar type (default: float). |
Applying the transform to a vector v computes R * v + t where R is the rotation matrix and t is the translation. Composition (*) follows the convention (t1 * t2)(v) = t1(t2(v)).
Definition at line 81 of file transform.hpp.
| using ufo::Transform< Dim, T >::size_type = std::size_t |
Definition at line 83 of file transform.hpp.
| using ufo::Transform< Dim, T >::value_type = T |
Definition at line 82 of file transform.hpp.
|
inlineconstexpr |
Constructs from a rotation matrix and a translation vector (same scalar type).
| [in] | rotation | Rotation component. |
| [in] | translation | Translation component. |
Definition at line 116 of file transform.hpp.
|
inlineexplicitconstexpr |
Constructs a pure-rotation transform (zero translation).
| [in] | rotation | Rotation matrix. |
Definition at line 125 of file transform.hpp.
|
inlineconstexpr |
Constructs from rotation and translation with potentially different scalar types.
| T1 | Scalar type of the rotation matrix. |
| T2 | Scalar type of the translation vector. |
| [in] | rotation | Rotation component (converted to T). |
| [in] | translation | Translation component (converted to T). |
Definition at line 136 of file transform.hpp.
|
inlineexplicitconstexpr |
Constructs a pure-rotation transform from a rotation matrix of a different type.
| U | Source scalar type. |
| [in] | rotation | Rotation matrix (converted to T). |
Definition at line 148 of file transform.hpp.
|
inlineconstexpr |
(2D only) Constructs from a rotation angle and a translation vector.
| T1 | Scalar type of the angle. |
| T2 | Scalar type of the translation vector. |
| [in] | angle | Rotation angle in radians. |
| [in] | translation | Translation vector. |
Definition at line 161 of file transform.hpp.
|
inlineexplicitconstexpr |
(2D only) Constructs a pure-rotation transform from an angle.
| U | Scalar type of the angle. |
| [in] | angle | Rotation angle in radians. |
Definition at line 176 of file transform.hpp.
|
inlineconstexpr |
(3D only) Constructs from a quaternion and a translation vector.
| T1 | Scalar type of the quaternion. |
| T2 | Scalar type of the translation vector. |
| [in] | rotation | Unit quaternion specifying the rotation. |
| [in] | translation | Translation vector. |
Definition at line 192 of file transform.hpp.
|
inlineexplicitconstexpr |
(3D only) Constructs a pure-rotation transform from a quaternion.
| U | Scalar type of the quaternion. |
| [in] | rotation | Unit quaternion specifying the rotation. |
Definition at line 204 of file transform.hpp.
|
inlineexplicitconstexpr |
Constructs from a (Dim+1) × (Dim+1) homogeneous matrix.
Extracts the upper-left Dim × Dim block as the rotation and column Dim rows 0..Dim-1 as the translation.
| U | Scalar type of the source matrix. |
| [in] | m | Row-major homogeneous transformation matrix. |
Definition at line 217 of file transform.hpp.
|
inlineexplicitconstexprnoexcept |
Converting constructor from a Transform<Dim, U> with a different scalar type.
| U | Source scalar type. |
| [in] | other | Source transform; components are converted to T. |
Definition at line 232 of file transform.hpp.
|
inlineexplicitconstexpr |
Converts to a (Dim+1) × (Dim+1) row-major homogeneous matrix.
The upper-left Dim × Dim block holds the rotation, column Dim rows 0..Dim-1 hold the translation, and m[Dim][Dim] = 1.
| U | Target scalar type. |
Definition at line 288 of file transform.hpp.
|
inlineexplicitconstexpr |
(3D only) Converts the rotation component to a quaternion.
| U | Target scalar type. |
Quat<U> representing the rotation matrix. Definition at line 305 of file transform.hpp.
|
inlineconstexpr |
(3D only) Applies the rotation component to a quaternion.
Computes Quat<U>(*this) * q, i.e., pre-multiplies q by the rotation.
| U | Scalar type of the quaternion. |
| [in] | q | Input quaternion. |
Definition at line 337 of file transform.hpp.
|
inlineconstexpr |
Composes this transform with t in place: *this = *this * t.
| [in] | t | Right-hand transform to append. |
*this. Definition at line 357 of file transform.hpp.
|
inlineconstexprnoexcept |
Converting assignment from a Transform<Dim, U> with a different scalar type.
| U | Source scalar type. |
| [in] | rhs | Source transform. |
*this. Definition at line 256 of file transform.hpp.
|
constexprdefaultnoexcept |
Equality comparison; two transforms are equal if their rotation and translation components are equal.
| [in] | other | Transform to compare with. |
true if the transforms are equal; false otherwise.
|
inlineconstexpr |
(2D only) Returns the rotation angle θ in [-π, π].
atan2(rotation[0][1], rotation[0][0]). Definition at line 346 of file transform.hpp.
| Mat<Dim, Dim, T> ufo::Transform< Dim, T >::rotation = Mat<Dim, Dim, T>::identity() |
Rotation component of the transform, represented as a Dim × Dim matrix.
Definition at line 88 of file transform.hpp.
| Vec<Dim, T> ufo::Transform< Dim, T >::translation {} |
Translation component of the transform.
Definition at line 92 of file transform.hpp.