EKF: Update comments in heading fusion to clarify calculation of magnetic heading

This commit is contained in:
Paul Riseborough 2016-02-24 08:20:29 +11:00
parent 36affe3cd8
commit 0ad5329caf

View File

@ -610,9 +610,11 @@ void Ekf::fuseHeading()
// TODO - enable use of an off-board heading measurement
// rotate the magnetometer measurement into earth frame using an assumed zero yaw angle
// rotate the magnetometer measurement into earth frame
matrix::Euler<float> euler(_state.quat_nominal);
float predicted_hdg = euler(2); // we will need the predicted heading to calculate the innovation
// Set the yaw angle to zero and rotate the measurements into earth frame using the zero yaw angle
euler(2) = 0.0f;
matrix::Dcm<float> R_to_earth(euler);
matrix::Vector3f mag_earth_pred = R_to_earth * _mag_sample_delayed.mag;