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

Big modifications, but most importantly added NED and ENU frame supports. #40

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

CK-Explorer
Copy link

@CK-Explorer CK-Explorer commented Apr 2, 2023

  1. Added NED, ENU local reference frame supports.
    The original code was designed for NWU local reference frame, as observed from Eqs. 23 and 27 in his paper. So, for NED frame, Eq. 23 is changed to be equaled to [0 0 0 -1], while for ENU frame, Eq. 27 is changed to be equaled to [0 0 $b_x$ $b_z$]. These modifications lead to different matrices in Eqs. 25 and 26 for NED frame, while in Eqs. 29 and 30 for ENU frame.

  2. Added supports of passing different gyroscope reading's unit (rad or deg) based on user preference into Madgwick::update() and Madgwick::updateIMU().

  3. Added non-constant IMU's update frequency support by allowing users to use elapsed time, while constant frequency still supports.

NOTE: Changes 1 to 3 are achieved using template and functions overloading, but requires C++ 17 supports.
For lower than C++ 17, "if ... " is used instead of "if constexpr ... ", which hinders those branches to be evaluated during compile-time. Hence, this might impact the performance.

  1. Added Madgwick::updateCore() and Madgwick::updateCoreIMU() to avoid some code duplications (maintainability purpose) for constant and non-constant frequency supports in Madgwick::update() and Madgwick::updateIMU() respectively.

  2. Added a getter function to obtain quaternion.
    Obtaining the quaternion is an essential feature of this filter, that avoids numerical instability in determining roll and yaw angles when pitch angle reaches +/-90 degree.

  3. Added setter functions for filter parameter (beta) and IMU's frequency separately.

  4. Added constructors overloading to initialize filter parameter (beta) and IMU's frequency.

  5. Added inline wrapper functions for degree to radians and vice-versa conversion (readability purpose).

  6. Rearranged some previous codes (readability purpose).

  7. Added comments.

Added NED, ENU local reference frame supports.
Added supports of passing different gyroscope reading's unit (rad or deg) based on user preference into Madgwick::update() and Madgwick::updateIMU().
Added non-constant IMU's update frequency support by allowing users to use elapsed time, while constant frequency still supports.
All the above changes are achieved using template and functions overloading.
Added Madgwick::updateCore() and Madgwick::updateCoreIMU() to avoid some code duplications for constant and non-constant frequency supports in Madgwick::update() and Madgwick::updateIMU() respectively.

Added a getter function to obtain quaternion, and setter functions for filter parameter (beta) and IMU's frequency separately.
Added constructors overloading to initialize filter parameter (beta) and IMU's frequency.
Added inline wrapper functions for degree to radians and vice-versa conversion for readability purpose.

Rearranged some previous codes for readability purpose.
Added comments.
@CLAassistant
Copy link

CLAassistant commented Apr 2, 2023

CLA assistant check
All committers have signed the CLA.

@CK-Explorer CK-Explorer marked this pull request as draft April 2, 2023 08:54
@github-actions
Copy link

github-actions bot commented Apr 2, 2023

Memory usage change @ 0f1a839

Board flash % RAM for global variables %
Intel:arc32:arduino_101 🔺 +576 - +576 +0.37 - +0.37 N/A N/A
Click for full report table
Board examples/Visualize101
flash
% examples/Visualize101
RAM for global variables
%
Intel:arc32:arduino_101 576 0.37 N/A N/A
Click for full report CSV
Board,examples/Visualize101<br>flash,%,examples/Visualize101<br>RAM for global variables,%
Intel:arc32:arduino_101,576,0.37,N/A,N/A

@github-actions
Copy link

github-actions bot commented Apr 2, 2023

Memory usage change @ cddf138

Board flash % RAM for global variables %
Intel:arc32:arduino_101 🔺 +812 - +812 +0.52 - +0.52 N/A N/A
Click for full report table
Board examples/Visualize101
flash
% examples/Visualize101
RAM for global variables
%
Intel:arc32:arduino_101 812 0.52 N/A N/A
Click for full report CSV
Board,examples/Visualize101<br>flash,%,examples/Visualize101<br>RAM for global variables,%
Intel:arc32:arduino_101,812,0.52,N/A,N/A

@github-actions
Copy link

github-actions bot commented Apr 2, 2023

Memory usage change @ 1ebe2f0

Board flash % RAM for global variables %
Intel:arc32:arduino_101 🔺 +812 - +812 +0.52 - +0.52 N/A N/A
Click for full report table
Board examples/Visualize101
flash
% examples/Visualize101
RAM for global variables
%
Intel:arc32:arduino_101 812 0.52 N/A N/A
Click for full report CSV
Board,examples/Visualize101<br>flash,%,examples/Visualize101<br>RAM for global variables,%
Intel:arc32:arduino_101,812,0.52,N/A,N/A

@CK-Explorer CK-Explorer marked this pull request as ready for review April 2, 2023 10:19
@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Apr 2, 2023
digisomni added a commit to neocadia/MadgwickAHRS that referenced this pull request Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants