ekf2: remove redundant ned_origin_initialised flag

This commit is contained in:
bresch
2024-10-01 10:37:20 -04:00
committed by Daniel Agar
parent fe40ccd193
commit 5bfa6b3359
6 changed files with 11 additions and 20 deletions
+2 -3
View File
@@ -188,8 +188,7 @@ public:
Vector3f getPositionVariance() const { return getStateVariance<State::pos>(); }
// get the ekf WGS-84 origin position and height and the system time it was last set
// return true if the origin is valid
bool getEkfGlobalOrigin(uint64_t &origin_time, double &latitude, double &longitude, float &origin_alt) const;
void getEkfGlobalOrigin(uint64_t &origin_time, double &latitude, double &longitude, float &origin_alt) const;
bool checkLatLonValidity(double latitude, double longitude);
bool checkAltitudeValidity(float altitude);
bool setEkfGlobalOrigin(double latitude, double longitude, float altitude, float eph = NAN, float epv = NAN);
@@ -223,7 +222,7 @@ public:
// and have not started using synthetic position observations to constrain drift
bool global_position_is_valid() const
{
return (_NED_origin_initialised && local_position_is_valid());
return (_pos_ref.isInitialized() && local_position_is_valid());
}
// return true if the local position estimate is valid