mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-12 12:23:33 +08:00
feat(navigator): Mission feasibility check: do not require takeoff waypoint when in-air
Signed-off-by: Silvan <silvan@auterion.com>
This commit is contained in:
@@ -540,7 +540,7 @@ bool FeasibilityChecker::checkTakeoffLandAvailable()
|
||||
break;
|
||||
|
||||
case 1:
|
||||
result = _has_takeoff;
|
||||
result = _has_takeoff || !_is_landed;
|
||||
|
||||
if (!result) {
|
||||
mavlink_log_critical(_mavlink_log_pub, "Mission rejected: Takeoff waypoint required.\t");
|
||||
@@ -563,7 +563,7 @@ bool FeasibilityChecker::checkTakeoffLandAvailable()
|
||||
break;
|
||||
|
||||
case 3:
|
||||
result = _has_takeoff && _landing_valid;
|
||||
result = (_has_takeoff || !_is_landed) && _landing_valid;
|
||||
|
||||
if (!result) {
|
||||
mavlink_log_critical(_mavlink_log_pub, "Mission rejected: Takeoff or Landing item missing.\t");
|
||||
@@ -574,7 +574,18 @@ bool FeasibilityChecker::checkTakeoffLandAvailable()
|
||||
break;
|
||||
|
||||
case 4:
|
||||
result = hasMissionBothOrNeitherTakeoffAndLanding();
|
||||
if (_is_landed) {
|
||||
result = hasMissionBothOrNeitherTakeoffAndLanding();
|
||||
|
||||
} else {
|
||||
result = _landing_valid;
|
||||
|
||||
if (!result) {
|
||||
mavlink_log_critical(_mavlink_log_pub, "Mission rejected: Landing waypoint/pattern required.");
|
||||
events::send(events::ID("feasibility_mis_type_4_in_air"), {events::Log::Error, events::LogInternal::Info},
|
||||
"Mission rejected: Landing waypoint/pattern required");
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ PARAM_DEFINE_FLOAT(MIS_TAKEOFF_ALT, 2.5f);
|
||||
*
|
||||
* Specifies if a mission has to contain a takeoff and/or mission landing.
|
||||
* Validity of configured takeoffs/landings is checked independently of the setting here.
|
||||
* Takeoff requirement is dropped when in-air.
|
||||
*
|
||||
* @value 0 No requirements
|
||||
* @value 1 Require a takeoff
|
||||
|
||||
Reference in New Issue
Block a user