Engineering Guides · Module 19
Validating SLAM accuracy and navigation success rate
To prove a 95 % success rate you need far more than 20 trials. Compute how many before you test.
Assumptions: Numbers in the examples are illustrative and the code is executed by the site’s tests. Facts taken from a cited source are marked; other statements are general engineering knowledge and must be confirmed on the datasheet of the part you use.
1. Engineering problem
A requirement such as “95 % of goals reached” is a statistical claim. A handful of successful runs cannot prove it; the number of trials needed depends on the rate you want to demonstrate and the confidence you want.
2. When is this needed?
- Writing acceptance criteria.
- Before release.
- Comparing two versions.
3. Selection and design decisions
For s successes in n trials the Wilson score interval gives a 95 % interval for the success rate that behaves well for small n and rates near 100 %. A requirement is demonstrated when the lower bound exceeds the required rate. For SLAM, report loop-closure drift and absolute trajectory error (see the SLAM evaluation guide) over several loops and environments, with the worst case.
| Claim | Evidence needed |
|---|---|
| Success rate at least R | Lower bound of the interval above R |
| No regression between versions | Same trials, intervals compared (see the benchmarking guide) |
| Drift below X % of distance | Several loops per environment with the worst case below X |
| Works in condition C | Trials covering C, reported separately |
4. Advantages and disadvantages
- More trials tighten the interval; the cost is test time, and automation helps.
- Several conditions multiply the number of trials.
- A looser requirement needs fewer trials and may not satisfy the customer.
5. Requirements and constraints
- The requirement and the confidence level are written before testing.
- Trials are independent and cover the ODD.
- Failures are analysed and reported, not dropped.
6. Architecture
requirement + confidence ─▶ required number of trials ─▶ trials ─▶ interval ─▶ pass if the lower bound ≥ requirement7. Implementation
- Write the requirement as a rate and a confidence.
- Compute the trials needed (below).
- Run them across the conditions.
- Compute the interval and the drift statistics.
- Decide: release, fix and repeat, or relax the requirement.
import math
def wilson(s, n, z=1.96):
p = s / n; d = 1 + z * z / n; c = (p + z * z / (2 * n)) / d
h = z * math.sqrt(p * (1 - p) / n + z * z / (4 * n * n)) / d
return c - h, c + h
for s, n in ((48, 50), (190, 200), (200, 200)):
lo, hi = wilson(s, n)
print(f"{s}/{n} goals reached ({s / n * 100:.0f} %): 95 % interval {lo * 100:.1f} to {hi * 100:.1f} %")
target = 95.0
for n in (50, 200, 1000):
lo, hi = wilson(round(0.98 * n), n)
print(f"at a true success rate of 98 %, {n} trials give a lower bound of about {lo * 100:.1f} %: requirement {target:.0f} % is", "provable" if lo * 100 >= target else "not provable yet")
drift = [0.8, 1.1, 0.9, 1.4, 1.0]
print(f"SLAM loop-closure drift over five loops: mean {sum(drift) / 5:.2f} %, worst {max(drift):.1f} % of distance travelled")Printed (checked by the site’s tests):
48/50 goals reached (96 %): 95 % interval 86.5 to 98.9 %
190/200 goals reached (95 %): 95 % interval 91.0 to 97.3 %
200/200 goals reached (100 %): 95 % interval 98.1 to 100.0 %
at a true success rate of 98 %, 50 trials give a lower bound of about 89.5 %: requirement 95 % is not provable yet
at a true success rate of 98 %, 200 trials give a lower bound of about 95.0 %: requirement 95 % is not provable yet
at a true success rate of 98 %, 1000 trials give a lower bound of about 96.9 %: requirement 95 % is provable
SLAM loop-closure drift over five loops: mean 1.04 %, worst 1.4 % of distance travelledReading it: 48 of 50 is 96 % with a 95 % interval of 86.5 to 98.9 %; 190 of 200 is 95 % with 91.0 to 97.3 %; 200 of 200 is 98.1 to 100 %. If the true rate is 98 %, 50 trials give a lower bound near 89.5 % and 200 trials about 95 %, so a 95 % requirement is provable only with about 1 000 trials. Five loops show a mean drift of 1.04 % of distance, worst 1.4 %. Numbers are illustrative.
8. Real examples
- Acceptance test: 1 000 automated navigation runs over a week, interval computed per route.
9. Failure scenarios
- Claiming 95 % from 20 runs.
- Combining easy and hard routes into one rate.
- Throwing away failed runs.
10. Troubleshooting
- If the lower bound is just below the requirement, run more trials.
- If failures cluster, find the factor and fix it.
- Check independence between runs.
11. Validation
- The calculation prints the lines shown (executed by the site tests).
- The acceptance report states the requirement, the trials, the interval and the worst-case drift.
12. Engineering checklist
13. Further references
- The Wilson score interval is a standard binomial confidence interval; see statistics texts.