A ground robot following a path with a simple geometric tracker steers toward a point some distance ahead on the path. The tracker assumes the vehicle goes where it is steered. When the floor gets slippery, the tires wear, or the actuators lag more than expected, that assumption breaks and the robot drifts off the line. This proposal keeps the tracker the robot already has and changes the point it aims at. A "digital twin" is a model of the vehicle that is continuously corrected from its own telemetry. Here the twin predicts how far the vehicle will miss the path over the next second, and it sends back a short sequence of corrected aim points. The tracker then aims "wrong" by exactly the amount needed to land on the path. The twin's model is a physics model plus a small learned correction term. That correction term is pre-trained across thousands of randomized simulated vehicles, so on real hardware it needs only a few seconds of data to lock onto the current conditions. It also knows when it is unsure, and it backs off when it is.
The practical case is strong. Field platforms such as tractors, orchard sprayers, and tracked harvesters run pure pursuit or Stanley-style trackers that operators will not replace with a full model-predictive controller, and their twins often sit on an edge server with unreliable links. Existing work either adapts the controller itself or freezes a learned correction after a pre-recorded calibration run. Neither handles conditions that keep changing during operation, and neither survives a network that drops packets.
Core Claim
Our central claim is that a learned correction to the vehicle's physics can be pre-trained in simulation so that it adapts fast. Concretely, a residual dynamics model (a small network added to a first-principles bicycle model to capture what the physics misses) is pre-trained across a domain-randomized simulator, meaning one whose friction, mass, and latency are resampled every episode. The network's last layer is Bayesian, which means it keeps an explicit, updatable estimate of its own weights and their uncertainty. Such a model can be re-fitted online from seconds of real telemetry using a closed-form update.
The residual model sends its output downstream as offsets to the tracker's reference, gated by its predictive uncertainty. Three properties follow. Tracking error recovers faster after friction shifts than with frozen offline residuals or with online residuals learned from scratch. The scheme tolerates twin-to-vehicle latency up to roughly the preview horizon, because each message carries a whole horizon of offsets. And it never performs worse than the unmodified tracker, because high uncertainty shrinks the offsets to zero.
The role of domain randomization here is unusual. It is not used to make a policy insensitive to friction. Domain randomization is known to produce overly cautious, open-loop robust behavior, and the file notes it treats friction as noise to withstand rather than a quantity to estimate. We use it instead to shape a prior over residual functions so that online identification is fast.
The correction can be written as follows. Let $e_{t+k}$ be the lateral error the twin predicts $k$ steps ahead under the nominal tracker, and let $\sigma_{t+k}$ be its predictive standard deviation. The aim point sent downstream is then
$$p^{\text{ref}}_{t+k} = p^{\text{path}}_{t+k} - \alpha(\sigma_{t+k})\, e_{t+k}\, n_{t+k}, \qquad \alpha(\sigma) = \min\!\big(1, \max(0, (\sigma_{\max}-\sigma)/(\sigma_{\max}-\sigma_{\min}))\big).$$
Here $p^{\text{path}}$ is the nominal look-ahead point, $n$ is the path normal, and $\alpha$ is a gate that is 1 when the twin is confident and 0 when it is not. Both thresholds $\sigma_{\min}$ and $\sigma_{\max}$ are fixed in simulation before any hardware run.
Relation to Prior Work
Several papers motivate the gap by showing that offline residuals help but are frozen. Residual Koopman MPC lifts the residual of a kinematic bicycle model into a linear space and adds a compensation command on an F1TENTH car. Its network is trained on two laps and then frozen. Kulathunga et al. learn quadrotor velocity residuals with a sparse Gaussian process inside nonlinear MPC, also offline. Swift fits aerodynamic residuals from about 50 seconds of flight and never refits them as the battery decays. Sim-to-Real of Soft Robots with Learned Residual Physics corrects a differentiable simulator offline. The GP-enhanced drifting framework is the closest in spirit: it couples look-ahead error with a Gaussian-process tire residual that grows over laps. It is simulation-only, and it pays for a constrained optimal-control solve at every step. We differ from all five by pre-shaping the residual so it adapts within a run, and by acting through the existing tracker's reference rather than through a new optimizer.
Two papers constrain the design. Allamaa et al.'s executable digital twin runs a twin onboard that tunes MPC weights by gradient-free search with injected randomization. The authors themselves flag that unconstrained adaptation can drive the controller unstable, and they validate only sim-versus-sim. We take two lessons from this. First, the twin should send bounded, physically meaningful quantities (path offsets), not controller gains. Second, a guardrail is mandatory. P-ALPaCA supplies two pieces of method: a grey-box meta-learned rover-terrain model with a Bayesian last layer, and an orthogonality penalty that stops the network from absorbing physical parameters. We reuse both. We change the source of the meta-training tasks, which come from a randomized simulator rather than logged terrain. We also close the loop into tracking, which P-ALPaCA does not do. Neural Posterior Domain Randomization infers correlated parameter distributions from real rollouts. We use its posterior-fitting idea only to narrow the randomization ranges after a first hardware session, which addresses the known problem of choosing randomization ranges by hand.
On the tracking side, reference steering with data-driven predictive control (Zeng, Huang, and Xiong) already shows that shifting the reference given to a low-level controller can cancel compliance and latency. Our contribution there is where the predicted error comes from (an adaptive, uncertainty-aware twin) and the use of a horizon of offsets as a message format that tolerates dropouts. Slip-compensated pure pursuit (Mohta et al., Zhang et al. 2024) rotates the look-ahead vector using a slip estimate. It is a hand-designed special case of what the residual learns, and it is a baseline.
Research Program
We will build four components. The first is a randomized simulator of a 1:10 car, plus a CarSim vehicle for the drifting-scale case, with friction, tire stiffness, mass, steering latency, and motor lag drawn per episode. The second is a residual model: a kinematic bicycle model plus a two-layer network feature map with a Bayesian linear last layer. It is meta-trained so that its features span residuals across the randomized simulators, with the P-ALPaCA orthogonality penalty against the bicycle-model terms. The third is the twin loop. Upstream, telemetry updates the last-layer posterior in closed form at every message. Downstream, the twin rolls the nominal tracker forward over a 1-second horizon, computes predicted errors and uncertainties, and sends the gated offsets. The fourth is an onboard buffer that consumes the newest offset sequence and falls back to the unmodified look-ahead point once the sequence expires.
The analysis questions are how much meta-training on randomized simulators shortens the time to adapt, and whether the uncertainty gate actually keeps the scheme from ever doing worse than the plain tracker when reality falls outside the randomized range.
Baselines
The naive reference is the unmodified pure pursuit tracker with a speed-scheduled look-ahead distance, tuned on dry floor. Every method must beat it, and with the gate on, the proposal must never be significantly worse than it on any condition. A stronger hand-designed reference is slip-compensated pure pursuit after Mohta et al., using the same slip estimate available to our twin.
The strongest existing learned method is Residual Koopman MPC, which reports an 11.7%–22.1% reduction in lateral tracking error over its nominal MPC on an F1TENTH car. It trains on 8,933 data points and runs at about 6.7 ms per step. We will reimplement it on the same car with the same two calibration laps and the same per-step compute. We will also run an online-refit variant of it to separate the effect of "adaptive" from the effect of "uses MPC." For the drifting-scale comparison we will use the CarSim variable-radius clothoid from the GP-enhanced drifting framework, which reports a 38% lateral RMSE reduction over its non-GP baseline by the third lap at under 40 ms per solve. Our target there is to match that reduction within the first lap.
The Allamaa twin reports a 63% path-tracking error reduction on the ISO 3888-1 double lane change, but only sim-versus-sim. We will run its gain-adaptation scheme in our loop as the "twin sends gains" alternative. For hand-tuned look-ahead, we found no reported result on Lacuna for the F1TENTH friction-shift setting.
Three ablations isolate the key ingredients. The first keeps the identical architecture but trains it only on real data (no randomized prior). The second applies the randomized prior zero-shot with no online update. The third removes the uncertainty gate. All learned methods get the same real-data budget and the same hyperparameter-search budget.
Beating the strongest baseline means two things. After a mid-run friction drop, the proposal must reach lower lateral RMSE within 5 seconds than frozen and refit Residual Koopman MPC, with comparable steady-state error. And it must keep that advantage when twin latency is injected.
Why not just…?
Why not just run residual MPC onboard and refit it online? This is the real threat. Residual Koopman MPC already fits a 6.7 ms budget on an F1TENTH car, and online refitting could close much of the gap. The proposal's case rests on two settings where that option breaks. One is platforms whose tracker cannot be replaced. The other is twins that run offboard behind a lossy link. The online-refit Residual Koopman MPC baseline, run under a 0–200 ms latency sweep, settles the question. If it matches us onboard and degrades gracefully under latency, then the reference-offset channel offers no advantage in accuracy, and the paper's contribution narrows to the randomized adaptive prior.
Why not just widen domain randomization and accept a robust tracker? The file records that wide randomization produces conservative behavior and treats friction as noise rather than something to estimate. The zero-shot-prior ablation measures exactly this: it shows how much a randomized but non-adapting model leaves on the table after a friction shift.
Why not just learn the residual online from scratch with a Gaussian process, as in the drifting work? This is plausible if data arrive fast enough. The GP-drift result needs about three laps to reach its 38% gain. The no-randomized-prior ablation tests whether meta-training compresses that to seconds. If it does not, the randomized prior is not worth its cost.
Proposed Experiments
Physical experiments use an F1TENTH car on a loop with a removable low-friction section and swappable tire sets, with tire swaps between runs to emulate wear. Each condition gets 20 laps. Metrics are lateral RMSE, maximum deviation, time to recover to within 1.2 times the steady-state error after a friction change, number of track departures, and per-step compute. Simulation adds the CarSim clothoid and ISO 3888-1 at 80 km/h, so results can be compared against the cited papers' reported numbers.
The decisive checks are four. First, a friction drop outside the randomized range, to test that the gate falls back without track departures. Second, a latency and dropout sweep, to test horizon-offset buffering against gain transmission. Third, the no-prior ablation, which tests the central claim about adaptation speed. Fourth, the orthogonality-penalty ablation, which checks whether the fitted bicycle parameters stay physically plausible. The proposal fails if the randomized prior does not shorten recovery time relative to learning from scratch, or if the gate permits even one regression below the plain tracker.
References
- Residual Koopman Model Predictive Control for Enhanced Vehicle Dynamics with Small On-Track Data Input
- Residual Dynamics Learning for Trajectory Tracking for Multi-rotor Aerial Vehicles
- Champion-level drone racing using deep reinforcement learning
- Sim-to-Real of Soft Robots With Learned Residual Physics
- GP-enhanced Autonomous Drifting Framework using ADMM-based iLQR
- Sim2real for Autonomous Vehicle Control using Executable Digital Twin
- Adaptive Meta-Learning for Identification of Rover-Terrain Dynamics
- Neural Posterior Domain Randomization
- Reference-Steering via Data-Driven Predictive Control for Hyper-Accurate Robotic Flying-Hopping Locomotion
- Design of an All-Purpose Terrace Farming Robot
- Universal Trajectory Optimization Framework for Differential Drive Robot Class