Skip to content

Commit

Permalink
SoftFusion sensor framework with BMI, ICM, LSM6, MPU sensor implement…
Browse files Browse the repository at this point in the history
…ations (#322)

* Update readme to mention BMI270 support.

* Soft fusion sensor initial code, wip

* Soft fusion ICM-42688-P lazy WIP implementation.

* sfusion: Cleanup, implemented sensor frequency calibration

* icm42688: add more comments, basic driver (no hw filtering) should be working

* sfustion: compilation fix

* sfusion: start calibration when upside down

* cleanup: remove confusing had data flag

* sensor manager: use unique_ptr instead of raw pointers

* sfusion: big refactoring wip

* sfusion: make aux work, at least sfusion sensors should now be functional

* sfusion: lightweight implementation of BMI270 sensor, no sensitivity cal yet

* sfusion: BMI270: added CRT and gyro zx factor. should be functionally equivalent to the old driver

* Added lsm6dsv

* Trying to work around esp32c3 compilation problem, not liking that solution

* sfusion: fix problems found after rebase

* Update README.md

* Bump Arduino core to 3.0 to match GCC12

* Remove fast pin swapping that is no longer compatible with arduino core v3

* Bring back fast pin swapping

* Update platformio-tools.ini

* Fix accel timescale (calibration no longer takes forever)

* Fix non-sfusion sensors

* Added LSM6DSO and DSR support and refactored DSV support

* Removed template float param from the implementation

* sfusion: port MPU6050 driver wip, not expecting to be functional yet

* sfusion: add headers specifying main code owners

* connection: fix warning

* update README.md

* fshelper: fixed ESP8266 regression caused by abstracting FS access

* sfusion: fix error on merge

* bno080: differentiate bno080, bno085, bno086 again

* sfusion: final touches

* restore hadData functionality, implementing it in every sensor, made configured flag bno-only

* fix address supplement in non-sfusion sensors, do i2c bus reset for all sensors

* sfusion: make MPU6050 driver use normal MPU6050 ImuID, change eatSamplesAndReturn function to take ms instead of seconds

* sfusion: hotfix, don't apply sensorOffset, it's applied in sensor base

* Log FIFO overruns on LSMs

* Reset the soft watchdog while eating or collecting calibration samples

Resolves an issue where the soft watchdog would trigger.

* Fix missing word in comment, switch to constexpr

* Update esp32/esp8266

---------

Co-authored-by: Gorbit99 <[email protected]>
Co-authored-by: nekomona <[email protected]>
Co-authored-by: nekomona <[email protected]>
Co-authored-by: unlogisch04 <[email protected]>
Co-authored-by: kounocom <[email protected]>
Co-authored-by: Kubuxu <[email protected]>
  • Loading branch information
7 people authored and Spacefish committed Jun 28, 2024
1 parent e04d269 commit 02bb9d3
Show file tree
Hide file tree
Showing 50 changed files with 2,829 additions and 947 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ The following IMUs and their corresponding `IMU` values are supported by the fir
* Using fusion in internal DMP for 6Dof or 9DoF, 9DoF mode requires good magnetic environment.
* Comment out `USE_6DOF` in `debug.h` for 9DoF mode.
* Experimental support!
* BMI270 (IMU_BMI270), ICM-42688 (IMU_ICM42688), LSM6DS3TR-C (IMU_LSM6DS3TRC), LSM6DSV (IMU_LSM6DSV), LSM6DSO (IMU_LSM6DSO), LSM6DSR (IMU_LSM6DSR), MPU-6050 (IMU_MPU6050_SF)
* Using common code: SoftFusionSensor for sensor fusion of Gyroscope and Accelerometer.
* Gyro&Accel sample rate, gyroscope offset and 6-side accelerometer calibration supported.
* In case of BMI270, gyroscope sensitivity auto-calibration (CRT) is additionally performed.
* Support for magnetometers is currently not implemented.
* VERY experimental support!

Firmware can work with both ESP8266 and ESP32. Please edit `defines.h` and set your pinout properly according to how you connected the IMU.

Expand Down
192 changes: 0 additions & 192 deletions lib/ICM42688/ICM42688.h

This file was deleted.

63 changes: 0 additions & 63 deletions lib/ICM42688/MMC5983MA.h

This file was deleted.

46 changes: 32 additions & 14 deletions platformio-tools.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,59 +7,74 @@ framework = arduino
build_flags =
!python scripts/get_git_commit.py
-O2
-std=gnu++17
-std=gnu++2a
build_unflags =
-Os
-std=gnu++11
-std=gnu++11 -std=gnu++17

[env:BOARD_SLIMEVR]
platform = espressif8266 @ 4.2.0
platform = espressif8266 @ 4.2.1
board = esp12e

[env:BOARD_SLIMEVR_DEV]
platform = espressif8266 @ 4.2.0
platform = espressif8266 @ 4.2.1
board = esp12e

[env:BOARD_NODEMCU]
platform = espressif8266 @ 4.2.0
platform = espressif8266 @ 4.2.1
board = esp12e

[env:BOARD_WEMOSD1MINI]
platform = espressif8266 @ 4.2.0
platform = espressif8266 @ 4.2.1
board = esp12e

[env:BOARD_TTGO_TBASE]
platform = espressif8266 @ 4.2.0
platform = espressif8266 @ 4.2.1
board = esp12e

[env:BOARD_WEMOSWROOM02]
platform = espressif8266 @ 4.2.0
platform = espressif8266 @ 4.2.1
board = esp12e

[env:BOARD_WROOM32]
platform = espressif32 @ 6.1.0
platform = espressif32 @ 6.7.0
platform_packages =
framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.1
framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip
board = esp32dev

[env:BOARD_ESP01]
platform = espressif32 @ 6.1.0
platform = espressif32 @ 6.7.0
platform_packages =
framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.1
framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip
board = esp32dev

[env:BOARD_LOLIN_C3_MINI]
platform = espressif32 @ 6.1.0
platform = espressif32 @ 6.7.0
platform_packages =
framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.1
framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip
build_flags =
${env.build_flags}
-DESP32C3
board = lolin_c3_mini

[env:BOARD_BEETLE32C3]
platform = espressif32 @ 6.1.0
platform = espressif32 @ 6.7.0
platform_packages =
framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.1
framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip
build_flags =
${env.build_flags}
-DESP32C3
board = dfrobot_beetle_esp32c3

[env:BOARD_ES32C3DEVKITM1]
platform = espressif32 @ 6.1.0
platform = espressif32 @ 6.7.0
platform_packages =
framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.1
framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip
build_flags =
${env.build_flags}
-DESP32C3
Expand All @@ -73,7 +88,10 @@ build_flags =
board = esp32-c6-devkitc-1

[env:BOARD_XIAO_ESP32C3]
platform = espressif32 @ 6.1.0
platform = espressif32 @ 6.7.0
platform_packages =
framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.1
framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip
build_flags =
${env.build_flags}
-DESP32C3
Expand Down
Loading

0 comments on commit 02bb9d3

Please sign in to comment.