Skip to content

Commit 9836753

Browse files
authored
Heading Geometry Update
Updated math to correctly constrain angle of heading in radians to be from -pi to pi.
1 parent 0f8a7d1 commit 9836753

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

examples/LSM9DS1_Basic_SPI/LSM9DS1_Basic_SPI.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@ void printAttitude(float ax, float ay, float az, float mx, float my, float mz)
234234

235235
if (heading > PI) heading -= (2 * PI);
236236
else if (heading < -PI) heading += (2 * PI);
237-
else if (heading < 0) heading += 2 * PI;
238237

239238
// Convert everything from radians to degrees:
240239
heading *= 180.0 / PI;

0 commit comments

Comments
 (0)