Skip to content

Commit

Permalink
navigator: improve if structure for vtol/mc/fw
Browse files Browse the repository at this point in the history
  • Loading branch information
julianoes authored and LorenzMeier committed Dec 23, 2019
1 parent f9aa12e commit 3a37d0b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/modules/navigator/mission_feasibility_checker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,12 @@ MissionFeasibilityChecker::checkMissionFeasible(const mission_s &mission,
failed = failed || !checkGeofence(mission, home_alt, home_valid);
failed = failed || !checkHomePositionAltitude(mission, home_alt, home_alt_valid, warned);

// VTOL always respects rotary wing feasibility
if (_navigator->get_vstatus()->vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROTARY_WING
|| _navigator->get_vstatus()->is_vtol) {
if (_navigator->get_vstatus()->is_vtol) {
failed = failed || !checkRotarywing(mission, home_alt);
failed = failed || !checkFixedwing(mission, home_alt, false);

if (_navigator->get_vstatus()->is_vtol) {
failed = failed || !checkFixedwing(mission, home_alt, false);
}
} else if (_navigator->get_vstatus()->vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROTARY_WING) {
failed = failed || !checkRotarywing(mission, home_alt);

} else {
failed = failed || !checkFixedwing(mission, home_alt, land_start_req);
Expand Down

0 comments on commit 3a37d0b

Please sign in to comment.