You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
UChronoMovementComponent drives the CARLA actor's transform from the Chrono
simulation, and applies two fixed corrections while doing so
(Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Vehicle/MovementComponents/ChronoMovementComponent.cpp, TickComponent):
constauto ChronoPositionOffset = ChVector<>(0, 0, -0.25f);
auto VehiclePos = Vehicle->GetVehiclePos() + ChronoPositionOffset;
...
// adding small rotation to compensate chrono offsetconstfloat ChronoPitchOffset = 2.5f;
NewRotator.Add(ChronoPitchOffset, 0.f, 0.f);
Both constants reconcile the Chrono vehicle origin with the CARLA skeletal mesh
origin, and both are tuned for the one model shipped under Co-Simulation/Chrono/Vehicles/sedan — a 1250 kg passenger car. They are applied
unconditionally, so any other Chrono vehicle template renders with the wrong ride
height and a constant 2.5 degree pitch. Project Chrono ships a dozen more models
(citybus, longhaul, mtv, MAN_Kat1, hmmwv, uaz, gator, feda, rccar, …) in share/chrono/data/vehicle/, and those are exactly the cases where
a higher-fidelity dynamics model is most interesting — heavy vehicles, where
CARLA's default Chaos parameters are least representative.
The values cannot be worked around from the client: enable_chrono_physics takes
only substep settings and the three template paths, and the JSON templates have no
say in how the result is mapped back onto the Unreal actor.
For context on the demand for non-sedan Chrono vehicles, see the (template-less,
so closed) #9160.
Describe the solution you'd like
Make the Chrono-to-actor alignment a property of the vehicle rather than a
constant. Either of:
Extra optional arguments on enable_chrono_physics (e.g. position_offset, pitch_offset), defaulting to the current values so existing scripts are
unaffected; or
An optional block in the vehicle JSON that CARLA reads alongside the Chrono
parse, keeping the alignment next to the model it belongs to.
Deriving the offset instead of configuring it would be better still — the
difference between Vehicle->GetVehiclePos() and the CARLA mesh origin is
computable from the chassis reference frame and the vehicle's bounding box — but a
configurable value would already unblock non-sedan models.
Describe alternatives you've considered
Editing the constants and rebuilding per vehicle type. Works, but they are
global, so a simulation cannot mix a Chrono bus and a Chrono sedan.
Compensating on the client by re-setting the actor transform each tick. Fights
the component, which writes the transform every tick from the Chrono state.
Shipping a CARLA-tuned copy of each Chrono template. Does not help: the offsets
are in C++, not in the templates.
Additional context
Two adjacent hardcodings in the same file, in case they are worth folding into the
same fix:
UERayCastTerrain::GetCoefficientFriction() returns 1 unconditionally, so the
road surface friction of the map never reaches the tire model. Ground height and
normal are ray-cast from the CARLA world, so only friction is ignored.
Calling enable_chrono_physics immediately after spawn_actor is silently a
no-op: the spawn overlap trips the collision fallback, DisableChronoPhysics()
reverts to the default physics, and the client sees no error — only a server-side Chrono physics does not support collisions yet warning. Letting the vehicle
settle for a few ticks first avoids it, but the failure is invisible to the
caller.
All three behaviours predate the UE5 branch; they are inherited from ue4-dev and
are not introduced by #9861, which only makes the existing integration buildable
again.
Setup
ue5-dev@0a5ce0d5b(0.10.0), built with-DENABLE_CHRONO=ONfrom Port the Project Chrono integration from ue4-dev #9861CarlaUnreal/UnrealEngine@ue5-dev-carla(5.5)Is your feature request related to a problem? Please describe.
UChronoMovementComponentdrives the CARLA actor's transform from the Chronosimulation, and applies two fixed corrections while doing so
(
Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Vehicle/MovementComponents/ChronoMovementComponent.cpp,TickComponent):Both constants reconcile the Chrono vehicle origin with the CARLA skeletal mesh
origin, and both are tuned for the one model shipped under
Co-Simulation/Chrono/Vehicles/sedan— a 1250 kg passenger car. They are appliedunconditionally, so any other Chrono vehicle template renders with the wrong ride
height and a constant 2.5 degree pitch. Project Chrono ships a dozen more models
(
citybus,longhaul,mtv,MAN_Kat1,hmmwv,uaz,gator,feda,rccar, …) inshare/chrono/data/vehicle/, and those are exactly the cases wherea higher-fidelity dynamics model is most interesting — heavy vehicles, where
CARLA's default Chaos parameters are least representative.
The values cannot be worked around from the client:
enable_chrono_physicstakesonly substep settings and the three template paths, and the JSON templates have no
say in how the result is mapped back onto the Unreal actor.
For context on the demand for non-sedan Chrono vehicles, see the (template-less,
so closed) #9160.
Describe the solution you'd like
Make the Chrono-to-actor alignment a property of the vehicle rather than a
constant. Either of:
enable_chrono_physics(e.g.position_offset,pitch_offset), defaulting to the current values so existing scripts areunaffected; or
parse, keeping the alignment next to the model it belongs to.
Deriving the offset instead of configuring it would be better still — the
difference between
Vehicle->GetVehiclePos()and the CARLA mesh origin iscomputable from the chassis reference frame and the vehicle's bounding box — but a
configurable value would already unblock non-sedan models.
Describe alternatives you've considered
global, so a simulation cannot mix a Chrono bus and a Chrono sedan.
the component, which writes the transform every tick from the Chrono state.
are in C++, not in the templates.
Additional context
Two adjacent hardcodings in the same file, in case they are worth folding into the
same fix:
UERayCastTerrain::GetCoefficientFriction()returns1unconditionally, so theroad surface friction of the map never reaches the tire model. Ground height and
normal are ray-cast from the CARLA world, so only friction is ignored.
enable_chrono_physicsimmediately afterspawn_actoris silently ano-op: the spawn overlap trips the collision fallback,
DisableChronoPhysics()reverts to the default physics, and the client sees no error — only a server-side
Chrono physics does not support collisions yetwarning. Letting the vehiclesettle for a few ticks first avoids it, but the failure is invisible to the
caller.
All three behaviours predate the UE5 branch; they are inherited from
ue4-devandare not introduced by #9861, which only makes the existing integration buildable
again.
🤖 Generated with Claude Code
https://claude.ai/code/session_013bSfUeZdAm96gauHK5HJct