Just some restructuring to make the mechanical engineering student Milo angry

This commit is contained in:
dario
2024-08-06 11:46:17 +02:00
parent 71c29bfc58
commit 04f6ad2b1d
2 changed files with 15 additions and 9 deletions

View File

@@ -65,6 +65,7 @@ KalmanState KalmanFilter::correct(KalmanState state, matrix z)
matrix K = state.error * H_.T() * linalg::inv(H_ * state.error * H_.T() + R_);
// Update the state based on the measurement
state.x = state.x + K * (z - H_ * state.x); //TODO check transpose
// Update the error covariance matrix
state.error = (identity_ - K * H_) * state.error;
return state;