9-DOF IMU handler supporting accelerometer, gyroscope, magnetometer, and fused
orientation via I2C or SPI. Uses type-erased IBno08xDriverOps interface to
hide transport template complexity.
Sensor enable/disable/read operations are performed through the underlying
driver object returned by GetSensor() / GetDriver():
1
2
3
4
5
6
7
8
9
10
// Direct driver accessauto*drv=handler.GetSensor();drv->EnableSensor(BNO085Sensor::RotationVector,10);// 100 Hzdrv->Update();autoevent=drv->GetLatest(BNO085Sensor::RotationVector);// Or mutex-protected via visitDriverhandler.visitDriver([](IBno08xDriverOps&drv){drv.EnableSensor(BNO085Sensor::Accelerometer,20);});
Thread Safety
All public methods are protected by an internal RtosMutex (recursive).
visitDriver() additionally holds the mutex for the duration of the callable.
Test Coverage
See examples/esp32/main/handler_tests/bno08x_handler_comprehensive_test.cpp — 9 test
sections including sensor enable/disable, config apply validation, and hardware reset.