HF-BNO08x  0.1.0-dev
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 <cstddef>
12#include <cstdint>
13#include <cstring>
14#include <functional>
15
16extern "C" {
17#include "sh2/sh2.h"
18#include "sh2/sh2_SensorValue.h"
19#include "sh2/sh2_err.h"
20}
21
29extern const HcBin_t firmware;
30
31// ============================================================================
35// ============================================================================
36
44enum class BNO085Sensor : uint8_t {
45 Accelerometer = 0x01,
46 Gyroscope = 0x02,
47 Magnetometer = 0x03,
48 LinearAcceleration = 0x04,
49 RotationVector = 0x05,
50 Gravity = 0x06,
51 GyroUncalibrated = 0x07,
52 GameRotationVector = 0x08,
54 Pressure = 0x0A,
55 AmbientLight = 0x0B,
56 Humidity = 0x0C,
57 Proximity = 0x0D,
58 Temperature = 0x0E,
60 TapDetector = 0x10,
61 StepCounter = 0x11,
62 SignificantMotion = 0x12,
63 StabilityClassifier = 0x13,
64 RawAccelerometer = 0x14,
65 RawGyroscope = 0x15,
66 RawMagnetometer = 0x16,
67 StepDetector = 0x18,
68 ShakeDetector = 0x19,
69 FlipDetector = 0x1A,
70 PickupDetector = 0x1B,
71 StabilityDetector = 0x1C,
73 SleepDetector = 0x1F,
74 TiltDetector = 0x20,
75 PocketDetector = 0x21,
76 CircleDetector = 0x22,
77 HeartRateMonitor = 0x23,
78 ARVRStabilizedRV = 0x28,
80 GyroIntegratedRV = 0x2A,
81 IZroMotionRequest = 0x2B,
82 RawOpticalFlow = 0x2C,
83 DeadReckoningPose = 0x2D,
84 WheelEncoder = 0x2E
85};
86
94struct Vector3 {
95 float x{0};
96 float y{0};
97 float z{0};
98 uint8_t accuracy{0};
99};
100
109 float w{1};
110 float x{0};
111 float y{0};
112 float z{0};
113 uint8_t accuracy{0};
114};
115
120struct TapEvent {
121 bool doubleTap{false};
122 uint8_t direction{0};
123};
124
130 int16_t x{0};
131 int16_t y{0};
132 int16_t z{0};
133 int16_t temperature{0};
134 uint32_t sensorTimeUs{0};
135};
136
142 uint8_t page{0};
143 bool lastPage{false};
144 uint8_t mostLikelyState{0};
145 std::array<uint8_t, 10> confidence{};
146};
147
153 uint32_t timestamp{0};
154 int16_t dt{0};
155 int16_t dx{0};
156 int16_t dy{0};
157 int16_t iq{0};
158 uint8_t resX{0};
159 uint8_t resY{0};
160 uint8_t shutter{0};
161 uint8_t frameMax{0};
162 uint8_t frameAvg{0};
163 uint8_t frameMin{0};
164 uint8_t laserOn{0};
165};
166
178
184 uint32_t timestamp{0};
185 uint8_t wheelIndex{0};
186 uint8_t dataType{0};
187 uint16_t data{0};
188};
189
224
225// ---- RVC Mode Data Types ---------------------------------------------------
226
236 uint8_t index;
237 int16_t yaw;
238 int16_t pitch;
239 int16_t roll;
240 int16_t acc_x;
241 int16_t acc_y;
242 int16_t acc_z;
243 uint8_t mi;
244 uint8_t mr;
245 uint64_t timestamp_uS;
246};
247
255 uint8_t index;
256 float yaw_deg;
257 float pitch_deg;
258 float roll_deg;
259 float acc_x_g;
260 float acc_y_g;
261 float acc_z_g;
262 uint8_t mi;
263 uint8_t mr;
264 uint64_t timestamp_uS;
265};
266
267// ---- Callback Types --------------------------------------------------------
268
270using SensorCallback = std::function<void(const SensorEvent&)>;
271
273using RvcCallback = std::function<void(const RvcSensorValue&)>;
274
285enum class BNO085DriverState : uint8_t {
286 Closed = 0,
287 Sh2Active,
288 RvcActive,
290};
291
297 uint32_t bytesSent{0};
298 uint32_t totalBytes{0};
299};
300
302using DfuProgressCallback = std::function<void(const DfuProgress&)>;
303
310 bool requirePartNumber{true};
311 const char* requiredFormat{"BNO_V1"};
312 const char* requiredPartNumber{nullptr};
313 uint8_t packetLenOverride{0};
315};
316
322 const uint8_t* data{nullptr};
323 uint32_t length{0};
324 const char* format{"BNO_V1"};
325 const char* partNumber{"1000-3608"};
326 uint32_t preferredPacketLen{0};
327};
328
330
331// ============================================================================
335// ============================================================================
336
374template <typename CommType>
375class BNO085 {
376public:
381 explicit BNO085(CommType& comm) noexcept : io_(comm) {
382 prepareHalWrapper();
383 }
384
388 ~BNO085() noexcept {
389 Close();
390 CloseRvc();
391 }
392
393 // --------------------------------------------------------------------------
399
409 bool Begin() noexcept;
410
420 void Close() noexcept;
421
432 bool EnableSensor(BNO085Sensor sensor, uint32_t interval_ms, float sensitivity = 0.0f) noexcept;
433
439 bool DisableSensor(BNO085Sensor sensor) noexcept;
440
450 void SetCallback(SensorCallback cb) noexcept;
451
464 bool HasNewData(BNO085Sensor sensor) const;
465
479 SensorEvent GetLatest(BNO085Sensor sensor) noexcept;
480
490 void Update() noexcept;
491
493
494 // --------------------------------------------------------------------------
501
510 void SetRvcCallback(RvcCallback cb) noexcept;
511
521 bool BeginRvc() noexcept;
522
532 void ServiceRvc() noexcept;
533
540 void CloseRvc() noexcept;
541
543
544 // --------------------------------------------------------------------------
549
554 int GetLastError() const {
555 return last_error_;
556 }
557
561 BNO085DriverState GetState() const noexcept {
562 return state_;
563 }
564
573 void HardwareReset(uint32_t lowMs = 2) noexcept;
574
579 void SetBootPin(bool state) noexcept;
580
585 void SetWakePin(bool state) noexcept;
586
595 void SelectInterface(BNO085Interface iface) noexcept;
596
611 int Dfu(const HcBin_t& fw = firmware) noexcept;
612
619 int DfuWithOptions(const HcBin_t& fw, const DfuOptions& options) noexcept;
620
627 int DfuFromMemory(const DfuMemoryImage& image, const DfuOptions& options = {}) noexcept;
628
632 int DfuFromMemory(const uint8_t* data, uint32_t len, const char* partNumber = "1000-3608",
633 const DfuOptions& options = {}) noexcept;
634
643 bool EnterBootloader(uint32_t resetLowMs = 10, uint32_t settleMs = 50) noexcept;
644
650 bool ExitBootloaderAndReboot(uint32_t resetLowMs = 2, uint32_t settleMs = 100) noexcept;
651
656 int RunDfuFromMemory(const DfuMemoryImage& image, const DfuOptions& options = {},
657 uint32_t enterResetLowMs = 10, uint32_t enterSettleMs = 50,
658 uint32_t exitResetLowMs = 2, uint32_t exitSettleMs = 100) noexcept;
659
661
662 // ===========================================================================
663 // Driver Version
664 // ===========================================================================
665
667 static constexpr const char* GetDriverVersion() noexcept {
668 return HF_BNO08X_VERSION_STRING;
669 }
670
672 static constexpr uint8_t GetDriverVersionMajor() noexcept {
673 return HF_BNO08X_VERSION_MAJOR;
674 }
675
677 static constexpr uint8_t GetDriverVersionMinor() noexcept {
678 return HF_BNO08X_VERSION_MINOR;
679 }
680
682 static constexpr uint8_t GetDriverVersionPatch() noexcept {
683 return HF_BNO08X_VERSION_PATCH;
684 }
685
686private:
688 void prepareHalWrapper() noexcept;
689
691 SensorEvent toSensorEvent(BNO085Sensor sensor, const sh2_SensorValue_t& val) const noexcept;
692
693 // --------------------------------------------------------------------------
697
699 struct CommHal {
700 sh2_Hal_t* asHal() {
701 return &hal;
702 }
703 sh2_Hal_t hal;
704 CommType* comm{nullptr};
705 } halWrapper_{};
706
707 static int halOpen(sh2_Hal_t* self);
708 static void halClose(sh2_Hal_t* self);
709 static int halRead(sh2_Hal_t* self, uint8_t* buf, unsigned len, uint32_t* t);
710 static int halWrite(sh2_Hal_t* self, uint8_t* buf, unsigned len);
711 static uint32_t halGetTimeUs(sh2_Hal_t* self);
712
714
715 // --------------------------------------------------------------------------
718
719 static void sensorCallback(void* cookie, sh2_SensorEvent_t* event);
720 static void asyncCallback(void* cookie, sh2_AsyncEvent_t* event);
721
723
724 // --------------------------------------------------------------------------
727
729 void handleSensorEvent(const sh2_SensorEvent_t* event) noexcept;
731 void handleAsyncEvent(const sh2_AsyncEvent_t* event) noexcept;
733 bool configure(BNO085Sensor sensor, uint32_t interval_us, float sensitivity,
734 uint32_t batch_us = 0) noexcept;
735
737
738 // --------------------------------------------------------------------------
745
746 static constexpr uint8_t RVC_FRAME_LEN_ = 19;
747
749 void rvcProcessByte(uint8_t c) noexcept;
750
752 static void decodeRvc(RvcSensorValue* out, const RvcSensorEvent* in) noexcept;
753
754 uint8_t rvc_frame_[RVC_FRAME_LEN_]{};
755 uint8_t rvc_frame_len_{0};
756
758
759 // --------------------------------------------------------------------------
765
766 static void dfuWrite32be(uint8_t* buf, uint32_t value) noexcept;
767 static bool dfuIsKnownPartNumber(const char* part) noexcept;
768 static void dfuAppendCrc(uint8_t* packet, uint8_t len) noexcept;
769 int dfuSend(uint8_t* dfu_buff, uint8_t* p_data, uint32_t len) noexcept;
770 int dfuSendAppSize(uint8_t* dfu_buff, uint32_t app_size) noexcept;
771 int dfuSendPktSize(uint8_t* dfu_buff, uint8_t packet_len) noexcept;
772 int dfuSendPkt(uint8_t* dfu_buff, uint8_t* p_data, uint32_t len) noexcept;
773
775
776 // --------------------------------------------------------------------------
779
780 CommType& io_;
781 SensorCallback callback_{};
782 RvcCallback rvc_cb_{};
783 int last_error_{0};
785
786 static constexpr std::size_t SENSOR_CACHE_SIZE_ = 0x2F;
787 std::array<sh2_SensorValue_t, SENSOR_CACHE_SIZE_> latest_{};
788 std::array<bool, SENSOR_CACHE_SIZE_> new_flag_{};
789 std::array<uint32_t, SENSOR_CACHE_SIZE_>
790 last_interval_{};
791 std::array<float, SENSOR_CACHE_SIZE_> last_sensitivity_{};
792
794};
795
797
798// =============================================================================
799// Free-function version accessor (no namespace — class is at global scope)
800// =============================================================================
801
803inline const char* GetBNO08xDriverVersion() noexcept {
804 return HF_BNO08X_VERSION_STRING;
805}
806
807// ============================================================================
808// Template Implementation
809// ============================================================================
810// The template method bodies live in bno08x.cpp and are included here so
811// that the compiler can instantiate them for any CommType.
812#define BNO085_HEADER_INCLUDED
813// NOLINTNEXTLINE(bugprone-suspicious-include) - Intentional: template implementation file
814#include "../src/bno08x.ipp"
815#undef BNO085_HEADER_INCLUDED
API Definition for HcBin objects (Hillcrest Binary Files).
const HcBin_t firmware
Default compiled-in firmware image for DFU.
Definition firmware-bno.c:35
const char * GetBNO08xDriverVersion() noexcept
Get the BNO08x driver version string (free function).
Definition bno08x.hpp:803
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:25
Unified driver for the BNO08x IMU – SH-2 mode, RVC mode, and DFU.
Definition bno08x.hpp:375
int DfuWithOptions(const HcBin_t &fw, const DfuOptions &options) noexcept
Perform DFU with explicit validation and transfer options.
Definition bno08x.ipp:1032
bool DisableSensor(BNO085Sensor sensor) noexcept
Disable reporting for a sensor.
Definition bno08x.ipp:110
bool BeginRvc() noexcept
Initialise RVC mode.
Definition bno08x.ipp:723
void HardwareReset(uint32_t lowMs=2) noexcept
Perform a hardware reset via the RSTN pin.
Definition bno08x.ipp:585
bool HasNewData(BNO085Sensor sensor) const
Check if new data is available for a sensor.
Definition bno08x.ipp:140
SensorEvent GetLatest(BNO085Sensor sensor) noexcept
Retrieve the most recent event for a sensor.
Definition bno08x.ipp:412
bool EnableSensor(BNO085Sensor sensor, uint32_t interval_ms, float sensitivity=0.0f) noexcept
Enable periodic reporting for a sensor.
Definition bno08x.ipp:91
void ServiceRvc() noexcept
Poll for RVC frames and dispatch callbacks.
Definition bno08x.ipp:752
void SetCallback(SensorCallback cb) noexcept
Register a callback for SH-2 sensor events.
Definition bno08x.ipp:128
static constexpr uint8_t GetDriverVersionMinor() noexcept
Get the compiled driver minor version number.
Definition bno08x.hpp:677
void CloseRvc() noexcept
Stop RVC processing and close the transport.
Definition bno08x.ipp:763
void SelectInterface(BNO085Interface iface) noexcept
Select the host interface by driving PS0/PS1 pins.
Definition bno08x.ipp:673
int GetLastError() const
Get the last error code from the SH-2 driver.
Definition bno08x.hpp:554
void SetWakePin(bool state) noexcept
Drive the WAKE pin (SPI mode only).
Definition bno08x.ipp:660
BNO085(CommType &comm) noexcept
Construct the driver with a communication interface.
Definition bno08x.hpp:381
int DfuFromMemory(const DfuMemoryImage &image, const DfuOptions &options={}) noexcept
Perform DFU from an in-memory firmware image.
Definition bno08x.ipp:981
BNO085DriverState GetState() const noexcept
Get the current high-level driver state.
Definition bno08x.hpp:561
void Update() noexcept
Pump the SH-2 service loop.
Definition bno08x.ipp:427
~BNO085() noexcept
Destructor. Closes active SH-2/RVC sessions.
Definition bno08x.hpp:388
static constexpr const char * GetDriverVersion() noexcept
Get the compiled driver version string.
Definition bno08x.hpp:667
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:1005
void Close() noexcept
Close the currently active session and release transport resources.
Definition bno08x.ipp:435
int Dfu(const HcBin_t &fw=firmware) noexcept
Perform a Device Firmware Update (DFU).
Definition bno08x.ipp:974
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:603
void SetBootPin(bool state) noexcept
Drive the BOOTN pin to enter/exit DFU bootloader mode.
Definition bno08x.ipp:595
bool ExitBootloaderAndReboot(uint32_t resetLowMs=2, uint32_t settleMs=100) noexcept
Exit bootloader mode and reboot into application firmware.
Definition bno08x.ipp:632
static constexpr uint8_t GetDriverVersionMajor() noexcept
Get the compiled driver major version number.
Definition bno08x.hpp:672
static constexpr uint8_t GetDriverVersionPatch() noexcept
Get the compiled driver patch version number.
Definition bno08x.hpp:682
void SetRvcCallback(RvcCallback cb) noexcept
Register a callback for decoded RVC frames.
Definition bno08x.ipp:134
std::function< void(const DfuProgress &)> DfuProgressCallback
Callback for DFU progress updates.
Definition bno08x.hpp:302
BNO085DriverState
Current top-level operating state of the driver.
Definition bno08x.hpp:285
std::function< void(const RvcSensorValue &)> RvcCallback
Callback invoked when a decoded RVC frame is available.
Definition bno08x.hpp:273
BNO085Sensor
Identifiers for all SH-2 sensor reports supported by the BNO08x.
Definition bno08x.hpp:44
std::function< void(const SensorEvent &)> SensorCallback
Callback invoked when a new SH-2 sensor event is received.
Definition bno08x.hpp:270
@ 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.
Personal activity classifier payload.
Definition bno08x.hpp:141
std::array< uint8_t, 10 > confidence
Definition bno08x.hpp:145
bool lastPage
Definition bno08x.hpp:143
uint8_t mostLikelyState
Definition bno08x.hpp:144
uint8_t page
Definition bno08x.hpp:142
Dead reckoning position/orientation/velocity payload.
Definition bno08x.hpp:171
Vector3 linearPosition
Definition bno08x.hpp:173
uint32_t timestamp
Definition bno08x.hpp:172
Vector3 linearVelocity
Definition bno08x.hpp:175
Quaternion rotation
Definition bno08x.hpp:174
Vector3 angularVelocity
Definition bno08x.hpp:176
Firmware image descriptor for class-aware memory DFU.
Definition bno08x.hpp:321
uint32_t preferredPacketLen
Optional preferred DFU packet size.
Definition bno08x.hpp:326
uint32_t length
Firmware length in bytes.
Definition bno08x.hpp:323
const uint8_t * data
Pointer to firmware bytes.
Definition bno08x.hpp:322
const char * partNumber
SW-Part-Number metadata value.
Definition bno08x.hpp:325
const char * format
FW-Format metadata value.
Definition bno08x.hpp:324
Controls DFU validation and transfer behavior.
Definition bno08x.hpp:308
DfuProgressCallback progress
Optional per-transfer progress callback.
Definition bno08x.hpp:314
uint8_t packetLenOverride
Optional DFU packet size override (1..64).
Definition bno08x.hpp:313
bool requirePartNumber
Validate SW-Part-Number metadata.
Definition bno08x.hpp:310
bool requireFormatMatch
Validate FW-Format metadata.
Definition bno08x.hpp:309
const char * requiredPartNumber
Optional exact part number match.
Definition bno08x.hpp:312
const char * requiredFormat
Required format when format check is enabled.
Definition bno08x.hpp:311
Progress sample emitted during DFU transfers.
Definition bno08x.hpp:296
uint32_t totalBytes
Total firmware bytes to send.
Definition bno08x.hpp:298
uint32_t bytesSent
Number of firmware bytes sent so far.
Definition bno08x.hpp:297
Definition HcBin.h:47
Unit quaternion with sensor accuracy indicator.
Definition bno08x.hpp:108
float y
Imaginary j component.
Definition bno08x.hpp:111
float z
Imaginary k component.
Definition bno08x.hpp:112
float x
Imaginary i component.
Definition bno08x.hpp:110
uint8_t accuracy
Calibration accuracy (0 = unreliable, 3 = fully calibrated)
Definition bno08x.hpp:113
float w
Real (scalar) component.
Definition bno08x.hpp:109
Raw optical flow payload from SH2_RAW_OPTICAL_FLOW.
Definition bno08x.hpp:152
int16_t dx
Definition bno08x.hpp:155
uint8_t frameAvg
Definition bno08x.hpp:162
int16_t dy
Definition bno08x.hpp:156
uint8_t frameMax
Definition bno08x.hpp:161
uint8_t shutter
Definition bno08x.hpp:160
uint8_t resX
Definition bno08x.hpp:158
int16_t dt
Definition bno08x.hpp:154
uint32_t timestamp
Definition bno08x.hpp:153
uint8_t laserOn
Definition bno08x.hpp:164
uint8_t frameMin
Definition bno08x.hpp:163
int16_t iq
Definition bno08x.hpp:157
uint8_t resY
Definition bno08x.hpp:159
Raw integer 3-axis sample (ADC counts) with optional metadata.
Definition bno08x.hpp:129
int16_t x
Definition bno08x.hpp:130
int16_t z
Definition bno08x.hpp:132
int16_t temperature
Used by RawGyroscope only.
Definition bno08x.hpp:133
uint32_t sensorTimeUs
Sensor-provided timestamp where available.
Definition bno08x.hpp:134
int16_t y
Definition bno08x.hpp:131
Raw RVC frame data in integer fixed-point format.
Definition bno08x.hpp:235
int16_t yaw
Yaw angle (units: 0.01 degrees)
Definition bno08x.hpp:237
int16_t acc_y
Y linear acceleration (units: 0.001 g)
Definition bno08x.hpp:241
uint64_t timestamp_uS
Timestamp in microseconds (set by the driver)
Definition bno08x.hpp:245
uint8_t mr
Motion request (0=no constraint, 1=stay stationary)
Definition bno08x.hpp:244
int16_t pitch
Pitch angle (units: 0.01 degrees)
Definition bno08x.hpp:238
uint8_t index
Frame sequence index (0-255)
Definition bno08x.hpp:236
int16_t roll
Roll angle (units: 0.01 degrees)
Definition bno08x.hpp:239
int16_t acc_x
X linear acceleration (units: 0.001 g)
Definition bno08x.hpp:240
int16_t acc_z
Z linear acceleration (units: 0.001 g)
Definition bno08x.hpp:242
uint8_t mi
Motion intent (0=unknown, 1=stationary, 3=in motion)
Definition bno08x.hpp:243
Decoded RVC frame data in floating-point natural units.
Definition bno08x.hpp:254
uint8_t mi
Motion intent.
Definition bno08x.hpp:262
float yaw_deg
Yaw angle in degrees.
Definition bno08x.hpp:256
float acc_x_g
X linear acceleration in g.
Definition bno08x.hpp:259
uint8_t index
Frame sequence index.
Definition bno08x.hpp:255
uint64_t timestamp_uS
Timestamp in microseconds.
Definition bno08x.hpp:264
float roll_deg
Roll angle in degrees.
Definition bno08x.hpp:258
float acc_y_g
Y linear acceleration in g.
Definition bno08x.hpp:260
float pitch_deg
Pitch angle in degrees.
Definition bno08x.hpp:257
uint8_t mr
Motion request.
Definition bno08x.hpp:263
float acc_z_g
Z linear acceleration in g.
Definition bno08x.hpp:261
Container for a single decoded SH-2 sensor report.
Definition bno08x.hpp:201
uint64_t timestamp
Event timestamp in microseconds.
Definition bno08x.hpp:203
BNO085Sensor sensor
Which sensor produced this event.
Definition bno08x.hpp:202
bool detected
Generic detection flag for event-like reports.
Definition bno08x.hpp:222
uint8_t motionIntent
Interactive ZRO motion intent.
Definition bno08x.hpp:217
ActivityClassifierEvent activity
Personal activity classifier payload.
Definition bno08x.hpp:216
uint8_t classification
Classifier result (stability/activity, etc.).
Definition bno08x.hpp:213
uint32_t stepCount
Cumulative step count (StepCounter)
Definition bno08x.hpp:211
TapEvent tap
Tap event details (TapDetector)
Definition bno08x.hpp:215
uint8_t motionRequest
Interactive ZRO motion request.
Definition bno08x.hpp:218
RawVector3 raw
Raw integer payload for raw IMU reports.
Definition bno08x.hpp:209
Vector3 vector
3-axis data (accel/gyro/mag/gravity/etc.)
Definition bno08x.hpp:204
uint8_t sleepState
Sleep detector state.
Definition bno08x.hpp:214
WheelEncoderEvent wheelEncoder
Definition bno08x.hpp:221
RawOpticalFlowEvent rawOpticalFlow
Definition bno08x.hpp:219
DeadReckoningPoseEvent deadReckoningPose
Definition bno08x.hpp:220
Vector3 bias
Bias for uncalibrated gyro/mag reports.
Definition bno08x.hpp:205
uint16_t eventFlags
Bitfield payload for gesture detector reports.
Definition bno08x.hpp:212
Quaternion rotation
Quaternion data (rotation vector reports)
Definition bno08x.hpp:207
Vector3 angularVelocity
Angular velocity for GyroIntegratedRV.
Definition bno08x.hpp:206
float scalar
Scalar payload (pressure/light/humidity/temp/etc.)
Definition bno08x.hpp:208
uint32_t latencyUs
Latency for step detector/counter reports.
Definition bno08x.hpp:210
Tap detector event details.
Definition bno08x.hpp:120
uint8_t direction
Tap direction: 0=+X, 1=-X, 2=+Y, 3=-Y, 4=+Z, 5=-Z.
Definition bno08x.hpp:122
bool doubleTap
True if double-tap, false if single-tap.
Definition bno08x.hpp:121
Three-axis vector with sensor accuracy indicator.
Definition bno08x.hpp:94
uint8_t accuracy
Calibration accuracy (0 = unreliable, 3 = fully calibrated)
Definition bno08x.hpp:98
float x
X-axis component.
Definition bno08x.hpp:95
float y
Y-axis component.
Definition bno08x.hpp:96
float z
Z-axis component.
Definition bno08x.hpp:97
Wheel encoder payload.
Definition bno08x.hpp:183
uint16_t data
Definition bno08x.hpp:187
uint32_t timestamp
Definition bno08x.hpp:184
uint8_t wheelIndex
Definition bno08x.hpp:185
uint8_t dataType
Definition bno08x.hpp:186