SlimeVR / SlimeVR-Tracker-ESP

SlimeVR tracker firmware for ESP32/ESP8266 and different IMUs
Apache License 2.0
798 stars 274 forks source link

SoftFusion sensor framework with BMI, ICM, LSM6, MPU sensor implementations #322

Closed l0ud closed 1 week ago

l0ud commented 3 months ago

Hi This change is a is a collaborative effort among developers from Slime Discord to:

Sfusion is based on a simplified version of 0.dev's BMI160 driver, providing a generic sensor framework with several calibration methods for very slim drivers focused on the low-level handling of particular IMUs.

This change adds support for the following IMUs:

All drivers were tested to be functional, some are already being used in many sets (LSM6DSV, partially BMI270). One exception: MPU6050 sfusion driver may underperform until we find a way to change "restThGyr and restThAcc" in VQF based on the sensor. I would prefer to make this separate change, as this PR is already pretty large. Driver code is written from scratch for Slime, so I don't expect any licensing problems. Required Bosch BMI firmware is provided in separated file and it's BSD-licensed.

Existing drivers were not affected except for the current ICM42688 implementation, which was removed as it didn't work.

Drivers are as minimal as possible to reduce code size not incorporating any external libraries and to have full control over IMU programming.

Other changes:

Eirenliel commented 3 months ago

The "Had data" flag was removed as I considered it not really useful and not supported by most sensors anyway.

This flag was used for testing to ensure that the IMU not only initialized, but answers with data. We need to rework GET TEST command to ensure the same result at least, as it helps us catch unsoldered INT pins.