mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-22 20:53:20 +08:00
ekf2: remove redundant ned_origin_initialised flag
This commit is contained in:
@@ -63,13 +63,12 @@ Vector3f Ekf::calcEarthRateNED(float lat_rad) const
|
||||
-CONSTANTS_EARTH_SPIN_RATE * sinf(lat_rad));
|
||||
}
|
||||
|
||||
bool Ekf::getEkfGlobalOrigin(uint64_t &origin_time, double &latitude, double &longitude, float &origin_alt) const
|
||||
void Ekf::getEkfGlobalOrigin(uint64_t &origin_time, double &latitude, double &longitude, float &origin_alt) const
|
||||
{
|
||||
origin_time = _pos_ref.getProjectionReferenceTimestamp();
|
||||
latitude = _pos_ref.getProjectionReferenceLat();
|
||||
longitude = _pos_ref.getProjectionReferenceLon();
|
||||
origin_alt = getEkfGlobalOriginAltitude();
|
||||
return _NED_origin_initialised;
|
||||
}
|
||||
|
||||
bool Ekf::checkLatLonValidity(const double latitude, const double longitude)
|
||||
@@ -122,8 +121,6 @@ bool Ekf::setLatLonOrigin(const double latitude, const double longitude, const f
|
||||
_gpos_origin_eph = eph;
|
||||
}
|
||||
|
||||
_NED_origin_initialised = true;
|
||||
|
||||
if (current_pos_available) {
|
||||
// reset horizontal position if we already have a global origin
|
||||
Vector2f position = _pos_ref.project(current_lat, current_lon);
|
||||
@@ -198,8 +195,6 @@ bool Ekf::setLatLonOriginFromCurrentPos(const double latitude, const double long
|
||||
_gpos_origin_eph = eph;
|
||||
}
|
||||
|
||||
_NED_origin_initialised = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user