mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-13 17:27:36 +08:00
Expose terrain vpos reset counter
This commit is contained in:
committed by
Mathieu Bresciani
parent
ab69681744
commit
bb950a1550
@@ -217,6 +217,9 @@ public:
|
|||||||
// get the estimated terrain vertical position relative to the NED origin
|
// get the estimated terrain vertical position relative to the NED origin
|
||||||
float getTerrainVertPos() const { return _terrain_vpos; };
|
float getTerrainVertPos() const { return _terrain_vpos; };
|
||||||
|
|
||||||
|
// get the number of times the vertical terrain position has been reset
|
||||||
|
uint8_t getTerrainVertPosResetCounter() const { return _terrain_vpos_reset_counter; };
|
||||||
|
|
||||||
// get the terrain variance
|
// get the terrain variance
|
||||||
float get_terrain_var() const { return _terrain_var; }
|
float get_terrain_var() const { return _terrain_var; }
|
||||||
|
|
||||||
@@ -510,6 +513,7 @@ private:
|
|||||||
// Terrain height state estimation
|
// Terrain height state estimation
|
||||||
float _terrain_vpos{0.0f}; ///< estimated vertical position of the terrain underneath the vehicle in local NED frame (m)
|
float _terrain_vpos{0.0f}; ///< estimated vertical position of the terrain underneath the vehicle in local NED frame (m)
|
||||||
float _terrain_var{1e4f}; ///< variance of terrain position estimate (m**2)
|
float _terrain_var{1e4f}; ///< variance of terrain position estimate (m**2)
|
||||||
|
uint8_t _terrain_vpos_reset_counter{0}; ///< number of times _terrain_vpos has been reset
|
||||||
uint64_t _time_last_hagl_fuse{0}; ///< last system time that a range sample was fused by the terrain estimator
|
uint64_t _time_last_hagl_fuse{0}; ///< last system time that a range sample was fused by the terrain estimator
|
||||||
uint64_t _time_last_fake_hagl_fuse{0}; ///< last system time that a fake range sample was fused by the terrain estimator
|
uint64_t _time_last_fake_hagl_fuse{0}; ///< last system time that a fake range sample was fused by the terrain estimator
|
||||||
bool _terrain_initialised{false}; ///< true when the terrain estimator has been initialized
|
bool _terrain_initialised{false}; ///< true when the terrain estimator has been initialized
|
||||||
|
|||||||
@@ -170,6 +170,7 @@ void Ekf::fuseHagl()
|
|||||||
if (isTimedOut(_time_last_hagl_fuse, timeout)) {
|
if (isTimedOut(_time_last_hagl_fuse, timeout)) {
|
||||||
_terrain_vpos = _state.pos(2) + meas_hagl;
|
_terrain_vpos = _state.pos(2) + meas_hagl;
|
||||||
_terrain_var = obs_variance;
|
_terrain_var = obs_variance;
|
||||||
|
_terrain_vpos_reset_counter++;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
_innov_check_fail_status.flags.reject_hagl = true;
|
_innov_check_fail_status.flags.reject_hagl = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user