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.
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.
- Add the latencies of a sense-to-act pipeline and compare the total with a deadline.
- Convert latency into distance travelled at a given speed.
- Decide which stage to optimise first.
Predict
A pipeline has five stages: 16, 30, 8, 2 and 10 ms. Which single change saves the most time?
- Halve the 2 ms bus message
- Halve the 30 ms vision stage
- 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.
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
Making the fastest stage even faster is a good use of effort.
✓ Savings come from the largest stages; a 2 ms stage can save at most 2 ms.
Practice
Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.
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.