mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-01 08:30:35 +08:00
navigator: don't allow Land together with RTL item
This is a check to protect a user from upload a mission which includes a land_start marker as well as a RTL mission item. This works around the problem that we experienced where the navigator would switch to mission mode on RTL and start with land_start, and then continue to the RTL item. At this point, navigator would send the vehicle_command for RTL to commander which would deny it because it is already in RTL mode. Thus navigator won't (re)set any items to actually do RTL and it means the vehicle will just head to whatever setpoint it received last.
This commit is contained in:
@@ -505,6 +505,13 @@ MissionFeasibilityChecker::checkFixedWingLanding(const mission_s &mission, bool
|
||||
mavlink_log_critical(_navigator->get_mavlink_log_pub(), "Mission rejected: starts with land waypoint.");
|
||||
return false;
|
||||
}
|
||||
|
||||
} else if (missionitem.nav_cmd == NAV_CMD_RETURN_TO_LAUNCH) {
|
||||
if (land_start_found && do_land_start_index < i) {
|
||||
mavlink_log_critical(_navigator->get_mavlink_log_pub(),
|
||||
"Mission rejected: land start item before RTL item not possible.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user