BNO08x Driver
API reference
Loading...
Searching...
No Matches
bno08x.hpp
Go to the documentation of this file.
1#pragma once
8#include "bno08x_version.h"
9#include "dfu/HcBin.h"
10#include <array>
11#include <atomic>
12#include <cstddef>
13#include <cstdint>
14#include <cstring>
15#include <functional>
16
17extern "C" {
18#include "sh2/sh2.h"
19#include "sh2/sh2_SensorValue.h"
20#include "sh2/sh2_err.h"
21}
22
33inline constexpr int BNO08X_ERR_SH2_SESSION_IN_USE = -100;
34
35namespace bno08x::detail {
42inline std::atomic<const void*>& Sh2SessionOwner() noexcept {
43 static std::atomic<const void*> owner{nullptr};
44 return owner;
45}
46} // namespace bno08x::detail
47
55extern const HcBin_t firmware;
56
57// ============================================================================
61// ============================================================================
62
70enum class BNO085Sensor : uint8_t {
71 Accelerometer = 0x01,
72 Gyroscope = 0x02,
73 Magnetometer = 0x03,
74 LinearAcceleration = 0x04,
75 RotationVector = 0x05,
76 Gravity = 0x06,
77 GyroUncalibrated = 0x07,
78 GameRotationVector = 0x08,
80 Pressure = 0x0A,
81 AmbientLight = 0x0B,
82 Humidity = 0x0C,
83 Proximity = 0x0D,
84 Temperature = 0x0E,
86 TapDetector = 0x10,
87 StepCounter = 0x11,
88 SignificantMotion = 0x12,
89 StabilityClassifier = 0x13,
90 RawAccelerometer = 0x14,
91 RawGyroscope = 0x15,
92 RawMagnetometer = 0x16,
93 StepDetector = 0x18,
94 ShakeDetector = 0x19,
95 FlipDetector = 0x1A,
96 PickupDetector = 0x1B,
97 StabilityDetector = 0x1C,
99 SleepDetector = 0x1F,
100 TiltDetector = 0x20,
101 PocketDetector = 0x21,
102 CircleDetector = 0x22,
103 HeartRateMonitor = 0x23,
104 ARVRStabilizedRV = 0x28,
105 ARVRStabilizedGameRV = 0x29,
106 GyroIntegratedRV = 0x2A,
107 IZroMotionRequest = 0x2B,
108 RawOpticalFlow = 0x2C,
109 DeadReckoningPose = 0x2D,
110 WheelEncoder = 0x2E
111};
112
120struct Vector3 {
121 float x{0};
122 float y{0};
123 float z{0};
124 uint8_t accuracy{0};
125};
126
135 float w{1};
136 float x{0};
137 float y{0};
138 float z{0};
139 uint8_t accuracy{0};
140};
141
146struct TapEvent {
147 bool doubleTap{false};
148 uint8_t direction{0};
149};
150
156 int16_t x{0};
157 int16_t y{0};
158 int16_t z{0};
159 int16_t temperature{0};
160 uint32_t sensorTimeUs{0};
161};
162
168 uint8_t page{0};
169 bool lastPage{false};
170 uint8_t mostLikelyState{0};
171 std::array<uint8_t, 10> confidence{};
172};
173
179 uint32_t timestamp{0};
180 int16_t dt{0};
181 int16_t dx{0};
182 int16_t dy{0};
183 int16_t iq{0};
184 uint8_t resX{0};
185 uint8_t resY{0};
186 uint8_t shutter{0};
187 uint8_t frameMax{0};
188 uint8_t frameAvg{0};
189 uint8_t frameMin{0};
190 uint8_t laserOn{0};
191};
192
204
210 uint32_t timestamp{0};
211 uint8_t wheelIndex{0};
212 uint8_t dataType{0};
213 uint16_t data{0};
214};
215
250
251// ---- RVC Mode Data Types ---------------------------------------------------
252
262 uint8_t index;
263 int16_t yaw;
264 int16_t pitch;
265 int16_t roll;
266 int16_t acc_x;
267 int16_t acc_y;
268 int16_t acc_z;
269 uint8_t mi;
270 uint8_t mr;
271 uint64_t timestamp_uS;
272};
273
281 uint8_t index;
282 float yaw_deg;
283 float pitch_deg;
284 float roll_deg;
285 float acc_x_g;
286 float acc_y_g;
287 float acc_z_g;
288 uint8_t mi;
289 uint8_t mr;
290 uint64_t timestamp_uS;
291};
292
293// ---- Callback Types --------------------------------------------------------
294
296using SensorCallback = std::function<void(const SensorEvent&)>;
297
299using RvcCallback = std::function<void(const RvcSensorValue&)>;
300
312
318 uint32_t bytesSent{0};
319 uint32_t totalBytes{0};
320};
321
323using DfuProgressCallback = std::function<void(const DfuProgress&)>;
324
331 bool requirePartNumber{true};
332 const char* requiredFormat{"BNO_V1"};
333 const char* requiredPartNumber{nullptr};
334 uint8_t packetLenOverride{0};
336};
337
343 const uint8_t* data{nullptr};
344 uint32_t length{0};
345 const char* format{"BNO_V1"};
346 const char* partNumber{"1000-3608"};
347 uint32_t preferredPacketLen{0};
348};
349
351
352// ============================================================================
356// ============================================================================
357
399template <typename CommType>
400class BNO085 {
401public:
406 explicit BNO085(CommType& comm) noexcept : io_(comm) {
407 prepareHalWrapper();
408 }
409
413 ~BNO085() noexcept {
414 Close();
415 CloseRvc();
416 }
417
418 // --------------------------------------------------------------------------
424
440 bool Begin() noexcept;
441
445 static bool Sh2SessionInUse() noexcept {
446 return bno08x::detail::Sh2SessionOwner().load() != nullptr;
447 }
448
458 void Close() noexcept;
459
470 bool EnableSensor(BNO085Sensor sensor, uint32_t interval_ms, float sensitivity = 0.0f) noexcept;
471
477 bool DisableSensor(BNO085Sensor sensor) noexcept;
478
488 void SetCallback(SensorCallback cb) noexcept;
489
502 bool HasNewData(BNO085Sensor sensor) const;
503
517 SensorEvent GetLatest(BNO085Sensor sensor) noexcept;
518
528 void Update() noexcept;
529
531
532 // --------------------------------------------------------------------------
539
548 void SetRvcCallback(RvcCallback cb) noexcept;
549
559 bool BeginRvc() noexcept;
560
570 void ServiceRvc() noexcept;
571
578 void CloseRvc() noexcept;
579
581
582 // --------------------------------------------------------------------------
587
592 int GetLastError() const {
593 return last_error_;
594 }
595
599 BNO085DriverState GetState() const noexcept {
600 return state_;
601 }
602
615 bool HardwareReset(uint32_t lowMs = 2) noexcept;
616
623 static constexpr uint32_t RESET_STARTUP_MS = 90 + 4;
624
626 static constexpr uint8_t I2C_ADDRESS_APP = 0x4A;
628 static constexpr uint8_t I2C_ADDRESS_BOOTLOADER = 0x28;
629
639 static constexpr uint8_t BootloaderI2cAddress(uint8_t appAddress) noexcept {
640 const auto sa0 = static_cast<uint8_t>(appAddress & 0x01U);
641 const auto base = static_cast<uint8_t>(appAddress & 0xFEU);
642 if (base == I2C_ADDRESS_APP || base == I2C_ADDRESS_BOOTLOADER) {
643 return static_cast<uint8_t>(I2C_ADDRESS_BOOTLOADER | sa0);
644 }
645 return 0;
646 }
647
653 bool SetBootPin(bool state) noexcept;
654
660 bool SetWakePin(bool state) noexcept;
661
671 bool SelectInterface(BNO085Interface iface) noexcept;
672
694 int Dfu(const HcBin_t& fw = firmware) noexcept;
695
702 int DfuWithOptions(const HcBin_t& fw, const DfuOptions& options) noexcept;
703
710 int DfuFromMemory(const DfuMemoryImage& image, const DfuOptions& options = {}) noexcept;
711
715 int DfuFromMemory(const uint8_t* data, uint32_t len, const char* partNumber = "1000-3608",
716 const DfuOptions& options = {}) noexcept;
717
729 bool EnterBootloader(uint32_t resetLowMs = 10, uint32_t settleMs = 50) noexcept;
730
737 bool ExitBootloaderAndReboot(uint32_t resetLowMs = 2, uint32_t settleMs = 100) noexcept;
738
743 int RunDfuFromMemory(const DfuMemoryImage& image, const DfuOptions& options = {},
744 uint32_t enterResetLowMs = 10, uint32_t enterSettleMs = 50,
745 uint32_t exitResetLowMs = 2, uint32_t exitSettleMs = 100) noexcept;
746
748
749 // ===========================================================================
750 // Driver Version
751 // ===========================================================================
752
754 static constexpr const char* GetDriverVersion() noexcept {
755 return HF_BNO08X_VERSION_STRING;
756 }
757
759 static constexpr uint8_t GetDriverVersionMajor() noexcept {
760 return HF_BNO08X_VERSION_MAJOR;
761 }
762
764 static constexpr uint8_t GetDriverVersionMinor() noexcept {
765 return HF_BNO08X_VERSION_MINOR;
766 }
767
769 static constexpr uint8_t GetDriverVersionPatch() noexcept {
770 return HF_BNO08X_VERSION_PATCH;
771 }
772
773private:
775 void prepareHalWrapper() noexcept;
776
778 bool acquireSh2Session() noexcept;
780 void releaseSh2Session() noexcept;
781
783 bool setPin(bno08x::CtrlPin pin, bool active) noexcept;
784
786 SensorEvent toSensorEvent(BNO085Sensor sensor, const sh2_SensorValue_t& val) const noexcept;
787
788 // --------------------------------------------------------------------------
792
794 // Wrapper pairing the C HAL struct with the typed CommInterface pointer.
795 struct CommHal {
796 sh2_Hal_t* asHal() {
797 return &hal;
798 }
799 sh2_Hal_t hal;
800 CommType* comm{nullptr};
801 } halWrapper_{};
803
804 static int halOpen(sh2_Hal_t* self);
805 static void halClose(sh2_Hal_t* self);
806 static int halRead(sh2_Hal_t* self, uint8_t* buf, unsigned len, uint32_t* t);
807 static int halWrite(sh2_Hal_t* self, uint8_t* buf, unsigned len);
808 static uint32_t halGetTimeUs(sh2_Hal_t* self);
809
811
812 // --------------------------------------------------------------------------
815
816 static void sensorCallback(void* cookie, sh2_SensorEvent_t* event);
817 static void asyncCallback(void* cookie, sh2_AsyncEvent_t* event);
818
820
821 // --------------------------------------------------------------------------
824
826 void handleSensorEvent(const sh2_SensorEvent_t* event) noexcept;
828 void handleAsyncEvent(const sh2_AsyncEvent_t* event) noexcept;
830 bool configure(BNO085Sensor sensor, uint32_t interval_us, float sensitivity,
831 uint32_t batch_us = 0) noexcept;
832
834
835 // --------------------------------------------------------------------------
842
843 static constexpr uint8_t RVC_FRAME_LEN_ = 19;
844
846 void rvcProcessByte(uint8_t c) noexcept;
847
849 static void decodeRvc(RvcSensorValue* out, const RvcSensorEvent* in) noexcept;
850
851 uint8_t rvc_frame_[RVC_FRAME_LEN_]{};
852 uint8_t rvc_frame_len_{0};
853
855
856 // --------------------------------------------------------------------------
862
863 static void dfuWrite32be(uint8_t* buf, uint32_t value) noexcept;
864 static bool dfuIsKnownPartNumber(const char* part) noexcept;
865 static void dfuAppendCrc(uint8_t* packet, uint8_t len) noexcept;
866 int dfuSend(uint8_t* p_data, uint32_t len) noexcept;
867 int dfuSendAppSize(uint8_t* dfu_buff, uint32_t app_size) noexcept;
868 int dfuSendPktSize(uint8_t* dfu_buff, uint8_t packet_len) noexcept;
869 int dfuSendPkt(uint8_t* dfu_buff, uint8_t* p_data, uint32_t len) noexcept;
870 int dfuSelectBootloaderAddress(uint8_t& appAddress, bool& switched) noexcept;
871 bool dfuRestoreAppAddress(uint8_t appAddress) noexcept;
872
874
875 // --------------------------------------------------------------------------
878
879 CommType& io_;
880 SensorCallback callback_{};
881 RvcCallback rvc_cb_{};
882 int last_error_{0};
884
885 static constexpr std::size_t SENSOR_CACHE_SIZE_ = 0x2F;
886 std::array<sh2_SensorValue_t, SENSOR_CACHE_SIZE_> latest_{};
887 std::array<bool, SENSOR_CACHE_SIZE_> new_flag_{};
888 std::array<uint32_t, SENSOR_CACHE_SIZE_>
889 last_interval_{};
890 std::array<float, SENSOR_CACHE_SIZE_> last_sensitivity_{};
891
893};
894
896
897// =============================================================================
898// Free-function version accessor (no namespace — class is at global scope)
899// =============================================================================
900
902inline const char* GetBNO08xDriverVersion() noexcept {
903 return HF_BNO08X_VERSION_STRING;
904}
905
906// ============================================================================
907// Template Implementation
908// ============================================================================
909// The template method bodies live in src/bno08x.ipp and are included here so
910// that the compiler can instantiate them for any CommType. src/ is on the
911// include path in the build tree; an installed package puts bno08x.ipp next
912// to this header.
913#define BNO085_HEADER_INCLUDED
914// NOLINTNEXTLINE(bugprone-suspicious-include) - Intentional: template implementation file
915#include "bno08x.ipp"
916#undef BNO085_HEADER_INCLUDED
API Definition for HcBin objects (Hillcrest Binary Files).
const HcBin_t firmware
Default compiled-in firmware image for DFU.
const char * GetBNO08xDriverVersion() noexcept
Get the BNO08x driver version string (free function).
Definition bno08x.hpp:902
constexpr int BNO08X_ERR_SH2_SESSION_IN_USE
GetLastError() value when Begin() is refused because another BNO085 object already holds the SH-2 ses...
Definition bno08x.hpp:33
Template method implementations for the BNO085 driver class.
CRTP-based communication interface for the BNO08x IMU family.
BNO085Interface
Identifies the host interface type that a CommInterface provides.
Definition bno08x_comm_interface.hpp:27
Unified driver for the BNO08x IMU – SH-2 mode, RVC mode, and DFU.
Definition bno08x.hpp:400
int DfuWithOptions(const HcBin_t &fw, const DfuOptions &options) noexcept
Perform DFU with explicit validation and transfer options.
Definition bno08x.ipp:1125
bool DisableSensor(BNO085Sensor sensor) noexcept
Disable reporting for a sensor.
Definition bno08x.ipp:119
bool SetBootPin(bool state) noexcept
Drive the BOOTN pin to enter/exit DFU bootloader mode.
Definition bno08x.ipp:642
bool BeginRvc() noexcept
Initialise RVC mode.
Definition bno08x.ipp:774
bool HasNewData(BNO085Sensor sensor) const
Check if new data is available for a sensor.
Definition bno08x.ipp:149
SensorEvent GetLatest(BNO085Sensor sensor) noexcept
Retrieve the most recent event for a sensor.
Definition bno08x.ipp:421
bool EnableSensor(BNO085Sensor sensor, uint32_t interval_ms, float sensitivity=0.0f) noexcept
Enable periodic reporting for a sensor.
Definition bno08x.ipp:100
void ServiceRvc() noexcept
Poll for RVC frames and dispatch callbacks.
Definition bno08x.ipp:803
static constexpr uint8_t I2C_ADDRESS_APP
Application I2C address with SA0 low (datasheet figure 1-12); 0x4B with SA0 high.
Definition bno08x.hpp:626
void SetCallback(SensorCallback cb) noexcept
Register a callback for SH-2 sensor events.
Definition bno08x.ipp:137
static constexpr uint8_t GetDriverVersionMinor() noexcept
Get the compiled driver minor version number.
Definition bno08x.hpp:764
void CloseRvc() noexcept
Stop RVC processing and close the transport.
Definition bno08x.ipp:814
static constexpr uint8_t I2C_ADDRESS_BOOTLOADER
Bootloader I2C address with SA0 low (datasheet section 1.4); 0x29 with SA0 high.
Definition bno08x.hpp:628
int GetLastError() const
Get the last error code from the SH-2 driver.
Definition bno08x.hpp:592
BNO085(CommType &comm) noexcept
Construct the driver with a communication interface.
Definition bno08x.hpp:406
int DfuFromMemory(const DfuMemoryImage &image, const DfuOptions &options={}) noexcept
Perform DFU from an in-memory firmware image.
Definition bno08x.ipp:1074
BNO085DriverState GetState() const noexcept
Get the current high-level driver state.
Definition bno08x.hpp:599
void Update() noexcept
Pump the SH-2 service loop.
Definition bno08x.ipp:436
~BNO085() noexcept
Destructor. Closes active SH-2/RVC sessions.
Definition bno08x.hpp:413
static constexpr const char * GetDriverVersion() noexcept
Get the compiled driver version string.
Definition bno08x.hpp:754
int RunDfuFromMemory(const DfuMemoryImage &image, const DfuOptions &options={}, uint32_t enterResetLowMs=10, uint32_t enterSettleMs=50, uint32_t exitResetLowMs=2, uint32_t exitSettleMs=100) noexcept
Full class-aware DFU workflow: enter bootloader -> transfer firmware -> reboot to app.
Definition bno08x.ipp:1098
void Close() noexcept
Close the currently active session and release transport resources.
Definition bno08x.ipp:444
int Dfu(const HcBin_t &fw=firmware) noexcept
Perform a Device Firmware Update (DFU).
Definition bno08x.ipp:1067
bool Begin() noexcept
Initialise the sensor in SH-2 mode.
Definition bno08x.ipp:40
bool EnterBootloader(uint32_t resetLowMs=10, uint32_t settleMs=50) noexcept
Enter bootloader mode using BOOTN + reset pin sequence.
Definition bno08x.ipp:648
bool SetWakePin(bool state) noexcept
Drive the WAKE pin (SPI mode only).
Definition bno08x.ipp:722
bool ExitBootloaderAndReboot(uint32_t resetLowMs=2, uint32_t settleMs=100) noexcept
Exit bootloader mode and reboot into application firmware.
Definition bno08x.ipp:686
static constexpr uint8_t BootloaderI2cAddress(uint8_t appAddress) noexcept
Bootloader I2C address for a port configured at appAddress.
Definition bno08x.hpp:639
static constexpr uint8_t GetDriverVersionMajor() noexcept
Get the compiled driver major version number.
Definition bno08x.hpp:759
static constexpr uint8_t GetDriverVersionPatch() noexcept
Get the compiled driver patch version number.
Definition bno08x.hpp:769
static bool Sh2SessionInUse() noexcept
True while any BNO085 object in the process holds the SH-2 session.
Definition bno08x.hpp:445
bool SelectInterface(BNO085Interface iface) noexcept
Select the host interface by driving PS0/PS1 pins.
Definition bno08x.ipp:736
bool HardwareReset(uint32_t lowMs=2) noexcept
Perform a hardware reset via the RSTN pin.
Definition bno08x.ipp:627
static constexpr uint32_t RESET_STARTUP_MS
Wait after releasing NRST before the hub can be addressed, in ms.
Definition bno08x.hpp:623
void SetRvcCallback(RvcCallback cb) noexcept
Register a callback for decoded RVC frames.
Definition bno08x.ipp:143
std::function< void(const DfuProgress &)> DfuProgressCallback
Callback for DFU progress updates.
Definition bno08x.hpp:323
BNO085DriverState
Current top-level operating state of the driver.
Definition bno08x.hpp:311
std::function< void(const RvcSensorValue &)> RvcCallback
Callback invoked when a decoded RVC frame is available.
Definition bno08x.hpp:299
BNO085Sensor
Identifiers for all SH-2 sensor reports supported by the BNO08x.
Definition bno08x.hpp:70
std::function< void(const SensorEvent &)> SensorCallback
Callback invoked when a new SH-2 sensor event is received.
Definition bno08x.hpp:296
@ HeartRateMonitor
Heart rate data.
@ MagneticFieldUncalibrated
Raw magnetic field (uT)
@ GyroUncalibrated
Raw angular velocity (rad/s)
@ PersonalActivityClassifier
Activity classification (walking, running, etc.)
@ StepDetector
Individual step detected.
@ ShakeDetector
Shake gesture detected.
@ PickupDetector
Pickup gesture detected.
@ ARVRStabilizedRV
AR/VR stabilised rotation vector.
@ CircleDetector
Circular motion detected.
@ IZroMotionRequest
Interactive ZRO motion intent/request.
@ RawOpticalFlow
Raw optical flow report.
@ GeomagneticRotationVector
Orientation using magnetometer for heading.
@ FlipDetector
Flip gesture detected.
@ StepCounter
Cumulative step count.
@ Gravity
Gravity vector (m/s^2)
@ SleepDetector
Sleep state detected.
@ WheelEncoder
Wheel encoder report.
@ RotationVector
Fused absolute orientation quaternion.
@ SignificantMotion
Significant motion detected.
@ AmbientLight
Ambient light level (lux)
@ Magnetometer
Calibrated magnetic field (uT)
@ TiltDetector
Tilt event detected.
@ RawMagnetometer
Raw magnetometer ADC counts.
@ TapDetector
Single or double tap event.
@ Pressure
Barometric pressure (hPa)
@ StabilityClassifier
Device stability state (on table, in hand, etc.)
@ Accelerometer
Calibrated acceleration vector (m/s^2)
@ LinearAcceleration
Acceleration minus gravity (m/s^2)
@ Gyroscope
Calibrated angular velocity (rad/s)
@ StabilityDetector
Stability change detected.
@ GyroIntegratedRV
High-rate gyro-integrated rotation vector.
@ GameRotationVector
Orientation without magnetometer heading.
@ RawAccelerometer
Raw accelerometer ADC counts.
@ ARVRStabilizedGameRV
AR/VR stabilised game rotation vector.
@ Humidity
Relative humidity (%)
@ DeadReckoningPose
Dead reckoning pose estimate.
@ Temperature
Temperature (deg C)
@ RawGyroscope
Raw gyroscope ADC counts.
@ Proximity
Proximity detector (cm)
@ PocketDetector
Device-in-pocket detected.
Definition bno08x.hpp:35
std::atomic< const void * > & Sh2SessionOwner() noexcept
Owner of the process-wide SH-2 session (nullptr when free).
Definition bno08x.hpp:42
Definition bno08x.hpp:35
Personal activity classifier payload.
Definition bno08x.hpp:167
std::array< uint8_t, 10 > confidence
Definition bno08x.hpp:171
bool lastPage
Definition bno08x.hpp:169
uint8_t mostLikelyState
Definition bno08x.hpp:170
uint8_t page
Definition bno08x.hpp:168
Dead reckoning position/orientation/velocity payload.
Definition bno08x.hpp:197
Vector3 linearPosition
Definition bno08x.hpp:199
uint32_t timestamp
Definition bno08x.hpp:198
Vector3 linearVelocity
Definition bno08x.hpp:201
Quaternion rotation
Definition bno08x.hpp:200
Vector3 angularVelocity
Definition bno08x.hpp:202
Firmware image descriptor for class-aware memory DFU.
Definition bno08x.hpp:342
uint32_t preferredPacketLen
Optional preferred DFU packet size.
Definition bno08x.hpp:347
uint32_t length
Firmware length in bytes.
Definition bno08x.hpp:344
const uint8_t * data
Pointer to firmware bytes.
Definition bno08x.hpp:343
const char * partNumber
SW-Part-Number metadata value.
Definition bno08x.hpp:346
const char * format
FW-Format metadata value.
Definition bno08x.hpp:345
Controls DFU validation and transfer behavior.
Definition bno08x.hpp:329
DfuProgressCallback progress
Optional per-transfer progress callback.
Definition bno08x.hpp:335
uint8_t packetLenOverride
Optional DFU packet size override (1..64).
Definition bno08x.hpp:334
bool requirePartNumber
Validate SW-Part-Number metadata.
Definition bno08x.hpp:331
bool requireFormatMatch
Validate FW-Format metadata.
Definition bno08x.hpp:330
const char * requiredPartNumber
Optional exact part number match.
Definition bno08x.hpp:333
const char * requiredFormat
Required format when format check is enabled.
Definition bno08x.hpp:332
Progress sample emitted during DFU transfers.
Definition bno08x.hpp:317
uint32_t totalBytes
Total firmware bytes to send.
Definition bno08x.hpp:319
uint32_t bytesSent
Number of firmware bytes sent so far.
Definition bno08x.hpp:318
Definition HcBin.h:47
Unit quaternion with sensor accuracy indicator.
Definition bno08x.hpp:134
float y
Imaginary j component.
Definition bno08x.hpp:137
float z
Imaginary k component.
Definition bno08x.hpp:138
float x
Imaginary i component.
Definition bno08x.hpp:136
uint8_t accuracy
Calibration accuracy (0 = unreliable, 3 = fully calibrated)
Definition bno08x.hpp:139
float w
Real (scalar) component.
Definition bno08x.hpp:135
Raw optical flow payload from SH2_RAW_OPTICAL_FLOW.
Definition bno08x.hpp:178
int16_t dx
Definition bno08x.hpp:181
uint8_t frameAvg
Definition bno08x.hpp:188
int16_t dy
Definition bno08x.hpp:182
uint8_t frameMax
Definition bno08x.hpp:187
uint8_t shutter
Definition bno08x.hpp:186
uint8_t resX
Definition bno08x.hpp:184
int16_t dt
Definition bno08x.hpp:180
uint32_t timestamp
Definition bno08x.hpp:179
uint8_t laserOn
Definition bno08x.hpp:190
uint8_t frameMin
Definition bno08x.hpp:189
int16_t iq
Definition bno08x.hpp:183
uint8_t resY
Definition bno08x.hpp:185
Raw integer 3-axis sample (ADC counts) with optional metadata.
Definition bno08x.hpp:155
int16_t x
Definition bno08x.hpp:156
int16_t z
Definition bno08x.hpp:158
int16_t temperature
Used by RawGyroscope only.
Definition bno08x.hpp:159
uint32_t sensorTimeUs
Sensor-provided timestamp where available.
Definition bno08x.hpp:160
int16_t y
Definition bno08x.hpp:157
Raw RVC frame data in integer fixed-point format.
Definition bno08x.hpp:261
int16_t yaw
Yaw angle (units: 0.01 degrees)
Definition bno08x.hpp:263
int16_t acc_y
Y linear acceleration (units: 0.001 g)
Definition bno08x.hpp:267
uint64_t timestamp_uS
Timestamp in microseconds (set by the driver)
Definition bno08x.hpp:271
uint8_t mr
Motion request (0=no constraint, 1=stay stationary)
Definition bno08x.hpp:270
int16_t pitch
Pitch angle (units: 0.01 degrees)
Definition bno08x.hpp:264
uint8_t index
Frame sequence index (0-255)
Definition bno08x.hpp:262
int16_t roll
Roll angle (units: 0.01 degrees)
Definition bno08x.hpp:265
int16_t acc_x
X linear acceleration (units: 0.001 g)
Definition bno08x.hpp:266
int16_t acc_z
Z linear acceleration (units: 0.001 g)
Definition bno08x.hpp:268
uint8_t mi
Motion intent (0=unknown, 1=stationary, 3=in motion)
Definition bno08x.hpp:269
Decoded RVC frame data in floating-point natural units.
Definition bno08x.hpp:280
uint8_t mi
Motion intent.
Definition bno08x.hpp:288
float yaw_deg
Yaw angle in degrees.
Definition bno08x.hpp:282
float acc_x_g
X linear acceleration in g.
Definition bno08x.hpp:285
uint8_t index
Frame sequence index.
Definition bno08x.hpp:281
uint64_t timestamp_uS
Timestamp in microseconds.
Definition bno08x.hpp:290
float roll_deg
Roll angle in degrees.
Definition bno08x.hpp:284
float acc_y_g
Y linear acceleration in g.
Definition bno08x.hpp:286
float pitch_deg
Pitch angle in degrees.
Definition bno08x.hpp:283
uint8_t mr
Motion request.
Definition bno08x.hpp:289
float acc_z_g
Z linear acceleration in g.
Definition bno08x.hpp:287
Container for a single decoded SH-2 sensor report.
Definition bno08x.hpp:227
uint64_t timestamp
Event timestamp in microseconds.
Definition bno08x.hpp:229
BNO085Sensor sensor
Which sensor produced this event.
Definition bno08x.hpp:228
bool detected
Generic detection flag for event-like reports.
Definition bno08x.hpp:248
uint8_t motionIntent
Interactive ZRO motion intent.
Definition bno08x.hpp:243
ActivityClassifierEvent activity
Personal activity classifier payload.
Definition bno08x.hpp:242
uint8_t classification
Classifier result (stability/activity, etc.).
Definition bno08x.hpp:239
uint32_t stepCount
Cumulative step count (StepCounter)
Definition bno08x.hpp:237
TapEvent tap
Tap event details (TapDetector)
Definition bno08x.hpp:241
uint8_t motionRequest
Interactive ZRO motion request.
Definition bno08x.hpp:244
RawVector3 raw
Raw integer payload for raw IMU reports.
Definition bno08x.hpp:235
Vector3 vector
3-axis data (accel/gyro/mag/gravity/etc.)
Definition bno08x.hpp:230
uint8_t sleepState
Sleep detector state.
Definition bno08x.hpp:240
WheelEncoderEvent wheelEncoder
Definition bno08x.hpp:247
RawOpticalFlowEvent rawOpticalFlow
Definition bno08x.hpp:245
DeadReckoningPoseEvent deadReckoningPose
Definition bno08x.hpp:246
Vector3 bias
Bias for uncalibrated gyro/mag reports.
Definition bno08x.hpp:231
uint16_t eventFlags
Bitfield payload for gesture detector reports.
Definition bno08x.hpp:238
Quaternion rotation
Quaternion data (rotation vector reports)
Definition bno08x.hpp:233
Vector3 angularVelocity
Angular velocity for GyroIntegratedRV.
Definition bno08x.hpp:232
float scalar
Scalar payload (pressure/light/humidity/temp/etc.)
Definition bno08x.hpp:234
uint32_t latencyUs
Latency for step detector/counter reports.
Definition bno08x.hpp:236
Tap detector event details.
Definition bno08x.hpp:146
uint8_t direction
Tap direction: 0=+X, 1=-X, 2=+Y, 3=-Y, 4=+Z, 5=-Z.
Definition bno08x.hpp:148
bool doubleTap
True if double-tap, false if single-tap.
Definition bno08x.hpp:147
Three-axis vector with sensor accuracy indicator.
Definition bno08x.hpp:120
uint8_t accuracy
Calibration accuracy (0 = unreliable, 3 = fully calibrated)
Definition bno08x.hpp:124
float x
X-axis component.
Definition bno08x.hpp:121
float y
Y-axis component.
Definition bno08x.hpp:122
float z
Z-axis component.
Definition bno08x.hpp:123
Wheel encoder payload.
Definition bno08x.hpp:209
uint16_t data
Definition bno08x.hpp:213
uint32_t timestamp
Definition bno08x.hpp:210
uint8_t wheelIndex
Definition bno08x.hpp:211
uint8_t dataType
Definition bno08x.hpp:212