|
CARLA
|
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 |
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.
|
default |
Referenced by FromRightHanded().
|
inline |
Definition at line 51 of file geom/Transform.h.
|
inlineconstexpr |
Definition at line 55 of file geom/Transform.h.
|
inline |
Definition at line 195 of file geom/Transform.h.
|
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.
References carla::geom::Rotation::FromRightHanded(), carla::geom::Location::FromRightHanded(), carla::geom::RightHandedTransform::location, carla::geom::RightHandedTransform::rotation, and Transform().
Referenced by TEST().
|
inline |
Definition at line 63 of file geom/Transform.h.
References carla::geom::Rotation::GetForwardVector(), and rotation.
Referenced by FCarlaServer::FPimpl::BindActions(), carla::road::Map::CreateRtree(), carla::client::TrafficSign::GetStopWaypoints(), carla::agents::navigation::IsWithinDistance(), carla::traffic_manager::MotionPlanStage::Update(), and carla::agents::navigation::BasicAgent::VehicleObstacleDetected().
|
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.
References InverseTransformPoint(), carla::geom::Rotation::pitch, carla::geom::Rotation::roll, rotation, carla::geom::Math::ToRadians(), carla::geom::Vector3D::x, carla::geom::Vector3D::y, carla::geom::Rotation::yaw, and carla::geom::Vector3D::z.
|
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.
References location, carla::geom::Rotation::pitch, carla::geom::Rotation::roll, rotation, carla::geom::Math::ToRadians(), carla::geom::Vector3D::x, carla::geom::Vector3D::y, carla::geom::Rotation::yaw, and carla::geom::Vector3D::z.
|
inline |
Definition at line 67 of file geom/Transform.h.
References carla::geom::Rotation::GetRightVector(), and rotation.
|
inline |
Definition at line 71 of file geom/Transform.h.
References carla::geom::Rotation::GetUpVector(), and rotation.
|
inline |
Applies the inverse of this transformation to in_point.
Definition at line 91 of file geom/Transform.h.
References carla::geom::Rotation::InverseRotateVector(), location, and rotation.
Referenced by carla::geom::BoundingBox::Contains(), GetInverseMatrix(), and TEST().
|
inline |
Definition at line 198 of file geom/Transform.h.
|
inline |
Definition at line 185 of file geom/Transform.h.
|
inline |
Definition at line 181 of file geom/Transform.h.
|
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.
References location, rotation, carla::geom::Location::ToRightHanded(), and carla::geom::Rotation::ToRightHanded().
|
inline |
Applies this transformation to in_point (first translation then rotation).
Definition at line 76 of file geom/Transform.h.
References location, carla::geom::Rotation::RotateVector(), and rotation.
Referenced by carla::road::Map::GetAllCrosswalkZones(), carla::client::TrafficSign::GetStopWaypoints(), carla::agents::navigation::GetTrafficLightTriggerLocation(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Applies this transformation to in_vector (rotation only).
Definition at line 84 of file geom/Transform.h.
References carla::geom::Rotation::RotateVector(), and rotation.
| Location carla::geom::Transform::location |
Definition at line 39 of file geom/Transform.h.
Referenced by carla::road::Map::AddElementToRtree(), carla::nav::Navigation::AddOrUpdateVehicle(), carla::rss::RssCheck::AppendRoutingTarget(), carla::road::ComputeDuplicateTraceRoads(), carla::road::MapBuilder::CreateJunctionBoundingBoxes(), carla::rss::RssCheck::CreateWorldModel(), carla::agents::navigation::DistanceVehicle(), carla::road::Map::FilterRoadsByPosition(), carla::road::Map::GenerateSingleJunction(), carla::client::detail::Simulator::GetActorLocation(), carla::road::Map::GetAllCrosswalkZones(), GetClosestTrafficSignActor(), GetMatrix(), carla::rss::RssCheck::GetRoutingTargets(), carla::nav::Navigation::GetWalkerTransform(), carla::road::Map::GetWaypoint(), InverseTransformPoint(), carla::agents::navigation::IsWithinDistance(), carla::client::LaneInvasionCallback::MakeBounds(), operator FTransform(), operator==(), carla::ros2::ROS2::ProcessDataFromAutowareGNSS(), carla::ros2::ROS2::PublishTransform(), carla::road::Map::SDFToMesh(), carla::client::detail::Client::SpawnActorWithParent(), TEST(), ToRightHanded(), TransformPoint(), carla::traffic_manager::MotionPlanStage::Update(), carla::traffic_manager::ALSM::UpdateData(), carla::traffic_manager::ALSM::UpdateUnregisteredActorsData(), and carla::agents::navigation::BasicAgent::VehicleObstacleDetected().
| Rotation carla::geom::Transform::rotation |
Definition at line 41 of file geom/Transform.h.
Referenced by carla::nav::Navigation::AddOrUpdateVehicle(), carla::road::Map::GetAllCrosswalkZones(), GetForwardVector(), GetInverseMatrix(), GetMatrix(), GetRightVector(), carla::rss::RssCheck::GetSpeed(), carla::agents::navigation::GetTrafficLightTriggerLocation(), GetUpVector(), carla::nav::Navigation::GetWalkerTransform(), InverseTransformPoint(), carla::client::LaneInvasionCallback::MakeBounds(), operator FTransform(), operator==(), carla::ros2::ROS2::ProcessDataFromAutowareGNSS(), carla::ros2::ROS2::PublishTransform(), TEST(), ToRightHanded(), TransformPoint(), TransformVector(), carla::traffic_manager::MotionPlanStage::Update(), carla::traffic_manager::ALSM::UpdateData(), and carla::traffic_manager::ALSM::UpdateUnregisteredActorsData().