Skip to content

Commit

Permalink
Use MadgwickAHRS (#13)
Browse files Browse the repository at this point in the history
* AHRS Implementation

* Fix updateIMU bug

---------

Co-authored-by: Zhiquan Yeo <[email protected]>
  • Loading branch information
zhiquanyeo and Zhiquan Yeo authored Aug 16, 2023
1 parent 97c0573 commit f3be79e
Show file tree
Hide file tree
Showing 4 changed files with 270 additions and 67 deletions.
22 changes: 15 additions & 7 deletions include/imu.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,24 @@ bool imuIsEnabled();
void imuInit(uint8_t addr, TwoWire *theWire);
void imuCalibrate(unsigned long calibrationTime);

bool imuPeriodic();
void imuPeriodic();
bool imuDataReady();

float gyroGetAngleX();
float gyroGetRateX();
float imuGetAccelX();
float imuGetAccelY();
float imuGetAccelZ();

float gyroGetAngleY();
float gyroGetRateY();
float imuGetGyroRateX();
float imuGetGyroRateY();
float imuGetGyroRateZ();

float gyroGetAngleZ();
float gyroGetRateZ();
float imuGetRoll();
float imuGetPitch();
float imuGetYaw();

void imuResetRoll();
void imuResetPitch();
void imuResetYaw();

void gyroReset();

Expand Down
3 changes: 2 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ lib_deps =
Wire
adafruit/Adafruit LSM6DS@^4.7.0
adafruit/Adafruit BusIO@^1.14.1
adafruit/Adafruit Unified Sensor@^1.1.9
adafruit/Adafruit Unified Sensor@^1.1.9
arduino-libraries/Madgwick@^1.2.0
Loading

0 comments on commit f3be79e

Please sign in to comment.