hemanthrajv / flutter_compass

MIT License
98 stars 141 forks source link

negative values heading #91

Open simkosal opened 1 year ago

simkosal commented 1 year 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;
  }