Skip to content
Snippets Groups Projects
Commit 2c97054d authored by Paul Riseborough's avatar Paul Riseborough Committed by Daniel Agar
Browse files

commander notify user if EKF fails compass (#10919)

parent 7996f972
No related branches found
No related tags found
No related merge requests found
......@@ -4025,9 +4025,17 @@ void Commander::estimator_check(bool *status_changed)
const vehicle_local_position_s &lpos = _local_position_sub.get();
const vehicle_global_position_s &gpos = _global_position_sub.get();
const bool mag_fault_prev = (_estimator_status_sub.get().control_mode_flags & (1 << estimator_status_s::CS_MAG_FAULT));
if (_estimator_status_sub.update()) {
const estimator_status_s& estimator_status = _estimator_status_sub.get();
// Check for a magnetomer fault and notify the user
const bool mag_fault = (estimator_status.control_mode_flags & (1 << estimator_status_s::CS_MAG_FAULT));
if (!mag_fault_prev && mag_fault) {
mavlink_log_critical(&mavlink_log_pub, "Stopping compass use, check calibration on landing");
}
// Set the allowable position uncertainty based on combination of flight and estimator state
// When we are in a operator demanded position control mode and are solely reliant on optical flow, do not check position error because it will gradually increase throughout flight and the operator will compensate for the drift
const bool reliant_on_opt_flow = ((estimator_status.control_mode_flags & (1 << estimator_status_s::CS_OPT_FLOW))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment