|
CARLA
|
Euler angles of a rotation in CARLA's / Unreal's left-handed frame: x forward, y right, z up, degrees. More...
#include <Rotation.h>
Public Member Functions | |
| Vector3D | GetForwardVector () const |
| Vector3D | GetRightVector () const |
| Vector3D | GetUpVector () const |
| void | InverseRotateVector (Vector3D &in_point) const |
| MSGPACK_DEFINE_ARRAY (pitch, yaw, roll) | |
| Rotation | Normalize () const |
| operator FRotator () const | |
| bool | operator!= (const Rotation &rhs) const |
| Rotation | operator+ (const Rotation &rhs) const |
| Rotation & | operator+= (const Rotation &rhs) |
| Rotation | operator- (const Rotation &rhs) const |
| Rotation & | operator-= (const Rotation &rhs) |
| bool | operator== (const Rotation &rhs) const |
| Vector3D | RotateVector (const Vector3D &in_point) const |
| void | RotateVector (Vector3D &in_point) const |
| Rotation ()=default | |
| Rotation (const FRotator &rotator) | |
| constexpr | Rotation (float p, float y, float r) |
| constexpr RightHandedRotation | ToRightHanded () const |
| This rotation expressed in a right-handed, x-forward / y-**left** / z-up frame (ROS REP-103 "FLU"), as intrinsic Z-Y-X Euler angles under the right-hand rule. | |
Static Public Member Functions | |
| static constexpr Rotation | FromRightHanded (const RightHandedRotation &rhs) |
Inverse of ToRightHanded(). | |
Public Attributes | |
| float | pitch = 0.0f |
| float | roll = 0.0f |
| float | yaw = 0.0f |
Euler angles of a rotation in CARLA's / Unreal's left-handed frame: x forward, y right, z up, degrees.
The three angles compose as R = Rz(+yaw) * Ry(-pitch) * Rx(-roll) with the standard (right-handed) elementary matrices, which is the same thing as saying:
+yaw turns the nose to the right;+pitch tilts the nose up -> forward.z = +sin(pitch);+roll drops the right side -> right.z = -cos(pitch)*sin(roll).This is CARLA 0.9.x's documented convention and it is what the engine builds from the same FRotator, verified against rendered camera frames on UE5.8. RotateVector, Transform::GetMatrix and Math::Get{Forward,Right,Up}Vector all live in this frame and must not be "corrected" towards a right-handed convention.
For ROS / REP-103 consumers convert explicitly at the boundary with ToRightHanded() / FromRightHanded(); see RightHandedRotation and Docs/coordinate_conventions.md.
Definition at line 45 of file Rotation.h.
|
default |
Referenced by FromRightHanded(), and Normalize().
|
inlineconstexpr |
Definition at line 66 of file Rotation.h.
|
inline |
Definition at line 271 of file Rotation.h.
|
inlinestaticconstexpr |
Inverse of ToRightHanded().
The mapping is an involution, so the same three sign flips apply in both directions.
Definition at line 212 of file Rotation.h.
References carla::geom::RightHandedRotation::pitch, carla::geom::RightHandedRotation::roll, Rotation(), and carla::geom::RightHandedRotation::yaw.
Referenced by carla::geom::Transform::FromRightHanded(), carla::geom::Quaternion::Rotator(), and TEST().
|
inline |
Definition at line 75 of file Rotation.h.
References carla::geom::Math::GetForwardVector().
Referenced by carla::road::Map::GetAllCrosswalkZones(), carla::geom::Transform::GetForwardVector(), URoadMap::SetPixelAt(), TEST(), and AProceduralBuilding::UpdateTransformPositionToNextChunk().
|
inline |
Definition at line 79 of file Rotation.h.
References carla::geom::Math::GetRightVector().
Referenced by carla::geom::Transform::GetRightVector(), and AProceduralBuilding::UpdateTransformPositionToNextSide().
|
inline |
Definition at line 83 of file Rotation.h.
References carla::geom::Math::GetUpVector().
Referenced by ACarlaGameModeBase::DebugShowSignals(), and carla::geom::Transform::GetUpVector().
|
inline |
Definition at line 131 of file Rotation.h.
References pitch, roll, carla::geom::Math::ToRadians(), carla::geom::Vector3D::x, carla::geom::Vector3D::y, yaw, and carla::geom::Vector3D::z.
Referenced by carla::rss::RssCheck::GetSpeed(), and carla::geom::Transform::InverseTransformPoint().
|
inline |
Definition at line 164 of file Rotation.h.
References pitch, roll, Rotation(), and yaw.
|
inline |
Definition at line 274 of file Rotation.h.
|
inline |
Definition at line 226 of file Rotation.h.
Definition at line 234 of file Rotation.h.
Definition at line 250 of file Rotation.h.
Definition at line 242 of file Rotation.h.
Definition at line 257 of file Rotation.h.
|
inline |
Definition at line 220 of file Rotation.h.
Definition at line 125 of file Rotation.h.
References RotateVector().
|
inline |
Definition at line 87 of file Rotation.h.
References pitch, roll, carla::geom::Math::ToRadians(), carla::geom::Vector3D::x, carla::geom::Vector3D::y, yaw, and carla::geom::Vector3D::z.
Referenced by carla::geom::BoundingBox::GetLocalVertices(), RotateVector(), carla::geom::Transform::TransformPoint(), and carla::geom::Transform::TransformVector().
|
inlineconstexpr |
This rotation expressed in a right-handed, x-forward / y-**left** / z-up frame (ROS REP-103 "FLU"), as intrinsic Z-Y-X Euler angles under the right-hand rule.
Mirroring the Y axis maps Rz(+yaw) * Ry(-pitch) * Rx(-roll) onto Rz(-yaw) * Ry(+(-pitch)) * Rx(+roll), so pitch and yaw flip sign and roll does not. Example: Rotation(pitch=20, yaw=30, roll=10) becomes RightHandedRotation(roll=10, pitch=-20, yaw=-30).
Definition at line 206 of file Rotation.h.
References pitch, roll, and yaw.
Referenced by carla::geom::Transform::ToRightHanded().
| float carla::geom::Rotation::pitch = 0.0f |
Definition at line 52 of file Rotation.h.
Referenced by carla::road::Lane::ComputeTransform(), carla::road::Map::GetAllCrosswalkZones(), carla::geom::Math::GetForwardVector(), carla::geom::Transform::GetInverseMatrix(), carla::geom::Transform::GetMatrix(), carla::geom::Math::GetRightVector(), carla::geom::Math::GetUpVector(), InverseRotateVector(), Normalize(), operator FRotator(), operator+(), operator+=(), operator-(), operator-=(), operator==(), carla::ros2::ROS2::ProcessDataFromAutowareGNSS(), carla::ros2::ROS2::PublishTransform(), RotateVector(), TEST(), TEST(), TEST(), TEST(), and ToRightHanded().
| float carla::geom::Rotation::roll = 0.0f |
Definition at line 56 of file Rotation.h.
Referenced by carla::road::Map::GetAllCrosswalkZones(), carla::geom::Transform::GetInverseMatrix(), carla::geom::Transform::GetMatrix(), carla::geom::Math::GetRightVector(), carla::geom::Math::GetUpVector(), InverseRotateVector(), Normalize(), operator FRotator(), operator+(), operator+=(), operator-(), operator-=(), operator==(), carla::ros2::ROS2::ProcessDataFromAutowareGNSS(), carla::ros2::ROS2::PublishTransform(), RotateVector(), TEST(), TEST(), TEST(), and ToRightHanded().
| float carla::geom::Rotation::yaw = 0.0f |
Definition at line 54 of file Rotation.h.
Referenced by carla::nav::Navigation::AddOrUpdateVehicle(), carla::road::Lane::ComputeTransform(), carla::road::Map::GetAllCrosswalkZones(), carla::geom::Math::GetForwardVector(), carla::geom::Transform::GetInverseMatrix(), carla::geom::Transform::GetMatrix(), carla::geom::Math::GetRightVector(), carla::agents::navigation::GetTrafficLightTriggerLocation(), carla::geom::Math::GetUpVector(), carla::nav::Navigation::GetWalkerTransform(), InverseRotateVector(), carla::client::LaneInvasionCallback::MakeBounds(), Normalize(), operator FRotator(), operator+(), operator+=(), operator-(), operator-=(), operator==(), carla::ros2::ROS2::ProcessDataFromAutowareGNSS(), carla::ros2::ROS2::PublishTransform(), RotateVector(), TEST(), TEST(), TEST(), ToRightHanded(), and carla::traffic_manager::MotionPlanStage::Update().