Define the envelope, topic namespace and OBD-II signal registry

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013kj58Jugkic783b8ZrtTVZ
This commit is contained in:
2026-09-05 12:54:14 +09:00
commit 8f490aba8e
8 changed files with 317 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://yukart/schema/envelope.json",
"title": "Signal envelope",
"description": "Every decoded signal published on yukart/vehicle/* and yukart/gnss/*. Raw CAN uses the binary frame encoding instead.",
"type": "object",
"required": [
"timestamp",
"monotonic",
"value",
"unit"
],
"additionalProperties": false,
"properties": {
"timestamp": {
"type": "integer",
"description": "UTC epoch microseconds. Absolute reference. Subject to NTP steps; use monotonic for ordering."
},
"monotonic": {
"type": "integer",
"description": "Nanoseconds from CLOCK_MONOTONIC. Authoritative for ordering and for any interval within a session. Not comparable across boots."
},
"value": {
"type": [
"number",
"string",
"boolean",
"null"
],
"description": "null means the signal is known but currently has no value."
},
"unit": {
"type": "string",
"description": "Derived from signals.json. Never authored per message."
},
"quality": {
"enum": [
"ok",
"stale",
"invalid"
],
"default": "ok",
"description": "Omitted when ok."
},
"mock": {
"type": "boolean",
"default": false,
"description": "Present and true when synthesised. Must be rendered visibly by any display."
}
}
}
+95
View File
@@ -0,0 +1,95 @@
{
"$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; source=z27ag is reverse-engineered and lives in the DBC.",
"signals": {
"engine_rpm": {
"unit": "rpm",
"type": "number",
"source": "obd2",
"description": "Engine speed",
"range": [
0,
8000
]
},
"vehicle_speed_kph": {
"unit": "kph",
"type": "number",
"source": "obd2",
"description": "Road speed",
"range": [
0,
255
]
},
"coolant_temp_c": {
"unit": "celsius",
"type": "number",
"source": "obd2",
"description": "Engine coolant temperature",
"range": [
-40,
215
]
},
"intake_air_temp_c": {
"unit": "celsius",
"type": "number",
"source": "obd2",
"description": "Intake air temperature",
"range": [
-40,
215
]
},
"throttle_pct": {
"unit": "percent",
"type": "number",
"source": "obd2",
"description": "Throttle position",
"range": [
0,
100
]
},
"engine_load_pct": {
"unit": "percent",
"type": "number",
"source": "obd2",
"description": "Calculated engine load",
"range": [
0,
100
]
},
"fuel_level_pct": {
"unit": "percent",
"type": "number",
"source": "obd2",
"description": "Fuel tank level",
"range": [
0,
100
]
},
"intake_pressure_kpa": {
"unit": "kpa",
"type": "number",
"source": "obd2",
"description": "Intake manifold absolute pressure",
"range": [
0,
255
]
},
"maf_gps": {
"unit": "g/s",
"type": "number",
"source": "obd2",
"description": "Mass air flow rate",
"range": [
0,
656
]
}
}
}
+54
View File
@@ -0,0 +1,54 @@
{
"root": "yukart",
"topics": {
"yukart/can/raw": {
"payload": "binary",
"retained": false,
"rate": "1000-3000/s",
"publisher": "can-bridge",
"description": "Timestamped raw frames. Binary, not the JSON envelope."
},
"yukart/vehicle/<signal>": {
"payload": "envelope",
"retained": true,
"rate": "1-50/s",
"publisher": "decoder",
"description": "One topic per signal, named exactly as in signals.json."
},
"yukart/gnss/fix": {
"payload": "envelope",
"retained": true,
"rate": "1-10/s",
"publisher": "gnss",
"description": "value is an object: lat, lon, alt_m, speed_kph, heading_deg, fix, satellites."
},
"yukart/system/<service>": {
"payload": "json",
"retained": true,
"rate": "on change",
"publisher": "every service",
"description": "state: starting|ready|degraded|stopping, plus service-specific detail."
},
"yukart/nav/guidance": {
"payload": "json",
"retained": true,
"rate": "on change",
"publisher": "svc-nav",
"description": "Next manoeuvre, distance, street name."
},
"yukart/nav/route": {
"payload": "json",
"retained": true,
"rate": "on change",
"publisher": "svc-nav",
"description": "Active route geometry."
},
"yukart/session/mark": {
"payload": "json",
"retained": false,
"rate": "human",
"publisher": "svc-gw",
"description": "Operator event stamped into the recording. Carries both clocks like the envelope."
}
}
}