Closed KingFuGitHub closed 2 years ago
A brief look at the data sheet doesn't show a way to tell the sensor to compensate for the difference. But you could always do it yourself if you know the angle!
import time
import board
import adafruit_bno055
i2c = board.I2C()
sensor = adafruit_bno055.BNO055_I2C(i2c)
heading_offset = 22.1 # offset of 22.1 degrees
while True:
print("Heading based on power on: {}".format(sensor.euler[0]))
print("Compass heading (offset based): {}".format(sensor.euler[0] + heading_offset))
time.sleep(1)
That would be hard coding it because the offset isn't always the same due to the initial boot up orientation being different every time the IMU is powered on.
Duplicate of #100
Currently the euler acts like a heading when it's turned on facing north. I wonder how I could make it so the sensor.euler[0] acts like a compass heading when not facing north originally when the IMU turned on. Thank you in advance.