From cf0fb8ef181cb7ce54768ca9f967f0eb9b260189 Mon Sep 17 00:00:00 2001 From: Uzair Tariq Date: Sat, 8 Feb 2025 14:29:42 -0700 Subject: [PATCH] fix sign error for strength --- src/modules/autopilot/altimeter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/autopilot/altimeter.py b/src/modules/autopilot/altimeter.py index 2d2cdaf..1d09ad9 100644 --- a/src/modules/autopilot/altimeter.py +++ b/src/modules/autopilot/altimeter.py @@ -308,7 +308,7 @@ def measure(self) -> List[Dict[str, Tuple[float, float]]]: if distance is not None and strength is not None: # Convert strength from 32-bit unsigned to signed int if strength > 0x7FFFFFFF: - strength = -int(0x100000000 - strength) + strength = int(0x100000000 - strength) self.distance_avg.add(distance) self.strength_avg.add(strength)