split into get_terrain_valid and get_terrain_vert_pos

This commit is contained in:
ChristophTobler
2017-07-17 16:42:42 +02:00
parent c42f820072
commit eae0522dc2
4 changed files with 19 additions and 13 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));