Skip to content

Commit 1982948

Browse files
committed
fixed heading order
1 parent 0f446db commit 1982948

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

adafruit_bno08x_rvc.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ def _parse_frame(frame):
4646
(
4747
_index,
4848
yaw,
49-
roll,
5049
pitch,
50+
roll,
5151
x_accel,
5252
y_accel,
5353
z_accel,
@@ -60,20 +60,20 @@ def _parse_frame(frame):
6060
if checksum_calc != _checksum:
6161
return None
6262
yaw *= 0.01
63-
roll *= 0.01
6463
pitch *= 0.01
64+
roll *= 0.01
6565
x_accel *= 0.0098067
6666
y_accel *= 0.0098067
6767
z_accel *= 0.0098067
68-
return (yaw, roll, pitch, x_accel, y_accel, z_accel)
68+
return (yaw, pitch, roll, x_accel, y_accel, z_accel)
6969

7070
@property
7171
def heading(self):
7272
"""The current heading made up of
7373
74-
* Roll
75-
* Pitch
7674
* Yaw
75+
* Pitch
76+
* Roll
7777
* X-Axis Acceleration
7878
* Y-Axis Acceleration
7979
* Z-Axis Acceleration

examples/bno08x_rvc_simpletest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
uart = busio.UART(board.TX, board.RX, baudrate=115200, receiver_buffer_size=2048)
1010
rvc = BNO08x_RVC(uart)
1111
while True:
12-
roll, pitch, yaw, x_accel, y_accel, z_accel = rvc.heading
13-
print("Roll: %2.2f Pitch: %2.2f Yaw: %2.2f Degrees" % (roll, pitch, yaw))
12+
yaw, pitch, roll, x_accel, y_accel, z_accel = rvc.heading
13+
print("Yaw: %2.2f Pitch: %2.2f Roll: %2.2f Degrees" % (yaw, pitch, roll))
1414
print("Acceleration X: %2.2f Y: %2.2f Z: %2.2f m/s^2" % (x_accel, y_accel, z_accel))
1515
print("")
1616
time.sleep(0.1)

0 commit comments

Comments
 (0)