first commit
This commit is contained in:
10
MPU6050/APP/kalman.c
Normal file
10
MPU6050/APP/kalman.c
Normal file
@ -0,0 +1,10 @@
|
||||
#include "kalman.h"
|
||||
|
||||
//һά<D2BB><CEAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˲<EFBFBD>
|
||||
void kalmanfiter(struct KalmanFilter *EKF,float input)
|
||||
{
|
||||
EKF->NewP = EKF->LastP + EKF->Q;
|
||||
EKF->Kg = EKF->NewP / (EKF->NewP + EKF->R);
|
||||
EKF->Out = EKF->Out + EKF->Kg * (input - EKF->Out);
|
||||
EKF->LastP = (1 - EKF->Kg) * EKF->NewP;
|
||||
}
|
Reference in New Issue
Block a user