mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-05 22:24:47 +08:00
mc_pos_control: make sure task gets started after idle delay
This commit is contained in:
committed by
Dennis Mannhart
parent
dc5f18bdcd
commit
43fb84a63b
@@ -649,18 +649,17 @@ MulticopterPositionControl::run()
|
|||||||
_wv_controller->update(matrix::Quatf(_att_sp.q_d), _states.yaw);
|
_wv_controller->update(matrix::Quatf(_att_sp.q_d), _states.yaw);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_control_mode.flag_armed) {
|
|
||||||
// as soon vehicle is armed check for flighttask
|
|
||||||
start_flight_task();
|
|
||||||
// arm hysteresis prevents vehicle to takeoff
|
// arm hysteresis prevents vehicle to takeoff
|
||||||
// before propeller reached idle speed.
|
// before propeller reached idle speed.
|
||||||
_arm_hysteresis.set_state_and_update(true);
|
_arm_hysteresis.set_state_and_update(_control_mode.flag_armed);
|
||||||
|
|
||||||
|
if (_arm_hysteresis.get_state()) {
|
||||||
|
// as soon vehicle is armed check for flighttask
|
||||||
|
start_flight_task();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// disable flighttask
|
// disable flighttask
|
||||||
_flight_tasks.switchTask(FlightTaskIndex::None);
|
_flight_tasks.switchTask(FlightTaskIndex::None);
|
||||||
// reset arm hysteresis
|
|
||||||
_arm_hysteresis.set_state_and_update(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if any task is active
|
// check if any task is active
|
||||||
|
|||||||
Reference in New Issue
Block a user