Situation
I am interested in developing my own version of EKFbased UAV state estimator, and currently analyzing PX4Autopilotâ€™s implementation, especially the optimization(codegened) part using python symforce.
It seems that covariance prediction part of EKF is substituted with errorstate version since this (and this), as well as all codegened H matrices and Kalman gains. (adapted to 23dim)
The attitude part was mainly corrected (from 4dim quaternion to 3dim) while the rest are mostly remained the same (since they are all in Euclidean space). You can see the equivalence inside derivation.py by comparing the two elements: A[3:, 3:] and A_old[4:, 4:] where,
 A (latest version)
= VTangent(state_error_pred.to_storage()).jacobian(state_error).subs(zero_state_error).subs(zero_noise)
 A_old (old version)
= VState(state_pred.to_storage()).jacobian(vstate)
Here, I denote the first argument of predict_covariance() function as vstate, that is before modified to its tangentspace counterpart, (i.e., before state = vstate_to_state(state))
Question
Nonetheless, the state is predicted still in its totalstate version as in here (Ekf::predictState(â€¦)).
My questions are:

Shouldnâ€™t the state (of EKF of PX4Autopilot) be defined as errorstate for the exactitude?

Accordingly, almost all models should be rewritten in terms of errorstate (perhaps?)
 For instance, the prediction model
[from]: x_{k+1} = f(x_{k}) + w_{k} â†’
[to]: e_{k+1} = f_error(e_{k};x_{k}^{INS}) + w_{k}
where errorstate (=x_k^true  x_k^estimate) is denoted in e_k. I guess f_error() is what â€śstate_error_predâ€ť of derivation.py should produce when codegened. Also, as widely known, f_error() exhibits more linearity than f() as stated in here. I used {INS} for an independent integrator, i.e., deadreckoning.
 measurement model
[from] y_{k} = h(x_k) + v_{k} â†’
[to] either (1) y_{k} = h(x_k^{INS} + e_k^{filter_state}) + v_{k} or (2) y_error{k} = h_error(e_k) + vâ€™_{k}
 In summary, I donâ€™t get the reason why state itself is not converted to its errorstate form while covariance matrix is presented in errorstate form and treated accordingly.
The â€śmismatchâ€ť I wrote in the topic title means this: totalstate form implementation of state and its propagation vs. errorstate form implementation of covariance and all related uncertainty matrices, gains, etc. Current covariance matrix P seems not (exactly) presenting the uncertainty characteristic of StateSample _state of Ekf:EstimatorInterface, or am I missing something?