Tracker: honour vehicle arm status

Also don't indicate we are armed if we are in INITIALISING
This commit is contained in:
IamPete1 2019-02-28 21:38:28 +00:00 committed by Peter Barker
parent 5399b659ea
commit 70d4d2ac8f
2 changed files with 7 additions and 1 deletions

View File

@ -51,7 +51,9 @@ MAV_MODE GCS_MAVLINK_Tracker::base_mode() const
}
// we are armed if safety switch is not disarmed
if (hal.util->safety_switch_state() != AP_HAL::Util::SAFETY_DISARMED) {
if (hal.util->safety_switch_state() != AP_HAL::Util::SAFETY_DISARMED &&
tracker.control_mode != INITIALISING &&
hal.util->get_soft_armed()) {
_base_mode |= MAV_MODE_FLAG_SAFETY_ARMED;
}

View File

@ -103,6 +103,10 @@ void Tracker::update_tracking(void)
if (hal.util->safety_switch_state() == AP_HAL::Util::SAFETY_DISARMED) {
return;
}
// do not move if we are not armed:
if (!hal.util->get_soft_armed()) {
return;
}
switch (control_mode) {
case AUTO: