CARLA
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
carla::geom::RightHandedTransform Struct Reference

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.
 

Detailed Description

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):

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.

Constructor & Destructor Documentation

◆ RightHandedTransform() [1/3]

carla::geom::RightHandedTransform::RightHandedTransform ( )
default

◆ RightHandedTransform() [2/3]

constexpr carla::geom::RightHandedTransform::RightHandedTransform ( const RightHandedVector3D &  in_location,
const RightHandedRotation &  in_rotation 
)
inlineconstexpr

Definition at line 50 of file RightHandedTransform.h.

◆ RightHandedTransform() [3/3]

constexpr carla::geom::RightHandedTransform::RightHandedTransform ( const RightHandedVector3D &  in_location)
inlineexplicitconstexpr

Definition at line 57 of file RightHandedTransform.h.

Member Function Documentation

◆ GetMatrix()

std::array< float, 16 > carla::geom::RightHandedTransform::GetMatrix ( ) const
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().

◆ GetQuaternion()

Quaternion carla::geom::RightHandedTransform::GetQuaternion ( ) const
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.

Referenced by TEST(), and TEST().

◆ operator!=()

bool carla::geom::RightHandedTransform::operator!= ( const RightHandedTransform &  rhs) const
inline

Definition at line 99 of file RightHandedTransform.h.

◆ operator==()

bool carla::geom::RightHandedTransform::operator== ( const RightHandedTransform &  rhs) const
inline

Member Data Documentation

◆ location

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().

◆ rotation

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().


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