From f59b22bddbf25bd17bfa78f9baeef2c2ed543e5c Mon Sep 17 00:00:00 2001 From: Mathieu Pellerin Date: Mon, 5 Aug 2024 14:40:35 +0700 Subject: [PATCH] Insure that the orientation value is between 0 and 360 (instead of ~-90 to 270) --- src/core/positioning/positioning.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/positioning/positioning.cpp b/src/core/positioning/positioning.cpp index d51d2283a4..da5b6f8570 100644 --- a/src/core/positioning/positioning.cpp +++ b/src/core/positioning/positioning.cpp @@ -325,7 +325,13 @@ void Positioning::processCompassReading() default: break; } + orientation += mCompass.reading()->azimuth(); + if ( orientation < 0.0 ) + { + orientation = 360 + orientation; + } + if ( mOrientation != orientation ) { mOrientation = orientation;