Plane: update based on PR feedback

This commit is contained in:
Zach Flathers 2023-06-17 11:29:20 -07:00 committed by Tom Pittenger
parent 6177cbbfe2
commit b35b94f553
2 changed files with 7 additions and 13 deletions

View File

@ -39,10 +39,10 @@ AP_Vehicle& vehicle = plane;
bool Plane::is_landing() const
{
#if HAL_QUADPLANE_ENABLED
return plane.quadplane.in_vtol_land_descent();
#endif // HAL_QUADPLANE_ENABLED
if (plane.quadplane.in_vtol_land_descent()) {
return true;
}
#endif
return control_mode->is_landing();
}
@ -50,13 +50,7 @@ bool Plane::is_landing() const
// returns true if vehicle is taking off. Only used by Lua scripts
bool Plane::is_taking_off() const
{
#if HAL_QUADPLANE_ENABLED
return plane.quadplane.in_vtol_takeoff();
#endif // HAL_QUADPLANE_ENABLED
return control_mode->is_taking_off();
return control_mode->is_taking_off() || (started_flying_ms > 0 && millis() - started_flying_ms < 30000);
}
#endif // AP_SCRIPTING_ENABLED

View File

@ -168,7 +168,7 @@ bool ModeAuto::is_landing() const
case MAV_CMD_DO_VTOL_TRANSITION:
return true;
}
return false;
return plane.mission.get_in_landing_sequence_flag();
}
bool ModeAuto::is_taking_off() const