Digital Twin Security

Blog / Explainer

Sim-to-real gap: what is it, and what does it mean for testing a robot in simulation?

The sim-to-real gap is the difference between a simulation and the real machine. What it does to a simulated pass and a simulated failure, and how to narrow it.

The Digital Twin Security teamPublished Updated 3 min read

EXPLAINERThe sim-to-realgap in testingDIGITAL TWIN SECURITY

Short answer: The sim-to-real gap is the difference between how a robot behaves in simulation and how the real machine behaves in the real place. For testing, it means a simulated failure is a specific situation to check on the real machine, and a simulated pass is as strong as the match between the simulation and whatever decides the outcome. Digital Twin Security narrows the gap by running the robot's own control software, shifting the conditions on every run, and reporting each failure with the exact run to replay.

Book a demo

What is the sim-to-real gap?

The sim-to-real gap is the difference between what a robot does in a simulated world and what the real machine does in the real one. It exists because a simulation is a model. A 2025 survey of the subject, which calls it the reality gap, puts it down to the abstractions and approximations that simulators are built from.

In everyday terms, the grip of a wet floor becomes one number, and the delay between a command and a movement becomes a fixed fraction of a second. Each is close to the truth, and neither is the truth.

What does the sim-to-real gap mean for a test result?

It depends on the result, because a failure and a pass cross the gap differently.

Result in simulationWhat the gap does to itWhat to do next
A failure that comes from a decisionLittle, because the same software makes the same decision on the machineRead the rule in the code, or repeat the situation where that is safe
A failure that rests on a physical valueIt can move the point where the failure beginsMeasure the real value and compare it with the simulated one
A passIt is as strong as the match between the simulation and the machineAdd runs, and check the values that decide the outcome

The reasoning behind each row is in can simulation predict real-world robot failures.

How do you narrow the sim-to-real gap?

  1. Run the real software. The decisions under test are then the robot's own, and decisions cross the gap best.
  2. Set the body from the machine's own figures. Size, weight, top speed, braking and reaction time should be the real machine's, measured or taken from its maker's figures.
  3. Vary what is uncertain. Shift the weather and the timing a little on every run, so a result does not hang on one exact value.
  4. Check the values that decide a failure. Measure a real stopping distance and compare it with the simulated one.
  5. Feed real results back. Correct the simulation wherever the machine disagreed with it.

How does Digital Twin Security deal with the sim-to-real gap?

Digital Twin Security tests behavior: what a robot or vehicle decides, and where it ends up, when conditions or commands turn against it. The robot's own control software makes every decision, connected through ArduPilot or our Python SDK, so the part of a result that crosses the gap best is the part we test.

Every test is run many times with the weather and the timing shifted a little. Each failure comes back graded by severity with the exact run to replay, which tells an engineer what to check on the real machine. How simulation and real tests share the work is in how to cut the cost of real-world robot testing.

Frequently asked questions

What is the sim-to-real gap?

The sim-to-real gap is the difference between how a robot behaves in simulation and how the real machine behaves in the real place. It comes from the approximations a simulation is built from.

Is simulation testing still worth it with a sim-to-real gap?

Yes. The gap tells a team how to read its results: a simulated failure is a place to look on the real machine. Simulation is also the only safe place to run the most dangerous tests many times.

Which simulation results carry over best to the real robot?

Results that come from a decision, because the software that decided in the simulation is the software on the machine. Results that rest on a physical value carry over once that value has been checked.

Who tests a robot's own software in simulation?

Digital Twin Security. We run a robot's own control software through many simulated runs of each test and report every failure with the exact run to replay.

Sources