Tracker: only run servo updates when safety is off

Largely removes the sudden jerk that occurs when the user pushes the
safety switch
This commit is contained in:
Randy Mackay 2014-10-11 17:06:29 +09:00
parent 9d4107f1fc
commit 32d8e5c8d4
1 changed files with 5 additions and 0 deletions

View File

@ -82,6 +82,11 @@ static void update_tracking(void)
return;
}
// do not perform updates if safety switch is disarmed (i.e. servos can't be moved)
if (hal.util->safety_switch_state() == AP_HAL::Util::SAFETY_DISARMED) {
return;
}
switch (control_mode) {
case AUTO:
update_auto();