Skip to content

feat(vehicle): expose VehicleTelemetryData on ue5-dev (port from ue4-dev)#9715

Open
JArmandoAnaya wants to merge 4 commits intocarla-simulator:ue5-devfrom
JArmandoAnaya:feat/vehicle-telemetry-data-port
Open

feat(vehicle): expose VehicleTelemetryData on ue5-dev (port from ue4-dev)#9715
JArmandoAnaya wants to merge 4 commits intocarla-simulator:ue5-devfrom
JArmandoAnaya:feat/vehicle-telemetry-data-port

Conversation

@JArmandoAnaya
Copy link
Copy Markdown
Contributor

@JArmandoAnaya JArmandoAnaya commented May 6, 2026

Description

Adds Vehicle.get_telemetry_data() to ue5-dev. The API exists on ue4-dev (upstream PR #5153) and was never carried across to ue5-dev. Closes Issue #9630 (PR #0l, Category 5 of the ue4 to ue5 porting effort, Discussion #9581).

Returns a VehicleTelemetryData snapshot: forward speed (m/s), last applied control (steer / throttle / brake), engine RPM, current gear, aerodynamic drag, plus a per-wheel WheelTelemetryData with tire friction, lateral and longitudinal slip, angular velocity, tire load (raw and normalized), drive torque, and longitudinal and lateral forces (raw and normalized).

The original implementation read PhysX live state via PVehicle->mWheelsSimData and mWheelsDynData. ue5-dev runs Chaos, so the implementation reads from UChaosWheeledVehicleMovementComponent::GetWheelState(i) and the UChaosVehicleWheel Debug fields. Every PhysX field has a direct Chaos equivalent; nothing is stubbed.

Audit of the seven candidate ue4-dev commits
ue4-dev SHA Subject Disposition
01b1ede51 Expose Telemetry Data (#5153) Ported (commit 1)
3647beaf0 Add missing vector_of_wheels_telemetry Python binding (#8567) Ported (commit 2)
a14b2d943 Allow rotation (pitch) of all vehicle wheels via API Not included
03e71c251 Handle wheel rotation API calls on server side Not included
fda970b88 Allow GetVehiclePhysicsControl to succeed when physics is off Not included
e7e3987f7 Add wheels into the check of physics being enabled (#8887) Not included
bd6860437 lower COM Z-height to 0.52 m (#9126) Not included

The five not included commits would either fail to compile, ship a public API with no working backend, or fix a bug that does not manifest on ue5-dev:

  • Wheel pitch RPC API (a14b2d943, 03e71c251): the engine animation backend it calls (UVehicleAnimationInstance::SetWheelPitchAngle) does not exist in stock UE 5.5 or in the CARLA UE5 fork (UnrealEngine-ue5 HEAD e889ad68f7d6 exposes only SetWheeledVehicleComponent, GetVehicle, GetWheeledVehicleComponent). The four existing call sites in Game/FrameData.cpp, Recorder/CarlaReplayerHelper.cpp, Recorder/CarlaRecorder.cpp, and Vehicle/CarlaWheeledVehicle.cpp are already wrapped in #if 0 // @CARLAUE5 for the same reason. Porting them would ship a public no-op.
  • GetVehiclePhysicsControl physics-off fallback (fda970b88, e7e3987f7): the original crash mode was PhysX-specific (PVehicle->mWheelsSimData live state after DestroyPhysicsState()). The current ue5 implementation reads only static UPROPERTY config off *VehicleMovComponent.Wheels[i] (UChaosVehicleWheel CDOs that survive physics teardown). The crash does not reproduce here. Adding a defensive guard would violate the project rule against fallbacks for scenarios that cannot happen.
  • Sedan_Chassis.json COM Z-height (bd6860437): the entire Co-Simulation/ tree is absent from this repository.
What this PR ships

Three commits:

  1. feat(LibCarla,plugin): expose VehicleTelemetryData and WheelTelemetryData — port of 01b1ede51.
  2. feat(PythonAPI): add vector_of_wheels_telemetry binding — port of 3647beaf0.
  3. test(LibCarla,PythonAPI): GTest and smoke coverage for vehicle telemetry — original work.

The two ported commits credit their upstream authors via Co-Authored-By: trailers and quote the upstream rationale verbatim in the commit body.

Where to look in the diff
  • New types: LibCarla/source/carla/rpc/{VehicleTelemetryData.h,WheelTelemetryData.h} and the UE-side USTRUCT pair Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Vehicle/VehicleTelemetryData.h.
  • Server impl: Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Vehicle/CarlaWheeledVehicle.cpp (GetVehicleTelemetryData() reads from UChaosWheeledVehicleMovementComponent::GetWheelState(i) and the UChaosVehicleWheel Debug fields, units converted cm to m and cm² to m²).
  • RPC handler: Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp (BIND_SYNC(get_telemetry_data)).
  • Python: PythonAPI/carla/src/{Actor.cpp,Control.cpp} and PythonAPI/carla/include/PythonAPI.h (the operator<< for __str__).

Issue #9630

Where has this been tested?

  • Platform(s): Ubuntu 22.04.
  • Python version(s): 3.10.
  • Unreal Engine version(s): UE 5.5.

LibCarla GoogleTest (Build-Tests, Debug, BUILD_LIBCARLA_TESTS=ON):

  • libcarla_test_server and libcarla_test_client: 4/4 PASSED on each suite for WheelTelemetryData.*:VehicleTelemetryData.* (default-zero plus MsgPack round-trip with a non-empty wheels vector).

Package build (Build/, Release, CARLA_UNREAL_PACKAGE_NO_COMPRESSION=ON): green, zero new error: or warning: lines in files touched by this PR.

Python smoke (packaged server on port 3654, Town10HD_Opt):

  • smoke.test_vehicle_telemetry: 1/1 PASSED in 19.6s. Spawns a vehicle, autopilots 30 ticks, asserts every telemetry field is finite, the wheel count matches physics_control.wheels, and per-wheel fields are finite floats.

Possible Drawbacks

  • Numerical drift from the legacy PhysX values. The Chaos backend is the source of the values. Field-by-field semantics match the ue4-dev API, but absolute numbers will differ slightly because the underlying solvers differ. Any pipeline that hand-calibrated thresholds against the old PhysX telemetry will need to recalibrate.
  • long_force and lat_force values come from the UChaosVehicleWheel Debug fields. They are populated whenever Chaos's debug instrumentation is active (default on for vehicle simulation), but a future engine change that gates these behind a debug flag would silently zero those fields. The smoke test asserts finiteness, not magnitude, for that reason.

This change is Reviewable

JArmandoAnaya and others added 3 commits May 6, 2026 14:18
…Data

Add a `Vehicle.get_telemetry_data()` API that returns a
`VehicleTelemetryData` snapshot of the vehicle's runtime state: forward
speed, last applied control inputs, engine RPM, current gear,
aerodynamic drag magnitude, and a per-wheel breakdown with tire
friction, lateral and longitudinal slip, angular velocity (omega), tire
load, normalized tire load, drive torque, and longitudinal and lateral
forces (raw and load-normalized).

Wires the data type all the way through: new `carla::rpc::VehicleTelemetryData`
and `carla::rpc::WheelTelemetryData` MsgPack types in LibCarla, the
`Carla/Vehicle/VehicleTelemetryData.h` USTRUCT pair on the UE side, a
`get_telemetry_data` RPC handler in `CarlaServer`, an `FVehicleActor`
dispatch, and Python bindings (`carla.VehicleTelemetryData`,
`carla.WheelTelemetryData`).

The original ue4-dev implementation (`01b1ede51`) read the per-wheel
data from PhysX live state via `PVehicle->mWheelsSimData` and
`mWheelsDynData`. ue5-dev runs Chaos, so the implementation reads from
`UChaosWheeledVehicleMovementComponent::GetWheelState(i)` (which returns
`FWheelStatus { SlipAngle, SlipMagnitude, DriveTorque, ... }`) and the
`UChaosVehicleWheel` Debug* fields (`DebugTireLoad`,
`DebugNormalizedTireLoad`, `DebugWheelTorque`, `DebugLongForce`,
`DebugLatForce`, `FrictionForceMultiplier`,
`GetWheelAngularVelocity()`). Every PhysX field has a direct Chaos
equivalent; nothing is stubbed.

Original commit message follows.

    Expose Telemetry Data (carla-simulator#5153)

    * expose telemetry data to the client
    * CHANGELOG updated
    * minor fixes
    * Added new telemetry parameters:
      * Exposed omega instead of rpm
      * Added tire_load, normalized_long_force, normalized_lat_force

(adapted from ue4-dev 01b1ede)

Co-Authored-By: joel-mb <joel.moriana@gmail.com>
Co-Authored-By: Blyron <53337103+Blyron@users.noreply.github.com>
Register `std::vector<carla::rpc::WheelTelemetryData>` as a Boost.Python
class so the wheels list inside `VehicleTelemetryData` round-trips
cleanly when consumed via the C++ vector type rather than the
`add_property` list helper added in the previous commit.

Original commit message:

    Add missing conversion class from vector of WheelTelemetryData
    to Python list (carla-simulator#8567)

(adapted from ue4-dev 3647bea)

Co-Authored-By: Arik <BBArik@protonmail.com>
Adds GoogleTest cases pinning the default-zero contract and the MsgPack
round-trip for both `VehicleTelemetryData` and `WheelTelemetryData` (the
nested wheels vector is exercised in the vehicle round-trip with three
distinct entries).

Adds `smoke.test_vehicle_telemetry` which spawns a vehicle in
Town10HD_Opt, drives it under autopilot for thirty ticks, and asserts
that `vehicle.get_telemetry_data()` returns finite floats per
vehicle-level field, an `int` gear, a `wheels` list whose length
matches the physics control's wheel array, and finite floats for every
per-wheel field. Registered in `PythonAPI/test/smoke_test_list.txt`.
The smoke test overrides `tearDown` to load `Town10HD_Opt` instead of
the default `Town03` (the packaged build only ships `Town10HD_Opt` and
`Mine_01`).

Adds the user-visible CHANGELOG bullet for the new API.
@JArmandoAnaya JArmandoAnaya requested a review from a team as a code owner May 6, 2026 22:39
@JArmandoAnaya JArmandoAnaya marked this pull request as draft May 7, 2026 07:53
@JArmandoAnaya JArmandoAnaya marked this pull request as ready for review May 7, 2026 07:53
Copilot AI review requested due to automatic review settings May 7, 2026 07:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds end-to-end support for retrieving runtime vehicle telemetry on ue5-dev, exposing a Vehicle.get_telemetry_data() API that returns vehicle- and per-wheel telemetry sourced from Chaos and carried across the RPC/client/Python stack.

Changes:

  • Introduces VehicleTelemetryData / WheelTelemetryData RPC types (plus UE-side USTRUCTs) and a Chaos-backed server implementation on ACarlaWheeledVehicle.
  • Wires a new synchronous RPC (get_telemetry_data) through server, LibCarla client, and Python bindings.
  • Adds LibCarla GTests for MsgPack round-trip + a Python smoke test and registers it in the smoke test list.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Vehicle/VehicleTelemetryData.h Adds UE USTRUCT definitions for vehicle and wheel telemetry snapshots.
Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Vehicle/CarlaWheeledVehicle.h Declares GetVehicleTelemetryData() on the vehicle actor.
Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Vehicle/CarlaWheeledVehicle.cpp Implements Chaos-backed telemetry extraction and unit conversions.
Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp Adds get_telemetry_data RPC binding returning VehicleTelemetryData.
Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Actor/CarlaActor.h Extends actor interface with GetVehicleTelemetryData for vehicles.
Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Actor/CarlaActor.cpp Implements vehicle actor telemetry retrieval and dormant handling.
LibCarla/source/carla/rpc/WheelTelemetryData.h Introduces WheelTelemetryData MsgPack RPC type + UE conversion.
LibCarla/source/carla/rpc/VehicleTelemetryData.h Introduces VehicleTelemetryData MsgPack RPC type + UE conversion.
LibCarla/source/carla/client/Vehicle.h Exposes Vehicle::GetTelemetryData() client API.
LibCarla/source/carla/client/Vehicle.cpp Implements the client call to the simulator for telemetry.
LibCarla/source/carla/client/detail/Simulator.h Adds simulator wrapper to request telemetry by actor id.
LibCarla/source/carla/client/detail/Client.h Adds client RPC declaration for telemetry retrieval.
LibCarla/source/carla/client/detail/Client.cpp Implements RPC call get_telemetry_data.
PythonAPI/carla/src/Actor.cpp Exposes Vehicle.get_telemetry_data() to Python.
PythonAPI/carla/src/Control.cpp Adds Python bindings for telemetry structs and wheel vector conversion.
PythonAPI/carla/include/PythonAPI.h Adds operator<< formatting for telemetry types (repr/str support).
LibCarla/source/test/common/test_vehicle_telemetry_data.cpp Adds GTests for default-zero and MsgPack round-trip contracts.
PythonAPI/test/smoke/test_vehicle_telemetry.py Adds end-to-end Python smoke test for telemetry RPC and bindings.
PythonAPI/test/smoke_test_list.txt Registers the new telemetry smoke test.
CHANGELOG.md Documents the new Vehicle.get_telemetry_data() API.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Vehicle/CarlaWheeledVehicle.cpp Outdated
The previous commits in this PR ported the ue4-dev VehicleTelemetryData
surface verbatim, including UVehicleWheel debug fields (TireLoad,
NormalizedTireLoad, WheelTorque, LongForce, LatForce) and the
movement-component DebugDragMagnitude. On UE 5.5 these are declared but
never written by the Chaos plugin: a full search of
Engine/Plugins/Experimental/ChaosVehiclesPlugin yields zero assignment
sites for any of them, and the only DebugDragMagnitude reference in
ChaosWheeledVehicleMovementComponent.cpp is a commented-out HUD draw at
line 1795. Reporting them on UE5 produces permanent zeros, which a
finiteness-only smoke check accepts silently.

This commit removes those fields from VehicleTelemetryData and
WheelTelemetryData (RPC types, USTRUCTs, Python bindings, GTests,
operator<<, and CHANGELOG). FrictionForceMultiplier is also dropped:
it is a static UPROPERTY config (defaults to 2.0f), not the live
runtime tire friction PhysX exposed via WheelsStates[w].tireFriction.

What remains is the surface Chaos actually populates live: speed,
last-applied control (steer/throttle/brake), engine RPM, current gear,
and per-wheel lateral slip, longitudinal slip, and angular velocity.

The smoke test now asserts magnitude rather than finiteness:
engine_rpm > 100 and at least one wheel with non-zero omega under full
throttle, so a future regression that disconnects the kept fields from
the solver cannot pass with default zeros.

Validation:
- libcarla_test_server / libcarla_test_client: 4/4 PASS each on the
  trimmed VehicleTelemetryData.* / WheelTelemetryData.* MsgPack and
  default-construction contracts.
- Package build: BUILD SUCCESSFUL on Build/ with
  CARLA_UNREAL_PACKAGE_NO_COMPRESSION=ON, zero new warnings on
  touched files.
- smoke.test_vehicle_telemetry: 1/1 PASS in 20.3s against the
  packaged server (Town10HD_Opt, -quality-level=Low).
@JArmandoAnaya
Copy link
Copy Markdown
Contributor Author

JArmandoAnaya commented May 7, 2026

Investigation: A full search of Engine/Plugins/Experimental/ChaosVehiclesPlugin/ (UE 5.5) showed that the UChaosVehicleWheel::Debug* UPROPERTYs (DebugTireLoad, DebugNormalizedTireLoad, DebugWheelTorque, DebugLongForce, DebugLatForce) and UChaosVehicleMovementComponent::DebugDragMagnitude are declared but never written by the engine. Reading them produces permanent zeros, which the previous math.isfinite(...) smoke check accepted silently. UChaosVehicleWheel::FrictionForceMultiplier was also dropped because it is a static UPROPERTY config (default 2.0f), not live solver friction — distinct from the PhysX WheelsStates[w].tireFriction it was nominally replacing.

Trimmed surface (UE5 keeps only what Chaos populates live):

  • VehicleTelemetryData: speed, steer, throttle, brake, engine_rpm, gear, wheels
  • WheelTelemetryData: lat_slip, long_slip, omega

Smoke now asserts magnitude, not finiteness: engine_rpm > 100 under throttle, and at least one wheel with non-zero omega. A future regression that wires a kept field to a never-written debug member cannot pass with default zeros.

Validation:

  • LibCarla GTests: 4/4 server + 4/4 client PASS on the trimmed VehicleTelemetryData.* / WheelTelemetryData.* MsgPack + default-construction contracts.
  • Package build: BUILD SUCCESSFUL end-to-end (Development + Shipping + Cook + Stage + Archive), zero new warnings on touched files.
  • smoke.test_vehicle_telemetry: 1/1 PASS in 20.3s against the packaged server.

@JArmandoAnaya
Copy link
Copy Markdown
Contributor Author

GitHub Copilot code review comments are already resolved. The PR is ready for the review from the Carla team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port ue4-dev vehicle/physics/control API to ue5-dev (Category 5: Vehicle API)

2 participants