use Qplane option to allow autoland and fix auto-flaps

This commit is contained in:
Henry Wurzburg 2024-12-21 06:49:01 -06:00
parent 00fa1c4f35
commit c08af5ba19
3 changed files with 5 additions and 5 deletions

View File

@ -689,8 +689,6 @@ void Plane::update_flight_stage(void)
// This prevents TECS from being stuck in the wrong stage if you switch from
// AUTO to, say, FBWB during a landing, an aborted landing or takeoff.
set_flight_stage(AP_FixedWing::FlightStage::NORMAL);
} else if (control_mode == &mode_autoland) {
set_flight_stage(AP_FixedWing::FlightStage::LAND);
}
return;
}

View File

@ -43,7 +43,7 @@ ModeAutoLand::ModeAutoLand() :
}
bool ModeAutoLand::_enter()
{
{
//must be flying to enter
if (!plane.is_flying()) {
gcs().send_text(MAV_SEVERITY_WARNING, "Must already be flying!");
@ -52,8 +52,8 @@ bool ModeAutoLand::_enter()
//takeoff direction must be set and must not be a quadplane, otherwise since flying switch to RTL so this can be used as FS action
#if HAL_QUADPLANE_ENABLED
if (quadplane.available()) {
gcs().send_text(MAV_SEVERITY_WARNING, "AutoLand is fixed wing only mode");
if (quadplane.available() && !quadplane.option_is_set(QuadPlane::OPTION::ALLOW_FW_LAND)) {
gcs().send_text(MAV_SEVERITY_WARNING, "Option not set to allow fixed wing autoland");
return false;
}
#endif
@ -105,6 +105,7 @@ void ModeAutoLand::navigate()
plane.prev_WP_loc = plane.current_loc;
plane.next_WP_loc = home_loc;
plane.start_command(cmd);
plane.set_flight_stage(AP_FixedWing::FlightStage::LAND);
}
return;
//otherwise keep flying the current command

View File

@ -62,6 +62,7 @@ public:
friend class ModeQAutotune;
friend class ModeQAcro;
friend class ModeLoiterAltQLand;
friend class ModeAutoLand;
QuadPlane(AP_AHRS &_ahrs);