From b818b07df36f7f952ffc04bac427c0f2f565b574 Mon Sep 17 00:00:00 2001 From: mtm-oss <47859285+mtm-oss@users.noreply.github.com> Date: Fri, 22 Feb 2019 12:51:40 -0500 Subject: [PATCH] mc_att_control: Failover in case of gyroscope failure (#11516) Problem description at: http://discuss.px4.io/t/multicopter-lock-if-primary-gyro-fails/9685 --- src/modules/mc_att_control/mc_att_control_main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/mc_att_control/mc_att_control_main.cpp b/src/modules/mc_att_control/mc_att_control_main.cpp index ea834c04d5..692aa8ee1c 100644 --- a/src/modules/mc_att_control/mc_att_control_main.cpp +++ b/src/modules/mc_att_control/mc_att_control_main.cpp @@ -837,6 +837,8 @@ MulticopterAttitudeControl::run() while (!should_exit()) { + // check if the selected gyro has updated first + sensor_correction_poll(); poll_fds.fd = _sensor_gyro_sub[_selected_gyro]; /* wait for up to 100ms for data */ @@ -887,7 +889,6 @@ MulticopterAttitudeControl::run() vehicle_status_poll(); vehicle_motor_limits_poll(); battery_status_poll(); - sensor_correction_poll(); sensor_bias_poll(); vehicle_land_detected_poll(); landing_gear_state_poll();