This repository was archived by the owner on May 1, 2024. It is now read-only.
Commit 54ac147 1 parent 770cd3c commit 54ac147 Copy full SHA for 54ac147
File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -261,6 +261,9 @@ class Ekf : public EstimatorInterface
261
261
// use the latest IMU data at the current time horizon.
262
262
Quatf calculate_quaternion () const ;
263
263
264
+ // set minimum continuous period without GPS fail required to mark a healthy GPS status
265
+ void set_min_required_gps_health_time (uint32_t time_us) { _min_gps_health_time_us = time_us; }
266
+
264
267
private:
265
268
266
269
static constexpr uint8_t _k_num_states{24 }; // /< number of EKF states
@@ -408,6 +411,7 @@ class Ekf : public EstimatorInterface
408
411
uint64_t _last_gps_fail_us{0 }; // /< last system time in usec that the GPS failed it's checks
409
412
uint64_t _last_gps_pass_us{0 }; // /< last system time in usec that the GPS passed it's checks
410
413
float _gps_error_norm{1 .0f }; // /< normalised gps error
414
+ uint32_t _min_gps_health_time_us{10000000 }; // /< GPS is marked as healthy only after this amount of time
411
415
412
416
// Variables used to publish the WGS-84 location of the EKF local NED origin
413
417
uint64_t _last_gps_origin_time_us{0 }; // /< time the origin was last set (uSec)
Original file line number Diff line number Diff line change @@ -242,6 +242,6 @@ bool Ekf::gps_is_good(const gps_message &gps)
242
242
_last_gps_pass_us = _time_last_imu;
243
243
}
244
244
245
- // continuous period without fail of 10 seconds required to return a healthy status
246
- return ( _time_last_imu - _last_gps_fail_us > (uint64_t )1e7 ) ;
245
+ // continuous period without fail of x seconds required to return a healthy status
246
+ return _time_last_imu - _last_gps_fail_us > (uint64_t )_min_gps_health_time_us ;
247
247
}
You can’t perform that action at this time.
0 commit comments