AP_AHRS: expose EKF setTerrainHgtStable accessor

This commit is contained in:
Randy Mackay 2020-06-22 12:15:07 +09:00
parent ed5b695c94
commit d0a2198e00
3 changed files with 20 additions and 0 deletions

View File

@ -566,6 +566,10 @@ public:
// false when no limiting is required
virtual bool get_hgt_ctrl_limit(float &limit) const WARN_IF_UNUSED { return false; };
// Set to true if the terrain underneath is stable enough to be used as a height reference
// this is not related to terrain following
virtual void set_terrain_hgt_stable(bool stable) {}
// Write position and quaternion data from an external navigation system
virtual void writeExtNavData(const Vector3f &pos, const Quaternion &quat, float posErr, float angErr, uint32_t timeStamp_ms, uint16_t delay_ms, uint32_t resetTime_ms) { }

View File

@ -1977,6 +1977,18 @@ bool AP_AHRS_NavEKF::get_hgt_ctrl_limit(float& limit) const
return false;
}
// Set to true if the terrain underneath is stable enough to be used as a height reference
// this is not related to terrain following
void AP_AHRS_NavEKF::set_terrain_hgt_stable(bool stable)
{
#if HAL_NAVEKF2_AVAILABLE
EKF2.setTerrainHgtStable(stable);
#endif
#if HAL_NAVEKF3_AVAILABLE
EKF3.setTerrainHgtStable(stable);
#endif
}
// get_location - updates the provided location with the latest calculated location
// returns true on success (i.e. the EKF knows it's latest position), false on failure
bool AP_AHRS_NavEKF::get_location(struct Location &loc) const

View File

@ -249,6 +249,10 @@ public:
// it will return invalid when no limiting is required
bool get_hgt_ctrl_limit(float &limit) const override;
// Set to true if the terrain underneath is stable enough to be used as a height reference
// this is not related to terrain following
void set_terrain_hgt_stable(bool stable) override;
// get_location - updates the provided location with the latest
// calculated location including absolute altitude
// returns true on success (i.e. the EKF knows it's latest