Browse Source

Copter: do no compass stick gesture detection while armed

master
Peter Barker 6 years ago committed by Andrew Tridgell
parent
commit
7207035c34
  1. 8
      ArduCopter/sensors.cpp

8
ArduCopter/sensors.cpp

@ -107,12 +107,14 @@ void Copter::init_optflow()
void Copter::compass_cal_update() void Copter::compass_cal_update()
{ {
static uint32_t compass_cal_stick_gesture_begin = 0; compass.cal_update();
if (!hal.util->get_soft_armed()) { if (hal.util->get_soft_armed()) {
compass.compass_cal_update(); return;
} }
static uint32_t compass_cal_stick_gesture_begin = 0;
if (compass.is_calibrating()) { if (compass.is_calibrating()) {
if (channel_yaw->get_control_in() < -4000 && channel_throttle->get_control_in() > 900) { if (channel_yaw->get_control_in() < -4000 && channel_throttle->get_control_in() > 900) {
compass.cancel_calibration_all(); compass.cancel_calibration_all();

Loading…
Cancel
Save