Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/modules/ekf2/EKF/aid_sources/gnss/gps_checks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,17 @@ bool Ekf::runGnssChecks(const gnssSample &gps)
// Check the position dilution of precision
_gps_check_fail_status.flags.pdop = (gps.pdop > _params.req_pdop);

// Check the reported horizontal and vertical position accuracy
_gps_check_fail_status.flags.hacc = (gps.hacc > _params.req_hacc);
_gps_check_fail_status.flags.vacc = (gps.vacc > _params.req_vacc);
// Check the reported horizontal position accuracy (relaxed once passing)
const float max_horiz_accuracy = _control_status.flags.gps ? 2.f * _params.req_hacc : _params.req_hacc;
_gps_check_fail_status.flags.hacc = (gps.hacc > max_horiz_accuracy);

// Check the reported speed accuracy
_gps_check_fail_status.flags.sacc = (gps.sacc > _params.req_sacc);
// Check the reported vertical position accuracy (relaxed once passing)
const float max_vert_accuracy = _control_status.flags.gps ? 2.f * _params.req_vacc : _params.req_vacc;
_gps_check_fail_status.flags.vacc = (gps.vacc > max_vert_accuracy);

// Check the reported speed accuracy (relaxed once passing)
const float max_speed_accuracy = _control_status.flags.gps ? 2.f * _params.req_sacc : _params.req_sacc;
_gps_check_fail_status.flags.sacc = (gps.sacc > max_speed_accuracy);

// Calculate time lapsed since last update, limit to prevent numerical errors and calculate a lowpass filter coefficient
constexpr float filt_time_const = 10.0f;
Expand Down
Loading