Skip to content

Commit

Permalink
Update Mahony_AHRS.h
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrouch authored Aug 31, 2024
1 parent 127c01e commit 8b2e5fe
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bbn_wave_freq_m5atomS3/Mahony_AHRS.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,18 @@ typedef struct mahony_AHRS_vars {
float integralFBz = 0.0f; // integral error terms scaled by Ki
} Mahony_AHRS_Vars;

void mahony_AHRS_init(Mahony_AHRS_Vars* m, float twoKp, float twoKi);

void mahony_AHRS_update(Mahony_AHRS_Vars* m,
float gx, float gy, float gz, float ax, float ay, float az,
float *pitch, float *roll, float *yaw, float delta_t_sec);
float invSqrt(float x);

void mahony_AHRS_init(Mahony_AHRS_Vars* m, float twoKp, float twoKi) {
m->twoKp = twoKp;
m->twoKi = twoKi;
}

// IMU algorithm update (without magnetometer)
void mahony_AHRS_update(Mahony_AHRS_Vars* m,
float gx, float gy, float gz, float ax, float ay, float az,
Expand Down Expand Up @@ -125,3 +132,4 @@ float invSqrt(float x) {
#pragma GCC diagnostic pop

#endif

0 comments on commit 8b2e5fe

Please sign in to comment.