Unit 21 · Integration & evidence
Edge compute and latency
Mission: Get a fresh camera or sensor result without a growing queue.
The interactive version of this unit needs JavaScript. Below are its steps as text.
Steps
1. A fresh result
Press “Send frame” to follow one image.
Why it matters: A useful result comes after the image enters processing.
2. Inside the processor
Press “Process” to see the processor work.
Why it matters: Processing takes time even when no other frame waits.
3. Another arrival
Press “Send burst” to send more frames.
Why it matters: The camera can offer work more often than the processor finishes it.
4. Frames wait
Press “Watch queue” and stop while frames still arrive.
Why it matters: Waiting adds delay before work begins. This waiting line is a queue.
5. Recall waiting
Press “Repeat queue” to revisit the burst.
Why it matters: Waiting time depends on earlier work as well as the current frame.
6. Time to useful output
Press “Measure latency” to reveal elapsed times.
Why it matters: Latency is the elapsed time from input to useful output. An unfinished frame has no final latency yet.
7. Fewer observations
Press “Slow arrivals” to compare 10 fps with the same 50 ms service.
Why it matters: Changing the offered frame rate changes observation frequency. Each operation still takes 50 ms.
8. Faster processing
Press “Speed processor” to compare 20 ms service at 30 fps.
Why it matters: Only the processing time changes from the 30 fps baseline. The useful result can arrive sooner.
9. Recall the tradeoff
Press “Compare” to revisit the 30 fps baseline.
Why it matters: A short operation can still fall behind if arrivals are closer together than its service time.
10. Watch completed results
Press “Plot results” to plot only finished frames.
Why it matters: Throughput is the rate of completed work. It is distinct from the offered arrival rate.
11. Energy needs a method
Press “Show window” to finish the burst.
Why it matters: Energy can be calculated from average power times matching elapsed time. Speed alone does not reveal power.
12. Drain and report
Press “Drain burst” to finish all 30 frames.
Why it matters: The worst observed value is not a guaranteed deadline. A continuously overloaded input would keep growing instead of ending after 30 frames.
Go deeper
Definitions and limits
Edge compute runs processing near the sensor or robot. Profile this existing laptop first; consider onboard compute only if profiling shows a need. The toy uses 30 instantaneous arrivals, a single FIFO processor, no drops and no concurrency. Capture, network and display are excluded. Offered fps differs from steady capacity 1000 / service ms and finite-batch throughput 30 / (last finish − first arrival) × 1000 fps. This is not a faithful ROS 2 QoS model; DDS and executor behavior varies.
latency = wait + service; energy (J) = average power (W) × matching wall time (s)
An OS power estimate is an estimate. CPU package power and whole-laptop wall power have different scopes and cannot be compared directly. Activity Monitor’s Energy Impact is a relative score, not watts; do not multiply it by seconds to claim joules. A zero timer reading can reflect timer resolution, not zero work. If the timing batch is shorter than your power method can resolve, repeat a separate sustained workload and record a matching power/time window; do not infer accurate energy from an unresolved short sample. The profiler repeats one image, not 30 camera observations; it does not measure inference, capture-to-robot response, ROS latency or power.
Optional ROS 2 context
Public video question: Why can a fast model still react slowly? Prerequisites: Units 11 and 14. ROS 2 concepts and recording are optional depth, not an installation prerequisite. Choose a distribution compatible with your system: Jazzy targets Ubuntu 24.04; Humble can be used on Ubuntu 22.04. Unit 22 mission integration remains separate.