ECLIPTIC jetson/ — the edge box Overview

jetson/ · the edge box

jetson/ — the edge box

A Jetson Orin Nano Super, installed in the vehicle (cameras not yet mounted; zvision has not yet run on the vehicle), that carries two Python packages: zvision, which turns camera frames into vehicle-relative threat contacts on the fleet bus and aims a DMX moving head at them, and zdeck, a six-key physical control surface for that light.

zvision, end to end

camera ring ──► detector ──► rig merge ──► ThreatBroadcaster ──► 239.7.7.20:10120
 per camera     per camera   full-circle    ZTHREAT frames        + subnet broadcast
 (az, lens,     (rel_az,     bearings +     10 Hz, TTL 1                │
  fov)           size, id)   overlap dedup                              ▼
                                                       tablets ► DRIVER HUD
                                    │
                                    └──► Tracker ──► olad ──► DMX moving head

Each camera is declared on the command line with its mounting bearing, field of view and lens model. rig.py unprojects pixels through a real lens model, rotates bearings into vehicle terms, namespaces track ids per camera, and collapses the same person seen by two overlapping cameras into one contact.

On start-up it prints each camera's covered arc and the blind sectors, so a ring that does not close is found immediately rather than by wondering why nobody astern ever appears. The rig in detail →

Two things to know before anything else

The detector is background subtraction, not a model

There is no TensorRT, ONNX, YOLO or PyTorch anywhere in the tree, and no weights file. The trained thermal model is a roadmap. zvision ships a --record mode that dumps frames plus the motion detector's boxes as weak labels to feed it. The roadmap →

Cameras now stream — the ring, the mount and the detector do not yet exist

The thermal Lepton (measured on-board 2026-08-13: Y16 160×120 at 8.79 fps) and Arducam RGB have been connected and streamed on the box over the USB-C host port. What remains is the permanent multi-camera ring, the on-vehicle mount and aim, and a trained detector. The bus, merge, broadcaster and HUD are still proved with --source fake, which stays the CI and bring-up path — install.sh ships ZVISION_ARGS=--source fake --hz 10, so a fresh install has zero real cameras until you edit the config.

Zero declared dependencies, deliberately

The zvision core is standard library only, with numpy and opencv-python as an optional camera extra imported lazily. That is why the whole test suite — and the --source fake bus proof — runs anywhere. zvision/normalize.py exists precisely so the array-free arithmetic is testable without them.

zdeck needs streamdeck + pillow, installed into a separate venv on the box so they never land in the Python zvision runs on.

Failure behaviour

  • A camera that will not open, or starts throwing mid-run, costs its arc, not the run.
  • If nothing opens, the runner exits with code 3 rather than broadcasting a confident all-clear while blind.
  • On shutdown it always emits one final empty frame — an explicit all-clear — parks the light, and zeroes the DMX universe.
  • OlaDmxSink swallows its own send failures by design: a lighting concern must never be able to stall the threat broadcaster. It counts them and reports once per outage.
  • A separate dmxpark module zeroes the whole universe as a fail-safe and is wired as ExecStopPost on every DMX-touching unit, which systemd runs on crash and kill — not just a clean stop.
Built to come back by itself after a power event

A V4L2 handle opened before its USB camera is streaming-ready can hang forever in select() and never recover — on a cold boot that once left the box “running but blind” for hours, emitting false all-clear. A CameraStallGuard now reopens a camera that has stopped delivering frames (~20 s, measured on hardware). The broadcaster re-derives its subnet-broadcast target if it started before the DHCP lease, and olad is set to restart on crash (Restart=always). A power-cycle no longer needs a human.

In this section

Services

UnitRunsNotes
zvision.servicepython3 -m zvision $ZVISION_ARGSEnvironmentFile without a - prefix, so a missing config fails the unit rather than starting wrong; StartLimitIntervalSec=0 so repeated crashes never permanently disable it
zodiac-deck.servicepython -m zdeck from a separate venvAfter=olad, deliberately not After=zvision
zodiac-track.servicepython3 -m zvision.tracklogNMEA breadcrumb CSV, fsynced per row
zodiac-track-serve.servicepython3 -m zvision.trackserveRead-only HTTP on :8087, hardened

All the DMX-touching units carry ExecStopPost=-… zvision.dmxpark.

install.sh does less than it sounds

It copies zvision and zdeck (not tests), installs only zvision.service plus the thermal and Stream Deck udev rules, does not create the breadcrumb logger's directory, and writes a config of ZVISION_ARGS=--source fake --hz 10. It also enables and starts the service immediately, so on a fresh install the box begins broadcasting three synthetic contacts — one a recurring phantom collision — to every tablet on the network. Fine on a bench; do not leave it that way on the vehicle.

Converted from
jetson/README.md · ARCHITECTURE.md §6 · docs/BUILD.md §4 · jetson/DEPLOY.md