mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-01 15:40:36 +08:00
commander: move manual_control and switches out
This moves the remaining handling of the manual control stuff out of commander. All communication between manual control now goes through vehicle commands, and the landing gear topic.
This commit is contained in:
committed by
Matthias Grob
parent
e49b596edc
commit
97d01f200e
@@ -153,8 +153,14 @@ MulticopterRateControl::Run()
|
||||
landing_gear_s landing_gear;
|
||||
|
||||
if (_landing_gear_sub.copy(&landing_gear)) {
|
||||
if (landing_gear.landing_gear != landing_gear_s::GEAR_KEEP) {
|
||||
_landing_gear = landing_gear.landing_gear;
|
||||
if (landing_gear.landing_gear != landing_gear_s::GEAR_KEEP &&
|
||||
_v_control_mode.flag_control_manual_enabled) {
|
||||
if (landing_gear_s::GEAR_UP && (_landed || _maybe_landed)) {
|
||||
mavlink_log_critical(&_mavlink_log_pub, "Landed, unable to retract landing gear")
|
||||
|
||||
} else {
|
||||
_landing_gear = landing_gear.landing_gear;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user