Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plane:mode AUTOLAND enhancements #28976

Merged
merged 3 commits into from
Jan 21, 2025

Conversation

Hwurzburg
Copy link
Collaborator

@Hwurzburg Hwurzburg commented Dec 31, 2024

This PR enhances the new AUTOLAND mode. It adds the following new features:

  1. Allows takeoff direction capture, and hence autoland direction and use, in ACRO, STABILIZE, FBWA, TRAINING, and MANUAL modes, in addition to Mode TAKEOFF and AUTO NAV_TAKEOFF, using the same criteria as currently used, the first time after arming.

  2. Adds an AUTOLAND_OPTIONS option that will set this direction upon arming using a compass, if in use, instead of ground course, allowing the user to set it on the ground arbitrarily as desired, independent of the actual takeoff direction. The option is in the autoland module for future expansion

  3. the "base" leg is actually a WP_LOITER_RAD loiter to alt with tangent exit directly into the final approach waypoint and landing with proper loiter direction.

image

changes to current behavior, besides the new features, is that once the direction is captured it persists until a disarm occurs. Therefore multiple auto takeoffs while armed no longer reset the direction captured by the first, on each subsequent takeoff. Originally, I thought this behavior was desirable, but I now believe it's not of much benefit and the new behavior avoids the current corner case issue of resetting the direction while in flight if a NAV_TAKEOFF autotakeoff is interrupted and then resumed. Also, this is not available for QudPlanes, even if fixed wing landing option is used. We thought the possibility of getting the direction inappropriately wrong on transitions from a VTOL takeoff just too complex to get correct.

In addition, it removes the AUTOLAND code segments in the commands_logic and mode_takeoff modules, reducing the flash impact overall...

These changes have been tested in SITL and flight-tested in all configurations I could think of.

@Hwurzburg Hwurzburg requested review from IamPete1 and tridge December 31, 2024 22:00
@Hwurzburg Hwurzburg added the WikiNeeded needs wiki update label Dec 31, 2024
@Hwurzburg Hwurzburg force-pushed the autoland_improvements_mk2 branch 2 times, most recently from 0cc3cd5 to 3c10149 Compare January 1, 2025 15:03
ArduPlane/AP_Arming.cpp Outdated Show resolved Hide resolved
ArduPlane/Plane.cpp Outdated Show resolved Hide resolved
ArduPlane/mode_autoland.cpp Show resolved Hide resolved
libraries/AP_Vehicle/AP_FixedWing.h Outdated Show resolved Hide resolved
@Hwurzburg Hwurzburg force-pushed the autoland_improvements_mk2 branch 2 times, most recently from e462280 to f722212 Compare January 1, 2025 23:30
@Hwurzburg Hwurzburg requested a review from peterbarker January 6, 2025 12:53
ArduPlane/Plane.cpp Outdated Show resolved Hide resolved
ArduPlane/Plane.cpp Outdated Show resolved Hide resolved
ArduPlane/AP_Arming.cpp Outdated Show resolved Hide resolved
ArduPlane/Plane.cpp Outdated Show resolved Hide resolved
@Hwurzburg Hwurzburg force-pushed the autoland_improvements_mk2 branch from f722212 to 63417b3 Compare January 6, 2025 21:48
@Hwurzburg Hwurzburg force-pushed the autoland_improvements_mk2 branch 3 times, most recently from 2332cc5 to a6b0ebc Compare January 8, 2025 18:54
@Hwurzburg
Copy link
Collaborator Author

Hwurzburg commented Jan 8, 2025

Added loiter to alt with direct exit to landing final and moved option to AUTOLAND module...

@Hwurzburg Hwurzburg force-pushed the autoland_improvements_mk2 branch 3 times, most recently from c5189fe to a5deff0 Compare January 11, 2025 02:09
@Hwurzburg Hwurzburg requested a review from IamPete1 January 11, 2025 02:09
@Hwurzburg Hwurzburg force-pushed the autoland_improvements_mk2 branch 3 times, most recently from d58ca00 to ceff3d0 Compare January 11, 2025 13:19
@tridge tridge force-pushed the autoland_improvements_mk2 branch 4 times, most recently from 8df7550 to a3e5475 Compare January 12, 2025 02:15
@Hwurzburg Hwurzburg force-pushed the autoland_improvements_mk2 branch from 4d31767 to 7830bc9 Compare January 12, 2025 14:25
ArduPlane/mode_autoland.cpp Outdated Show resolved Hide resolved
ArduPlane/mode_autoland.cpp Outdated Show resolved Hide resolved
ArduPlane/mode_autoland.cpp Outdated Show resolved Hide resolved
ArduPlane/mode_autoland.cpp Outdated Show resolved Hide resolved
ArduPlane/mode_autoland.cpp Outdated Show resolved Hide resolved
ArduPlane/mode_autoland.cpp Outdated Show resolved Hide resolved
@Hwurzburg Hwurzburg force-pushed the autoland_improvements_mk2 branch from 7830bc9 to cddeb74 Compare January 13, 2025 20:40
@IamPete1
Copy link
Member

IamPete1 commented Jan 14, 2025

@Hwurzburg @tridge I have done a PR to address the issues with loiter radius scaling, it does get quite bad at higher altitudes.

Hwurzburg#5

In that messing about I have found two other issues. The first is pre-existing and that is what happens if you have LAND_TYPE set to deep stall rather than glide slope. I guess no one has tested? Maybe it is not too bad, but we should either test it or refuse mode entry if the not glide slope. I'm not sure the base entry setup thing makes any sense for it in any case. The other issue is that this re-uses some functions from missions, for example this uses plane.start_command to run the waypoints. This is a issue because of this:

AP_Mission::Mission_Command next_nav_cmd;
const uint16_t next_index = mission.get_current_nav_index() + 1;
const bool have_next_cmd = mission.get_next_nav_cmd(next_index, next_nav_cmd);
auto_state.wp_is_land_approach = have_next_cmd && (next_nav_cmd.id == MAV_CMD_NAV_LAND);
#if HAL_QUADPLANE_ENABLED
if (have_next_cmd && quadplane.is_vtol_land(next_nav_cmd.id)) {
auto_state.wp_is_land_approach = false;
}
#endif

Its looking in the mission at what the next command is, of course here were not in the mission so that will be nonsense. Maybe it would be enough to warp a check that were in auto for that bit. In the longer term it would be nice to rework more comprehensively so both mission and this could use a common base method.

@Hwurzburg Hwurzburg force-pushed the autoland_improvements_mk2 branch from cddeb74 to 61edf4f Compare January 15, 2025 22:01
@Hwurzburg
Copy link
Collaborator Author

Added all of Pete Hall's changes to cope with high altitude

Co-authored-by: Andrew Tridgell <andrew@tridgell.net>
Co-authored-by: Pete Hall <iampete@hotmail.co.uk>
Co-authored-by: Andrew Tridgell <andrew@tridgell.net>
Co-authored-by: Pete Hall <iampete@hotmail.co.uk>
Co-authored-by: Andrew Tridgell <andrew@tridgell.net>
Co-authored-by: Pete Hall <iampete@hotmail.co.uk>
@tridge tridge merged commit d59b5a5 into ArduPilot:master Jan 21, 2025
99 checks passed
@Hwurzburg Hwurzburg deleted the autoland_improvements_mk2 branch January 21, 2025 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WikiNeeded needs wiki update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants