mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-22 06:14:14 +08:00
fix(navigator): re-evaluate climb requirement on mission cursor change
Without this, a cursor change while the vehicle is below the target altitude leaves handleTakeoff() publishing the raw item lat/lon as a POSITION setpoint, causing a diagonal takeoff.
This commit is contained in:
@@ -450,6 +450,11 @@ void MissionBase::update_mission()
|
||||
_navigator->reset_vroi();
|
||||
|
||||
if (_navigator->get_mission_result()->valid) {
|
||||
/* re-issue the climb ticket on cursor change while in takeoff phase */
|
||||
if (_land_detected_sub.get().landed || _work_item_type == WorkItemType::WORK_ITEM_TYPE_CLIMB) {
|
||||
checkClimbRequired(_mission.current_seq);
|
||||
}
|
||||
|
||||
/* reset work item if new mission has been accepted */
|
||||
_work_item_type = WorkItemType::WORK_ITEM_TYPE_DEFAULT;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user