Skip to content

Commit

Permalink
Insure that the orientation value is between 0 and 360 (instead of ~-…
Browse files Browse the repository at this point in the history
…90 to 270)
  • Loading branch information
nirvn committed Aug 6, 2024
1 parent e426010 commit 028b674
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/positioning/positioning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

1 comment on commit 028b674

@qfield-fairy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.