mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-06 09:01:36 +08:00
ekf2: include 0 timestamp checks in helpers (isTimedOut(), isRecent(), etc)
- EKF isTimedOut(), isRecent(), and isNewestSampleRecent() need to handle the case where the timestamp has never been set - reset() more thoroughly reset fields (mainly impacts unit tests)
This commit is contained in:
@@ -973,17 +973,17 @@ private:
|
||||
|
||||
bool isTimedOut(uint64_t last_sensor_timestamp, uint64_t timeout_period) const
|
||||
{
|
||||
return last_sensor_timestamp + timeout_period < _time_delayed_us;
|
||||
return (last_sensor_timestamp == 0) || (last_sensor_timestamp + timeout_period < _time_delayed_us);
|
||||
}
|
||||
|
||||
bool isRecent(uint64_t sensor_timestamp, uint64_t acceptance_interval) const
|
||||
{
|
||||
return sensor_timestamp + acceptance_interval > _time_delayed_us;
|
||||
return (sensor_timestamp != 0) && (sensor_timestamp + acceptance_interval > _time_delayed_us);
|
||||
}
|
||||
|
||||
bool isNewestSampleRecent(uint64_t sensor_timestamp, uint64_t acceptance_interval) const
|
||||
{
|
||||
return sensor_timestamp + acceptance_interval > _time_latest_us;
|
||||
return (sensor_timestamp != 0) && (sensor_timestamp + acceptance_interval > _time_latest_us);
|
||||
}
|
||||
|
||||
void startAirspeedFusion();
|
||||
|
||||
Reference in New Issue
Block a user