Skip to content

Commit

Permalink
navigator: don't allow Land together with RTL item
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
julianoes committed Dec 16, 2019
1 parent 660ad5e commit 29fed02
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/modules/navigator/mission_feasibility_checker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit 29fed02

Please sign in to comment.