initialise vertical position correctly

This commit is contained in:
Roman
2016-01-05 07:44:37 +01:00
parent 5aa5f7f8c3
commit 2a88fc6cfd
2 changed files with 9 additions and 1 deletions
+8
View File
@@ -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;
+1 -1
View File
@@ -78,7 +78,7 @@ void Ekf::resetPosition()
}
baroSample baro_newest = _baro_buffer.get_newest();
_state.pos(2) = baro_newest.hgt;
_state.pos(2) = -baro_newest.hgt;
}
#if defined(__PX4_POSIX) && !defined(__PX4_QURT)