hemanthrajv / flutter_compass

MIT License
102 stars 188 forks source link

negative values heading #91

Open simkosal opened 2 years ago

simkosal commented 2 years ago

The heading is not accuracy

https://i.imgur.com/1vAbrw5.jpg

fvisticot commented 1 year ago

Same issue with negative value. Any update / advice ?

DmitriySimonov commented 1 year ago

Same issue

abdulwahabone commented 1 year ago

I used this hacky solution to fix the heading. Its a temporary hack.

  double sanitizeHeading(double? hd) {
    if (hd == null) return 0;
    if (hd < 0) return 360 + hd;
    if (hd > 0) return hd;
    return hd;
  }