fix:更新gps数据处理

This commit is contained in:
nnbcccscdscdsc
2026-04-11 13:56:37 +08:00
parent 59990b0e7c
commit 906428fc3b
5 changed files with 42 additions and 6 deletions

View File

@@ -182,6 +182,8 @@ class OmniSocketVideoReceiver:
return None
if not (-90.0 <= latitude <= 90.0) or not (-180.0 <= longitude <= 180.0):
return None
if abs(latitude) < 1e-9 and abs(longitude) < 1e-9:
return None
timestamp_ns = timestamp_ms * VIDEO_TRAILER_TIMESTAMP_MULTIPLIER_NS
if abs(time.time_ns() - timestamp_ns) > VIDEO_TRAILER_TIMESTAMP_MAX_SKEW_NS:
@@ -191,6 +193,8 @@ class OmniSocketVideoReceiver:
timestamp_ns=timestamp_ns,
latitude=latitude,
longitude=longitude,
raw_latitude_hex=trailer[8:16].hex(),
raw_longitude_hex=trailer[16:24].hex(),
received_at=received_at if received_at is not None else time.time(),
)