Revert "Revert "Split get_terrain_vert_pos() into valid and get_vpos""

This commit is contained in:
Paul Riseborough
2017-07-19 17:52:35 +10:00
committed by GitHub
parent 13f8d949bd
commit e1fe5b2229
5 changed files with 24 additions and 18 deletions
+8 -5
View File
@@ -150,12 +150,9 @@ void Ekf::fuseHagl()
}
}
// return true if the estimate is fresh
// return the estimated vertical position of the terrain relative to the NED origin
bool Ekf::get_terrain_vert_pos(float *ret)
// return true if the terrain estimate is valid
bool Ekf::get_terrain_valid()
{
memcpy(ret, &_terrain_vpos, sizeof(float));
if (_terrain_initialised && _range_data_continuous && !_innov_check_fail_status.flags.reject_hagl) {
return true;
@@ -164,6 +161,12 @@ bool Ekf::get_terrain_vert_pos(float *ret)
}
}
// get the estimated vertical position of the terrain relative to the NED origin
void Ekf::get_terrain_vert_pos(float *ret)
{
memcpy(ret, &_terrain_vpos, sizeof(float));
}
void Ekf::get_hagl_innov(float *hagl_innov)
{
memcpy(hagl_innov, &_hagl_innov, sizeof(_hagl_innov));