fix lỗi giải mã byte encoding

This commit is contained in:
admin committed 2026-09-13 16:42:32 +07:00
1 parent 7f4d68e821
commit 1682808956
3 files changed
+62 -28

No files matched your search

+6 -8
View File
@@ -135,15 +135,13 @@ class RadarState:
self.target_count = frame.get("target_count", 0)
now = time.time()
# Belt-and-suspenders physical-limits filter. The ESP32 side
# should already have gated these, but in case old firmware is
# still running or an ACK frame leaks through, we re-apply the
# same sanity rules on the Orange Pi side:
# Y in front of radar (y >= 1 mm), <= 6000 mm rated range
# |X| <= 6000 mm (±60° cone + safety margin)
# Belt-and-suspenders physical-limits filter, kept in sync with
# the LD2453 ESP32 parser (sign-magnitude 15-bit magnitude +
# nominal range extended to 6.5 m ceiling to avoid false drops
# on real near-max-range targets, see LD2453Parser.cpp §0 and §2).
PHYS_Y_MIN = 1
PHYS_Y_MAX = 6000
PHYS_X_ABS = 6000
PHYS_Y_MAX = 6500
PHYS_X_ABS = 6500
valid_targets_this_frame = 0
targets_data = frame.get("targets", [])