mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 02:03:33 +08:00
ekf2: setEkfGlobalOrigin() reset baro and hgt sensor offsets if necessary
- handle uninitalized _gps_alt_ref - add basic lat/lon/alt sanity checks
This commit is contained in:
@@ -77,7 +77,7 @@ void Ekf::updateGpsPos(const gpsSample &gps_sample)
|
||||
position(1) = gps_sample.pos(1);
|
||||
|
||||
// vertical position - gps measurement has opposite sign to earth z axis
|
||||
position(2) = -(gps_sample.hgt - _gps_alt_ref - _gps_hgt_offset);
|
||||
position(2) = -(gps_sample.hgt - getEkfGlobalOriginAltitude() - _gps_hgt_offset);
|
||||
|
||||
const float lower_limit = fmaxf(_params.gps_pos_noise, 0.01f);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user