Autopilot control is unstable and inconsistent under async mode on ue58-dev, and accelerates too aggressively at junctions, roundabouts and corners
Setup
- CARLA version: 0.10.x (
ue58-dev) - Platform: Linux
- Python version: n/a, reproducible through autopilot / Traffic Manager alone
- GPU: n/a
- GPU Drivers: n/a
Describe the bug
Autopilot control (NPCs and the ego under manual_control.py --autopilot) is unstable and inconsistent on this UE 5.8 branch. In asynchronous mode, whenever the server runs below the Traffic Manager's tuned control rate (a heavy scene, a streaming camera), vehicle control visibly degrades: the steering wheel and throttle/brake indicators in manual_control.py jump and dither, and vehicles drift out of their lane for several seconds at a time. This is the main problem: it makes autopilot unreliable rather than merely uncomfortable.
On top of that, and reproducible independently of the above, autopilot vehicles also accelerate far too aggressively when pulling away after slowing or stopping at an intersection, a roundabout, or a stop sign. Instead of a smooth, gradual acceleration, the car launches hard as soon as it starts to incorporate into the road. The same vehicles carry too much speed into tight corners and closed curves, braking mid-corner rather than before it.
Steps to reproduce
- Start the CARLA server offscreen:
CarlaUnreal.sh -RenderOffScreen -carla-rpc-port=3654. - Load
Town15(has roundabouts and T-junctions) orTown10HD_Opt. - Spawn traffic with
PythonAPI/examples/generate_traffic.py(defaults are enough, ~30 vehicles). - Run
PythonAPI/examples/manual_control.py --autopilotto observe an ego vehicle, or just watch the NPC traffic, with a streaming camera or another load that keeps the server below its usual frame rate. - Watch the throttle/brake/steering indicators jump and the vehicle drift across its lane. Separately, watch a vehicle approach and slow at a junction, roundabout, or stop sign, then pull away, and watch a vehicle enter a tight corner.
Expected behavior Autopilot control should stay consistent and stable regardless of server frame rate in asynchronous mode. Pulling away from a stop or a slow junction/roundabout approach should be smooth and progressive, comparable to how a real driver accelerates, not a step to full throttle in a single frame. Cornering should slow down on the approach to a tight turn rather than braking once already inside it.
Additional context Root-caused and fixed in #9886:
- The main cause of the instability: in asynchronous mode the server was only servicing the Traffic Manager's control-refresh RPCs once every ~6.6 rendered frames instead of every frame whenever the server ran below the controller's tuned rate. A controller tuned for 20 Hz then effectively ran at 4 to 5 Hz, which limit-cycles: throttle and brake alternating at their bounds, steering dithering, and lane offset growing past a metre.
- The target speed the controller is asked to reach also steps discontinuously (the landmark that holds a vehicle at low speed through a junction/stop/roundabout drops out of the path buffer in a single frame), and the longitudinal control loop saturates the throttle for any velocity error above roughly 7%, so that step becomes a step to full throttle.
- The turn speed limiter measured curvature over too wide a span of the path, so it only reacted once the vehicle was already mid-corner, and targeted a cornering acceleration close to a real tyre's limit rather than a comfortable one.
Source: carla-simulator/carla