mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-19 08:19:06 +08:00
EKF: Update comments in heading fusion to clarify calculation of magnetic heading
This commit is contained in:
parent
36affe3cd8
commit
0ad5329caf
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user