I am working on fusing GPS and IMU sensor measurement to calculate position in x and y direction. In this process I am not able to figure out how to calculate Q and R matrix values for kalman filtering.
Some details of implementation
- GPS coordinate are converted from geodetic to local NED coordinates
- IMU sensor data (Accelerometer, Gyroscope and Magnetometer) values are fused using AHRS filter to get roll, pitch and yaw angles
- IMU sensor measurement (acceleration) is converted from body coordinate to NED coordinate using rotation matrix
I am getting IMU and GPS sensor values from my mobile phone. I am stuck at a point getting a method to calculate correct Q and R matrix values.
As of now, I am using constant values Q = diag[0.001,0.001] and R = diag[2000000,4000000] (this looks weird) using these values I am getting somewhat fused position estimates. When value of R is set to low value for example [10,20] the estimated position follows exactly GPS coordinates, there is no influence of IMU sensor measurements.
I trying to figure out why high value for measurement noise matrix works, I assume since I am converting GPS coordinate from geodetic to local NED values, so the need for higher values. But anyway I am sure this is not the right way to calculate this.
It would be very helpful if someone can help me out.
Thank you