Skip to content

Commit

Permalink
fix sign error for strength
Browse files Browse the repository at this point in the history
  • Loading branch information
wrongsyntax committed Feb 8, 2025
1 parent f8b7085 commit cf0fb8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/autopilot/altimeter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cf0fb8e

Please sign in to comment.