Hello,
I’ve been reading EKF2 source code after I read Joan Sola’s Thesis about Quaternion Kinematics and I stumbled upon convention issue that made me doubt my understanding of it.
In the code, we can see that the propagation equation is using right multiplication as :
_state.quat_nominal = (_state.quat_nominal * dq).normalized();
but then in the fuse function in ekf_helper.cpp, the correction is done as left multiplication as :
Quatf delta_quat(matrix::AxisAnglef(K.slice<State::quat_nominal.dof, 1>(State::quat_nominal.idx,
0) \* (-1.f \* innovation)));
_state.quat_nominal = delta_quat * _state.quat_nominal;
The thing is, in Joan Sola’s Thesis, he does not do this, he keeps the same convention in both prediction and update step.
I do not think that this (-1.f * innovation) is related to this as this negative (as far as I understand) comes because for some reason the innovation previously is calculated as (predicted - measurements) not the typical (measurements - predicted).
My only explanation to this is that in prediction the delta theta comes from gyroscope which is a body frame orientation, but in the update the delta theta comes from world frame source such as mag or gps therefore we reverse the multiplication order?
I’m not sure about this but I would be very glad if someone can clarify this to me.