TactivergeLite

Lite / Intelligent Robotic Systems / Week 31

The latency budget

At 1.5 m/s, a robot covers 9 cm in 60 ms. That is how far it travels after seeing an obstacle and before it even starts to brake.

About 30 min · 3 goals · Checked by automated tests · Full interactive version

Why should I care?

A robot reacts to the world as it was, not as it is. Adding up every delay between sensing and acting tells you how stale that picture is, how fast the robot can safely move, and where to spend effort speeding things up.

Predict

A pipeline has five stages: 16, 30, 8, 2 and 10 ms. Which single change saves the most time?

  1. Halve the 2 ms bus message
  2. Halve the 30 ms vision stage
  3. Halve the 8 ms planner
Guess first, then reveal

Halving vision saves 15 ms; the bus would save 1 ms. Optimise the biggest stage first: the total is dominated by it.

Discover

Start with the default stages and a 60 ms deadline. Raise the robot's speed and watch the reaction distance. Then set the deadline to 40 ms and get back within budget by changing as few stages as possible.

What the interactive shows (text version)

The latency-budget lab shows five stages as a stacked bar against a dashed deadline line. Default stages add to 66 milliseconds, over a 60 millisecond deadline; at 1.5 metres per second that is about 10 centimetres travelled before reacting.

You can also open the interactive on the full site when you have a faster connection.

Understand

Latencies in series add

Sense-to-act latency is the sum of every stage: sensor exposure and readout, transfer, processing, planning, communication to the motor controller, and the actuator's own response. Slack = deadline − total. Negative slack means the robot cannot meet its reaction requirement.

Latency is distance

Distance travelled before reacting = speed × latency. At 1.5 m/s, 60 ms is 9 cm. A safety requirement such as 'stop within 30 cm of an obstacle' therefore limits speed, latency or both, and braking distance comes on top.

Jitter and margin

Real stages do not take the same time every cycle; some frames take much longer. Budget with worst-case or high-percentile timings and keep a margin, and timestamp data so a late result can be recognised rather than trusted.

Explain it another way

Intuitive

A relay race: the team's time is the sum of every leg, and the slowest runner costs the most.

Technical

End-to-end latency is the sum of stage latencies along the critical path (plus waiting time when stages run at different rates). Design compares the worst case against the deadline derived from the safety case.

Mathematical

Total = Σ tᵢ. Slack = T_deadline − Σ tᵢ. Distance = v × Σ tᵢ. With 16 + 30 + 8 + 2 + 10 = 66 ms and a 60 ms deadline, slack = −6 ms.

Applied

Driver-assistance and mobile-robot teams budget camera-to-brake latency explicitly, because it directly sets the safe speed.

Worked example 1

Stages 12, 25, 5, 2, 6 ms; deadline 50 ms; speed 2 m/s. Find slack and reaction distance.

Total = 50 ms, slack = 0 ms (just in budget, no margin). Distance = 2 × 0.05 = 0.1 m = 10 cm.

Common mix-ups

Practice

Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.

ms

ms

cm

Practice 4. You must cut 10 ms. Stages: camera 16, vision 30, plan 8, bus 2, motor 10. Where do you look first?
Practice 5. Why budget with worst-case timings rather than averages?

Apply it

For a robot that must stop within 25 cm of an obstacle with 15 cm of braking distance, find the maximum safe speed for your default latency budget. Then say which stage you would optimise to allow 50 % more speed.

Reflect

Where else in daily life does a delay turn directly into distance?

Write your answer on paper or in your own notes. Lite never stores what you write.

← Interface contractsOne connection at a time →