# How to model transition matrix in indirect kalman filter with external orientation estimate

I am trying to implement an indirect/error state kalman filter following Quaternion kinematics for the error-state Kalman filter. However, instead of modelling the orientation and error in orientation I have chosen to utilize Madwick to estimate the orientation.

The problem is that when I create the transition matrix from the first paper it expects the orientation error which it multiplies with the skew matrix of the measured acceleration and the accelerometer bias (page 40, equation 204). Since I have removed that from my states I can't use it, but then the measured acceleration is never considered (which I assume makes the filter worse). Is there any change I can make to the transition matrix so that it accounts for the acceleration?

• "Instead of modelling the orientation and error in orientation I have chose to utilize [the Madwick filter]." What are you trying to measure with your filter, then? – Chuck Mar 28 '17 at 13:45
• Position, velocity and other factors. I have only removed orientation and gyroscope bias (since the Madwick filter accounts for bias). My thinking is that the Madwick filter is more than enough to model orientation, but I want position and velocity as well and so keep those state in the filter. – Nordmoen Mar 28 '17 at 14:15
• The Madgwick filter gives you position. – Chuck Mar 28 '17 at 19:49
• How does it do that? As far as I can see the only state that is kept in the paper is orientation, it also has no way of incorporating additional data like GPS or vision. – Nordmoen Mar 29 '17 at 6:56

After careful reading of the first paper I think the solution to the problem is to simply not include the multiplication. From the proof of 172b and equation 177, in my filter I have $R_t$ (since I get that from the Madgwick filter) and can simply apply that to the error state. So equation 195b is instead $\delta v = \delta v - (R\delta a_b - \delta g)\Delta t + \mathbf{v_i}$, note that we don't multiply with $\theta$ since the Madgwick filter models that error.
The transition matrix does then not have to include any terms related to $\theta$ which means we only relate error in speed with error in accelerometer $\delta a_b$ and error in the gravity vector $\delta g$. In essence we remove the skew matrix multiplication.