mirror of https://github.com/ArduPilot/ardupilot
use Qplane option to allow autoland and fix auto-flaps
This commit is contained in:
parent
00fa1c4f35
commit
c08af5ba19
|
@ -689,8 +689,6 @@ void Plane::update_flight_stage(void)
|
||||||
// This prevents TECS from being stuck in the wrong stage if you switch from
|
// 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.
|
// AUTO to, say, FBWB during a landing, an aborted landing or takeoff.
|
||||||
set_flight_stage(AP_FixedWing::FlightStage::NORMAL);
|
set_flight_stage(AP_FixedWing::FlightStage::NORMAL);
|
||||||
} else if (control_mode == &mode_autoland) {
|
|
||||||
set_flight_stage(AP_FixedWing::FlightStage::LAND);
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ ModeAutoLand::ModeAutoLand() :
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ModeAutoLand::_enter()
|
bool ModeAutoLand::_enter()
|
||||||
{
|
{
|
||||||
//must be flying to enter
|
//must be flying to enter
|
||||||
if (!plane.is_flying()) {
|
if (!plane.is_flying()) {
|
||||||
gcs().send_text(MAV_SEVERITY_WARNING, "Must already be 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
|
//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 HAL_QUADPLANE_ENABLED
|
||||||
if (quadplane.available()) {
|
if (quadplane.available() && !quadplane.option_is_set(QuadPlane::OPTION::ALLOW_FW_LAND)) {
|
||||||
gcs().send_text(MAV_SEVERITY_WARNING, "AutoLand is fixed wing only mode");
|
gcs().send_text(MAV_SEVERITY_WARNING, "Option not set to allow fixed wing autoland");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -105,6 +105,7 @@ void ModeAutoLand::navigate()
|
||||||
plane.prev_WP_loc = plane.current_loc;
|
plane.prev_WP_loc = plane.current_loc;
|
||||||
plane.next_WP_loc = home_loc;
|
plane.next_WP_loc = home_loc;
|
||||||
plane.start_command(cmd);
|
plane.start_command(cmd);
|
||||||
|
plane.set_flight_stage(AP_FixedWing::FlightStage::LAND);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
//otherwise keep flying the current command
|
//otherwise keep flying the current command
|
||||||
|
|
|
@ -62,6 +62,7 @@ public:
|
||||||
friend class ModeQAutotune;
|
friend class ModeQAutotune;
|
||||||
friend class ModeQAcro;
|
friend class ModeQAcro;
|
||||||
friend class ModeLoiterAltQLand;
|
friend class ModeLoiterAltQLand;
|
||||||
|
friend class ModeAutoLand;
|
||||||
|
|
||||||
QuadPlane(AP_AHRS &_ahrs);
|
QuadPlane(AP_AHRS &_ahrs);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue