|
CARLA
|
A rigid transform expressed in a right-handed frame: x forward, y left, z up (ROS REP-103 "FLU"), metres and degrees. More...
#include <RightHandedTransform.h>
Public Member Functions | |
| std::array< float, 16 > | GetMatrix () const |
Row-major 4x4 pose matrix in the right-handed frame, R = Rz(yaw) * Ry(pitch) * Rx(roll) with the standard right-handed elementary matrices and location in the last column. | |
| Quaternion | GetQuaternion () const |
Orientation as a right-handed (x, y, z, w) quaternion. | |
| bool | operator!= (const RightHandedTransform &rhs) const |
| bool | operator== (const RightHandedTransform &rhs) const |
| RightHandedTransform ()=default | |
| constexpr | RightHandedTransform (const RightHandedVector3D &in_location) |
| constexpr | RightHandedTransform (const RightHandedVector3D &in_location, const RightHandedRotation &in_rotation) |
Public Attributes | |
| RightHandedVector3D | location |
| Translation in the right-handed frame, metres. | |
| RightHandedRotation | rotation |
| Orientation in the right-handed frame: roll, pitch, yaw in degrees, right-hand rule, applied as intrinsic Z-Y-X. | |
A rigid transform expressed in a right-handed frame: x forward, y left, z up (ROS REP-103 "FLU"), metres and degrees.
This is the explicit boundary type between CARLA's left-handed world and every right-handed consumer (ROS 2 / tf2, NVIDIA ClipGT rigs, scipy, Open3D, ...). Build one with Transform::ToRightHanded() and go back with Transform::FromRightHanded(); the handedness change then happens exactly once, here, instead of being sprinkled over call sites.
Relative to the corresponding Transform, with S = diag(1, -1, 1):
location = (x, -y, z)rotation = (roll, -pitch, -yaw), intrinsic Z-Y-X, right-hand ruleGetMatrix() == S * Transform::GetMatrix() * S (with the 4x4 S)Example: Rotation(pitch=20, yaw=30, roll=10) maps to RightHandedRotation(roll=10, pitch=-20, yaw=-30).
See Docs/coordinate_conventions.md.
Definition at line 39 of file RightHandedTransform.h.
|
default |
|
inlineconstexpr |
Definition at line 50 of file RightHandedTransform.h.
|
inlineexplicitconstexpr |
Definition at line 57 of file RightHandedTransform.h.
|
inline |
Row-major 4x4 pose matrix in the right-handed frame, R = Rz(yaw) * Ry(pitch) * Rx(roll) with the standard right-handed elementary matrices and location in the last column.
Equal, element for element, to S * Transform::GetMatrix() * S with S = diag(1, -1, 1, 1) – the similarity transform that mirrors the Y axis. That identity is pinned by test_geom.cpp::right_handed_matrix_is_s_m_s.
Definition at line 77 of file RightHandedTransform.h.
References location, carla::geom::RightHandedRotation::pitch, carla::geom::RightHandedRotation::roll, rotation, carla::geom::Math::ToRadians(), carla::geom::RightHandedVector3D::x, carla::geom::RightHandedVector3D::y, carla::geom::RightHandedRotation::yaw, and carla::geom::RightHandedVector3D::z.
Referenced by TEST().
|
inline |
Orientation as a right-handed (x, y, z, w) quaternion.
Identical to what ros2::TransformFromCarlaRotation publishes for the equivalent CARLA rotation (that helper orders the components (w, x, y, z)).
Definition at line 65 of file RightHandedTransform.h.
References rotation.
|
inline |
Definition at line 99 of file RightHandedTransform.h.
|
inline |
Definition at line 92 of file RightHandedTransform.h.
References location, rotation, carla::geom::RightHandedVector3D::x, carla::geom::RightHandedVector3D::y, and carla::geom::RightHandedVector3D::z.
| RightHandedVector3D carla::geom::RightHandedTransform::location |
Translation in the right-handed frame, metres.
Definition at line 42 of file RightHandedTransform.h.
Referenced by carla::geom::Transform::FromRightHanded(), GetMatrix(), operator==(), TEST(), and TEST().
| RightHandedRotation carla::geom::RightHandedTransform::rotation |
Orientation in the right-handed frame: roll, pitch, yaw in degrees, right-hand rule, applied as intrinsic Z-Y-X.
Definition at line 46 of file RightHandedTransform.h.
Referenced by carla::geom::Transform::FromRightHanded(), GetMatrix(), GetQuaternion(), operator==(), and TEST().