Skip to content
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

Add CV7-AHRS IMU support #156

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rkourdis
Copy link

@rkourdis rkourdis commented Apr 4, 2024

Description

This adds support for the Microstrain CV7-AHRS IMU, as the communication protocol is slightly different. The change is selectable by running make menuconfig (a new entry under firmware/README.md has been added).

For the CV7:

  • The Message Format command (0x0C, 0x0F) is different.
  • Two additional commands to set the accelerometer and gyroscope ranges to maximum have been added (+- 16g, +- 1krad/s).
  • The command to set the heading angle to zero during initialization is removed as (according to the documentation) it's ignored if magnetometer aiding is enabled.

I've decided to keep the original CX5 code unchanged, as I can't test with that IMU. It might be worth testing with it in any case, (and potentially refactoring the code). During startup the ESP32 should print the following, and the sensor readings should be reported correctly:

"Configuring for CX5-AHRS IMU..."

How I Tested

  • Flashed Masterboard with the CV7 setting enabled and observed IMU readings being correct.

I fulfilled the following requirements

  • All new code is formatted according to our style guide (for C++ run clang-format, for Python, run flake8 and fix all warnings).

    This has been skipped as it looks like it hasn't been ran before - clang-format -i uart_imu.c makes too many changes and would pollute the PR. Let me know if it would be better to add regardless!

  • All new functions/classes are documented and existing documentation is updated according to changes.

  • No commented code from testing/debugging is kept (unless there is a good reason to keep it).

@rkourdis
Copy link
Author

rkourdis commented Apr 6, 2024

@thomasfla You might want to have a look a this when you have time, let me know if you have any ideas for improvement!

@olivier-stasse olivier-stasse added the enhancement New feature or request label May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants