imu: raw samples on yukart/raw/imu, recorded as imu.ndjson; calibration from a session
/ crosscheck (push) Successful in 1s
Rust (L4T) / Clippy, test, build, glibc (push) Successful in 15s

--calibrate SESSION [--write]: down from two level stretches (turning round cancels
the slope), forward from straight pull-aways and stops; saved to
/var/lib/yukart/imu/mount.json (StateDirectory), which the service reloads on change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DDwfd6Ki8UfG4hK6W5YpJz
This commit is contained in:
2026-10-14 13:28:40 +09:00
parent e350245e17
commit 26d5e3cbe4
8 changed files with 429 additions and 20 deletions
+3 -2
View File
@@ -15,12 +15,12 @@ needed.
| Binary | Installed as | Does |
|---|---|---|
| `recorder` | `yukart-recorder.service` | Raw CAN + GNSS to disk, in sessions, under a storage bound; every `yukart/vehicle/*` value (decoded and OBD-II) beside them |
| `recorder` | `yukart-recorder.service` | Raw CAN + GNSS to disk, in sessions, under a storage bound; every `yukart/vehicle/*` value (decoded and OBD-II) and every raw IMU sample (`yukart/raw/imu`) beside them |
| `decoder` | `yukart-decoder.service` | The car's own broadcast frames to named signals (`yukart/vehicle/*`): every `z27ag` signal in contracts' `signals.json`, laid out by its `can` block. Sent on change (booleans at once, numbers at most every 50 ms); a value that has not changed is re-sent once a second, so svc-gw never marks a steady one stale; reads only |
| `bus-bench` | not installed: a test tool | Raw CAN and decoded-signal load over MQTT, measured: loss, latency, broker CPU ([report](docs/impl/reports/BUS-BENCH.md)) |
| `obd-poller` | `yukart-obd-poller.service` | OBD-II mode 01 on the K-line through the Bluetooth ELM327 (address in `/etc/default/yukart-elm`), the single writer to the car; never on CAN. The `obd_*` signals, calibration references (`yukart/vehicle/*`): rpm, speed, throttle, load, MAF, timing, O2 every round; temperatures and trims every 5 s. Lets go of the adapter after a minute of ECU silence |
| `gnss` | `yukart-gnss.service` | gpsd's fix as single values on `yukart/gnss/*`: fix, speed, heading, position, altitude, satellites |
| `imu` | `yukart-imu.service` | The WT61 (plus) on any USB-UART adapter, found by itself (adapter and speed), turned into the car's frame (`--forward`, `--right`): roll, pitch, gravity-free longitudinal and lateral g, yaw rate on `yukart/imu/*`, at most every 40 ms. Never writes to the module |
| `imu` | `yukart-imu.service` | The WT61 (plus) on any USB-UART adapter, found by itself (adapter and speed), turned into the car's frame (`--forward`, `--right`): roll, pitch, gravity-free longitudinal and lateral g, yaw rate on `yukart/imu/*`, at most every 40 ms; every sample raw on `yukart/raw/imu` for the recorder. Mounting from `/var/lib/yukart/imu/mount.json` when calibrated (`--calibrate SESSION --write`, from checklist steps 27–30). Never writes to the module |
| `orin-status` | `yukart-orin-status.service` | The Orin's health on the bus, once a second: temperatures, CPU/GPU load, memory, power, fan, WiFi (with SSID)/LTE/tablet links, the CAN interface, the ELM's Bluetooth link, UPS battery (`yukart/host/*`). Powers the Orin off cleanly when the UPS pack stays below 11.0 V while discharging for 30 s |
```bash
@@ -36,6 +36,7 @@ yukart-obd-poller --elm ADDR --once # on the Orin, service stopped: adapt
# supported PIDs and one value each
yukart-gnss --once # the next fix as JSON, no broker
yukart-imu --once # find the WT61, 3 s of readings as JSON, no broker
yukart-imu --calibrate SESSION_DIR [--write] # measure the mounting from checklist steps 27–30
yukart-orin-status --once # on an Orin: one reading as JSON, no broker
yukart-recorder ctl status # on the Orin
yukart-recorder ctl start "cold start" # manual session, ends only on stop