From 22dffc5d694ed7125bc5e257ca357f5b3c361a96 Mon Sep 17 00:00:00 2001 From: itsrubberduck Date: Fri, 19 Jun 2026 13:36:30 +0200 Subject: [PATCH] feat(bridge): map GPS position + true heading into telemetry Bridge now sends latitude_deg/longitude_deg/heading_deg; map them to PLANE_LATITUDE/PLANE_LONGITUDE/PLANE_HEADING_DEGREES_TRUE so position and course land in the telemetry store and surface in /api/bridge/live. Co-Authored-By: Claude Opus 4.8 --- server/api/bridge/data.post.ts | 3 +++ shared/data/flightlab/types.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/server/api/bridge/data.post.ts b/server/api/bridge/data.post.ts index 90a34fe..63ab64e 100644 --- a/server/api/bridge/data.post.ts +++ b/server/api/bridge/data.post.ts @@ -59,6 +59,9 @@ function mapBridgeTelemetry(raw: Record): FlightLabTelemetryState { ADF_STANDBY_FREQUENCY: raw.adf_standby_freq_hz ?? raw.ADF_STANDBY_FREQUENCY ?? 0, COM_ACTIVE_FREQUENCY: raw.com_active_frequency ?? raw.COM_ACTIVE_FREQUENCY ?? 0, COM_STANDBY_FREQUENCY: raw.com_standby_frequency ?? raw.COM_STANDBY_FREQUENCY ?? 0, + PLANE_LATITUDE: raw.latitude_deg ?? raw.PLANE_LATITUDE ?? 0, + PLANE_LONGITUDE: raw.longitude_deg ?? raw.PLANE_LONGITUDE ?? 0, + PLANE_HEADING_DEGREES_TRUE: raw.heading_deg ?? raw.PLANE_HEADING_DEGREES_TRUE ?? 0, } } diff --git a/shared/data/flightlab/types.ts b/shared/data/flightlab/types.ts index 5438ea4..bccfba9 100644 --- a/shared/data/flightlab/types.ts +++ b/shared/data/flightlab/types.ts @@ -40,6 +40,9 @@ export interface FlightLabTelemetryState { ADF_STANDBY_FREQUENCY: number // Hz COM_ACTIVE_FREQUENCY?: number // MHz (e.g. 121.900), COM1 active radio COM_STANDBY_FREQUENCY?: number // MHz, COM1 standby radio + PLANE_LATITUDE?: number // degrees, WGS84 (N+) + PLANE_LONGITUDE?: number // degrees, WGS84 (E+) + PLANE_HEADING_DEGREES_TRUE?: number // degrees, 0..360 timestamp?: number }