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

Euler angles of a rotation expressed in a right-handed frame, in degrees. More...

#include <RightHandedRotation.h>

Public Member Functions

constexpr bool operator!= (const RightHandedRotation &rhs) const
 
constexpr bool operator== (const RightHandedRotation &rhs) const
 
 RightHandedRotation ()=default
 
constexpr RightHandedRotation (float in_roll, float in_pitch, float in_yaw)
 

Public Attributes

float pitch = 0.0f
 Rotation about the left (+Y) axis, degrees, right-hand rule.
 
float roll = 0.0f
 Rotation about the forward (+X) axis, degrees, right-hand rule.
 
float yaw = 0.0f
 Rotation about the up (+Z) axis, degrees, right-hand rule.
 

Detailed Description

Euler angles of a rotation expressed in a right-handed frame, in degrees.

This is the boundary type for ROS / REP-103 "FLU" consumers: x forward, y left, z up, every axis turned by the right-hand rule.

The three angles compose as the usual intrinsic Z-Y-X (yaw, then pitch, then roll) sequence, i.e. R = Rz(yaw) * Ry(pitch) * Rx(roll) with the standard right-handed elementary matrices. That is exactly what scipy.spatial.transform.Rotation.from_euler("xyz", ...), tf2::Quaternion::setRPY and NVIDIA's ClipGT rig.json all mean by "roll pitch yaw".

This is not carla::geom::Rotation. CARLA's frame is left-handed (x forward, y right, z up) and its rotator has mixed signs; the exact mapping is

right_handed.roll  =  carla.roll
right_handed.pitch = -carla.pitch
right_handed.yaw   = -carla.yaw

which is its own inverse. Use Rotation::ToRightHanded() / Rotation::FromRightHanded() rather than flipping signs by hand, and see Docs/coordinate_conventions.md.

Definition at line 34 of file RightHandedRotation.h.

Constructor & Destructor Documentation

◆ RightHandedRotation() [1/2]

carla::geom::RightHandedRotation::RightHandedRotation ( )
default

◆ RightHandedRotation() [2/2]

constexpr carla::geom::RightHandedRotation::RightHandedRotation ( float  in_roll,
float  in_pitch,
float  in_yaw 
)
inlineconstexpr

Definition at line 47 of file RightHandedRotation.h.

Member Function Documentation

◆ operator!=()

constexpr bool carla::geom::RightHandedRotation::operator!= ( const RightHandedRotation &  rhs) const
inlineconstexpr

Definition at line 57 of file RightHandedRotation.h.

◆ operator==()

constexpr bool carla::geom::RightHandedRotation::operator== ( const RightHandedRotation &  rhs) const
inlineconstexpr

Definition at line 53 of file RightHandedRotation.h.

References pitch, roll, and yaw.

Member Data Documentation

◆ pitch

float carla::geom::RightHandedRotation::pitch = 0.0f

◆ roll

float carla::geom::RightHandedRotation::roll = 0.0f

◆ yaw

float carla::geom::RightHandedRotation::yaw = 0.0f

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