diff --git a/docs/BOUNDARY.md b/docs/BOUNDARY.md index 872f94c..0bbffe8 100644 --- a/docs/BOUNDARY.md +++ b/docs/BOUNDARY.md @@ -37,7 +37,7 @@ The two channels from decision 24 share the socket but keep different guarantees | `ack` | reply to a `cmd` | `id`, `ok`, `detail`, `dup` (true when answered from the cache) | With `source: bus`, `signals` is the newest envelope of every signal svc-gw has -seen on `yukart/vehicle/+`, `yukart/host/+` and `yukart/gnss/+`. svc-gw marks one +seen on `yukart/vehicle/+`, `yukart/host/+`, `yukart/gnss/+` and `yukart/imu/+`. svc-gw marks one `quality: "stale"` when it has not been refreshed for 5 s, or is known only from the broker's retained copy (which may predate a reboot). A signal once seen is never removed. diff --git a/schema/signals.json b/schema/signals.json index c4480c9..b580ce9 100644 --- a/schema/signals.json +++ b/schema/signals.json @@ -1,5 +1,5 @@ { - "$comment": "Single source for signal identity. Topic name and envelope unit are both derived from these entries and are never authored separately. source=obd2 is standardised (OBD-II mode 01 over the K-line, through the ELM327): calibration references, every name prefixed obd_ (project-yukart decision 30); source=host is the Orin itself (orin-status), not the car. source=gnss is the receiver (svc-core gnss), on yukart/gnss/. source=z27ag is reverse-engineered from the car's own broadcast frames, and its 'can' block is the only place its layout is written down: id (11-bit, hex string), byte (first data byte, 0-7), length in bits (1, 8 or 16), bit (length 1 only: 0 = LSB of that byte), order (length 16: big = byte first is most significant, little = the reverse), scale and offset (value = raw * scale + offset; booleans are raw != 0). 'evidence' names the contracts report that found it.", + "$comment": "Single source for signal identity. Topic name and envelope unit are both derived from these entries and are never authored separately. source=obd2 is standardised (OBD-II mode 01 over the K-line, through the ELM327): calibration references, every name prefixed obd_ (project-yukart decision 30); source=host is the Orin itself (orin-status), not the car. source=gnss is the receiver (svc-core gnss), on yukart/gnss/. source=imu is the WT61 IMU, already turned into the car's frame (mounting and gravity handled by its publisher), on yukart/imu/. source=z27ag is reverse-engineered from the car's own broadcast frames, and its 'can' block is the only place its layout is written down: id (11-bit, hex string), byte (first data byte, 0-7), length in bits (1, 8 or 16), bit (length 1 only: 0 = LSB of that byte), order (length 16: big = byte first is most significant, little = the reverse), scale and offset (value = raw * scale + offset; booleans are raw != 0). 'evidence' names the contracts report that found it.", "signals": { "obd_vehicle_speed_kph": { "unit": "kph", @@ -634,6 +634,56 @@ 0, 64 ] + }, + "imu_roll_deg": { + "unit": "degree", + "type": "number", + "source": "imu", + "description": "Body roll in the car's frame: positive leaning right (right side down)", + "range": [ + -180, + 180 + ] + }, + "imu_pitch_deg": { + "unit": "degree", + "type": "number", + "source": "imu", + "description": "Body pitch in the car's frame: positive nose up", + "range": [ + -90, + 90 + ] + }, + "imu_accel_lon_g": { + "unit": "g", + "type": "number", + "source": "imu", + "description": "Longitudinal acceleration in the car's frame, gravity removed: positive forward (speeding up), negative braking", + "range": [ + -4, + 4 + ] + }, + "imu_accel_lat_g": { + "unit": "g", + "type": "number", + "source": "imu", + "description": "Lateral acceleration in the car's frame, gravity removed: positive to the right (a right turn reads positive)", + "range": [ + -4, + 4 + ] + }, + "imu_yaw_rate_dps": { + "unit": "degree/s", + "type": "number", + "source": "imu", + "description": "Yaw rate: positive turning left (counter-clockwise from above)", + "range": [ + -500, + 500 + ] } } } diff --git a/schema/topics.json b/schema/topics.json index 2974e96..9fe3fee 100644 --- a/schema/topics.json +++ b/schema/topics.json @@ -29,6 +29,13 @@ "publisher": "gnss", "description": "The receiver's fix as single values, one topic per signal, named exactly as in signals.json (source=gnss). For displays; yukart/gnss/fix stays the composite for navigation." }, + "yukart/imu/": { + "payload": "envelope", + "retained": true, + "rate": "10-50/s", + "publisher": "imu", + "description": "The IMU (WT61) in the car's frame: attitude, gravity-free acceleration, yaw rate; one topic per signal, named exactly as in signals.json (source=imu)." + }, "yukart/host/": { "payload": "envelope", "retained": true,