mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 07:33:34 +08:00
initialise vertical position correctly
This commit is contained in:
@@ -172,6 +172,14 @@ bool Ekf::initialiseFilter(void)
|
||||
resetVelocity();
|
||||
resetPosition();
|
||||
|
||||
// initialize vertical position with newest baro measurement
|
||||
baroSample baro_init = _baro_buffer.get_newest();
|
||||
if (baro_init.time_us == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
_state.pos(2) = -baro_init.hgt;
|
||||
|
||||
initialiseCovariance();
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user