m5stack / M5StickC

M5StickC Arduino Library
MIT License
476 stars 221 forks source link

Need IMU Offset calibration #124

Open Menginventor opened 3 years ago

Menginventor commented 3 years ago

I use MPU6886 and I need to read/write acc/gyro offset value for calibrating IMU. please add these feature to your library. regard

uecken commented 3 years ago

Also, I have a favor. After execute function "M5.IMU.getAhrsData(&pitch,&roll,&yaw)", I can get about pitch:3, roll:10, yaw:random. I want to offset this pitch and roll within -180 to 180 phase. Could you fix it?

Menginventor commented 3 years ago

May be you need to implement AHRS update function by yourself. the AHRS (roll pitch yaw) system is define how imu frame rotate from global frame you can redefine imu frame by tranform them once with rotation matrix before assign to AHRS function.

uecken commented 3 years ago

Thank you your comment. I'm not used to C++, I'll try to fix.

edumo commented 3 years ago

9 axis working example https://github.com/edumo/M5StickC_Imu-9-axis