Skip to content

feat(icm42670): Add ICM42607 / ICM42670 IMU component #392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Mar 4, 2025

Conversation

finger563
Copy link
Contributor

@finger563 finger563 commented Mar 3, 2025

Description

  • Update BasePeripheral to have additional set_bits_with_mask to ensure any other bits within the mask are reset.
  • Add new component for IMU
  • Add IMU to esp-box component and test it in the example
  • Fix fast_sqrt to use more modern c++23 implementation from wikipedia
  • Fix fast_sqrt to be properly named fast_inv_sqrt
  • Update affected bldc_motor component to properly use fast_inv_sqrt
  • Add new filters ComplementaryFilter, MadgwickFilter and KalmanFilter for use with angle / state estimation with different tradeoffs
  • Update esp-box to initialize and expose IMU

Motivation and Context

IMUs are nice, and exposing the IMU via the hardware component / bsp (esp-box in this case) is even better. Testing / showcasing the IMU in the bsp example is even better.

How has this been tested?

  • Build and run esp-box/example on ESP-BOX and ensure the IMU works by looking at the on-screen-display while moving the box around various orientations.
  • Build and run math/example and make sure the fast_inv_sqrt is very close to sqrt
  • Build and run motorgo-mini/example and make sure the motor still works in position and velocity control modes.

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

Slow rotation video:

imu-slow-compressed.mp4

Fast rotation video:

imu-fast-compressed.mp4

Pictures showing the new gravity vector pointing down from the center of the screen:
image
image

ICM42607 Example

CleanShot 2025-03-04 at 15 14 10
CleanShot 2025-03-04 at 15 15 45

icm42607-data.txt

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed.
  • My code follows the code style of this project.

* Add new component for IMU
* Add IMU to esp-box component and test it in the example

IMUs are nice, and exposing the IMU via the hardware component / bsp (esp-box in this case) is even better. Testing / showcasing the IMU in the bsp example is _even_ better.

Build and run `esp-box/example` on ESP-BOX and ensure the IMU works by looking at the on-screen-display while moving the box around various orientations.
Copy link

github-actions bot commented Mar 3, 2025

✅Static analysis result - no issues found! ✅

@finger563 finger563 merged commit 04e62fe into main Mar 4, 2025
75 checks passed
@finger563 finger563 deleted the feat/icm42670-imu branch March 4, 2025 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant