mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-30 20:48:33 -04:00
Tracker: honour vehicle arm status
Also don't indicate we are armed if we are in INITIALISING
This commit is contained in:
parent
5399b659ea
commit
70d4d2ac8f
@ -51,7 +51,9 @@ MAV_MODE GCS_MAVLINK_Tracker::base_mode() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// we are armed if safety switch is not disarmed
|
// 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;
|
_base_mode |= MAV_MODE_FLAG_SAFETY_ARMED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,6 +103,10 @@ void Tracker::update_tracking(void)
|
|||||||
if (hal.util->safety_switch_state() == AP_HAL::Util::SAFETY_DISARMED) {
|
if (hal.util->safety_switch_state() == AP_HAL::Util::SAFETY_DISARMED) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// do not move if we are not armed:
|
||||||
|
if (!hal.util->get_soft_armed()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (control_mode) {
|
switch (control_mode) {
|
||||||
case AUTO:
|
case AUTO:
|
||||||
|
Loading…
Reference in New Issue
Block a user