Ekf: centralize GPS height fusion startup

This commit is contained in:
bresch
2020-04-19 12:38:13 +02:00
committed by Mathieu Bresciani
parent 61763544b6
commit 6b64cf0770
4 changed files with 15 additions and 11 deletions
+11
View File
@@ -1487,6 +1487,17 @@ void Ekf::startBaroHgtFusion()
}
}
void Ekf::startGpsHgtFusion()
{
setControlGPSHeight();
// we have just switched to using gps height, calculate height sensor offset such that current
// measurement matches our current height estimate
if (_control_status_prev.flags.gps_hgt != _control_status.flags.gps_hgt) {
_hgt_sensor_offset = _gps_sample_delayed.hgt - _gps_alt_ref + _state.pos(2);
}
}
// update the rotation matrix which rotates EV measurements into the EKF's navigation frame
void Ekf::calcExtVisRotMat()
{