mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-23 06:36:45 +08:00
commander: use existing class state to track mission progress (#24947)
Replaced the local variable landed_amid_mission with the class member _mission_in_progress for consistency and to reduce redundancy. No functional change.
This commit is contained in:
@@ -2255,9 +2255,7 @@ void Commander::handleAutoDisarm()
|
||||
// Check for auto-disarm on landing or pre-flight
|
||||
if (_param_com_disarm_land.get() > 0 || _param_com_disarm_prflt.get() > 0) {
|
||||
|
||||
const bool landed_amid_mission = (_vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_AUTO_MISSION)
|
||||
&& !_mission_result_sub.get().finished;
|
||||
const bool auto_disarm_land_enabled = _param_com_disarm_land.get() > 0 && !landed_amid_mission
|
||||
const bool auto_disarm_land_enabled = _param_com_disarm_land.get() > 0 && !_mission_in_progress
|
||||
&& !_config_overrides.disable_auto_disarm;
|
||||
|
||||
if (auto_disarm_land_enabled && _have_taken_off_since_arming) {
|
||||
|
||||
Reference in New Issue
Block a user