adafruit_bno08x
¶
Helper library for the Hillcrest Laboratories BNO08x IMUs
Author(s): Bryan Siepert
Implementation Notes¶
Hardware:
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https:# github.com/adafruit/circuitpython/releases
- class adafruit_bno08x.BNO08X(reset: DigitalInOut | None = None, debug: bool = False)¶
Library for the BNO08x IMUs from Hillcrest Laboratories
- Parameters:
i2c_bus (I2C) – The I2C bus the BNO08x is connected to.
- property acceleration: Tuple[float, float, float] | None¶
A tuple representing the acceleration measurements on the X, Y, and Z axes in meters per second squared
- property activity_classification: dict | None¶
Returns the sensor’s assessment of the activity that is creating the motions that it is sensing, one of:
“Unknown”
“In-Vehicle”
“On-Bicycle”
“On-Foot”
“Still”
“Tilting”
“Walking”
“Running”
“On Stairs”
- property game_quaternion: Tuple[float, float, float, float] | None¶
A quaternion representing the current rotation vector expressed as a quaternion with no specific reference for heading, while roll and pitch are referenced against gravity. To prevent sudden jumps in heading due to corrections, the
game_quaternion
property is not corrected using the magnetometer. Some drift is expected
- property geomagnetic_quaternion: Tuple[float, float, float, float] | None¶
A quaternion representing the current geomagnetic rotation vector
- property gravity: Tuple[float, float, float] | None¶
A tuple representing the gravity vector in the X, Y, and Z components axes in meters per second squared
- property gyro: Tuple[float, float, float] | None¶
A tuple representing Gyro’s rotation measurements on the X, Y, and Z axes in radians per second
- property linear_acceleration: Tuple[float, float, float] | None¶
A tuple representing the current linear acceleration values on the X, Y, and Z axes in meters per second squared
- property magnetic: Tuple[float, float, float] | None¶
A tuple of the current magnetic field measurements on the X, Y, and Z axes
- property quaternion: Tuple[float, float, float, float] | None¶
A quaternion representing the current rotation vector
- property raw_acceleration: Tuple[int, int, int] | None¶
Returns the sensor’s raw, unscaled value from the accelerometer registers
- property raw_gyro: Tuple[int, int, int] | None¶
Returns the sensor’s raw, unscaled value from the gyro registers
- property raw_magnetic: Tuple[int, int, int] | None¶
Returns the sensor’s raw, unscaled value from the magnetometer registers
- property shake: bool | None¶
True if a shake was detected on any axis since the last time it was checked
This property has a “latching” behavior where once a shake is detected, it will stay in a “shaken” state until the value is read. This prevents missing shake events but means that this property is not guaranteed to reflect the shake state at the moment it is read
- property stability_classification: str | None¶
Returns the sensor’s assessment of it’s current stability, one of:
“Unknown” - The sensor is unable to classify the current stability
“On Table” - The sensor is at rest on a stable surface with very little vibration
“Stationary” - The sensor’s motion is below the stable threshold but the stable duration requirement has not been met. This output is only available when gyro calibration is enabled
“Stable” - The sensor’s motion has met the stable threshold and duration requirements.
“In motion” - The sensor is moving.
- class adafruit_bno08x.Packet(packet_bytes: bytearray)¶
A class representing a Hillcrest LaboratorySensor Hub Transport packet
- classmethod header_from_buffer(packet_bytes: bytearray) PacketHeader ¶
Creates a
PacketHeader
object from a given buffer
- classmethod is_error(header: PacketHeader) bool ¶
Returns True if the header is an error condition
- exception adafruit_bno08x.PacketError¶
Raised when the packet couldnt be parsed