CARLA
Loading...
Searching...
No Matches
Transform Class Reference

A rigid transform in CARLA's / Unreal's left-handed frame: x forward, y right, z up, metres, with a Rotation in degrees. More...

#include <Transform.h>

Public Member Functions

Vector3D GetForwardVector () const
std::array< float, 16 > GetInverseMatrix () const
 Computes the 4-matrix form of the inverse transformation.
std::array< float, 16 > GetMatrix () const
 Computes the 4-matrix form of the transformation.
Vector3D GetRightVector () const
Vector3D GetUpVector () const
void InverseTransformPoint (Vector3D &in_point) const
 Applies the inverse of this transformation to in_point.
 MSGPACK_DEFINE_ARRAY (location, rotation)
 operator FTransform () const
bool operator!= (const Transform &rhs) const
bool operator== (const Transform &rhs) const
constexpr RightHandedTransform ToRightHanded () const
 This transform expressed in a right-handed, x-forward / y-**left** / z-up frame (ROS REP-103 "FLU").
 Transform ()=default
 Transform (const FTransform &transform)
 Transform (const Location &in_location)
constexpr Transform (const Location &in_location, const Rotation &in_rotation)
void TransformPoint (Vector3D &in_point) const
 Applies this transformation to in_point (first translation then rotation).
void TransformVector (Vector3D &in_vector) const
 Applies this transformation to in_vector (rotation only).

Static Public Member Functions

static constexpr Transform FromRightHanded (const RightHandedTransform &rhs)
 Inverse of ToRightHanded(): reads a right-handed (FLU) pose back into CARLA's left-handed frame.

Public Attributes

Location location
Rotation rotation

Detailed Description

A rigid transform in CARLA's / Unreal's left-handed frame: x forward, y right, z up, metres, with a Rotation in degrees.

GetMatrix(), GetForwardVector() and friends are all in that frame – they are not "uncorrected" right-handed math and must not be flipped. To hand a pose to a ROS / REP-103 consumer, convert explicitly with ToRightHanded(); see RightHandedTransform and Docs/coordinate_conventions.md.

Definition at line 32 of file geom/Transform.h.

Constructor & Destructor Documentation

◆ Transform() [1/4]

◆ Transform() [2/4]

carla::geom::Transform::Transform ( const Location & in_location)
inline

Definition at line 51 of file geom/Transform.h.

◆ Transform() [3/4]

carla::geom::Transform::Transform ( const Location & in_location,
const Rotation & in_rotation )
inlineconstexpr

Definition at line 55 of file geom/Transform.h.

◆ Transform() [4/4]

carla::geom::Transform::Transform ( const FTransform & transform)
inline

Definition at line 195 of file geom/Transform.h.

Member Function Documentation

◆ FromRightHanded()

constexpr Transform carla::geom::Transform::FromRightHanded ( const RightHandedTransform & rhs)
inlinestaticconstexpr

Inverse of ToRightHanded(): reads a right-handed (FLU) pose back into CARLA's left-handed frame.

The mapping is an involution.

Definition at line 171 of file geom/Transform.h.

Referenced by TEST().

◆ GetForwardVector()

Vector3D carla::geom::Transform::GetForwardVector ( ) const
inline

Definition at line 63 of file geom/Transform.h.

Referenced by FCarlaServer::FPimpl::BindActions().

◆ GetInverseMatrix()

std::array< float, 16 > carla::geom::Transform::GetInverseMatrix ( ) const
inline

Computes the 4-matrix form of the inverse transformation.

Rows are the transpose of the forward rotation; translation component pulled from InverseTransformPoint(origin) to keep both helpers consistent.

Definition at line 128 of file geom/Transform.h.

◆ GetMatrix()

std::array< float, 16 > carla::geom::Transform::GetMatrix ( ) const
inline

Computes the 4-matrix form of the transformation.

Sign convention matches Rotation::RotateVector and the engine: +pitch puts +sin(pitch) on row 2 column 0 (forward axis tilts up), +roll puts -cos(pitch) * sin(roll) on row 2 column 1 (right axis tilts down). Verified against rendered camera frames on UE5.8 (2026-08-27).

Definition at line 103 of file geom/Transform.h.

◆ GetRightVector()

Vector3D carla::geom::Transform::GetRightVector ( ) const
inline

Definition at line 67 of file geom/Transform.h.

◆ GetUpVector()

Vector3D carla::geom::Transform::GetUpVector ( ) const
inline

Definition at line 71 of file geom/Transform.h.

◆ InverseTransformPoint()

void carla::geom::Transform::InverseTransformPoint ( Vector3D & in_point) const
inline

Applies the inverse of this transformation to in_point.

Definition at line 91 of file geom/Transform.h.

◆ MSGPACK_DEFINE_ARRAY()

◆ operator FTransform()

carla::geom::Transform::operator FTransform ( ) const
inline

Definition at line 198 of file geom/Transform.h.

◆ operator!=()

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

Definition at line 185 of file geom/Transform.h.

◆ operator==()

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

Definition at line 181 of file geom/Transform.h.

◆ ToRightHanded()

RightHandedTransform carla::geom::Transform::ToRightHanded ( ) const
inlineconstexpr

This transform expressed in a right-handed, x-forward / y-**left** / z-up frame (ROS REP-103 "FLU").

location becomes (x, -y, z) and rotation becomes (roll, -pitch, -yaw); equivalently the pose matrix becomes S * GetMatrix() * S with S = diag(1, -1, 1, 1).

Definition at line 163 of file geom/Transform.h.

◆ TransformPoint()

void carla::geom::Transform::TransformPoint ( Vector3D & in_point) const
inline

Applies this transformation to in_point (first translation then rotation).

Definition at line 76 of file geom/Transform.h.

◆ TransformVector()

void carla::geom::Transform::TransformVector ( Vector3D & in_vector) const
inline

Applies this transformation to in_vector (rotation only).

Definition at line 84 of file geom/Transform.h.

Member Data Documentation

◆ location

◆ rotation


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