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: add Autoland mode #28771

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

Hwurzburg
Copy link
Collaborator

@Hwurzburg Hwurzburg commented Nov 29, 2024

Captures ground course when gnd speed reaches 5m/s as takeoff direction in NAV_TAKEOFF and Mode Takeoff (if a reliable way to obtain a takeoff direction in other modes is determined, this can be expanded in the future)

Currently valid only for fixed wing configuration, quadplane wont enter mode...

Upon entry creates a final approach waypoint at parameterized distance and alt from home in the opposite direction of autotakeoff direction, flies to it and does a land exactly like NAV_LAND using full landing code for aborts. (Emulates my UniversalAutoLand LUA script #28591)

If a DO_LAND_START sequence(s) exist, will jump to them instead

If takeoff direction has not been captured then it will just not enter the mode

If not flying it will not enter the mode

Adds it as a long failsafe action (will RTL if no takeoff direction has been captured)...qplane ignores it

Includes an autotest

edit: can now be used in QPlane if fw landing option bit set and is a build option, added landing direction offset parameter for when you want the landing to be different direction than takeoff

PS: once merged I have a PR to add a mode param to allow the direction to be set on arm if a compass is in use instead of autotakeoffs, or to allow setting takeoff direction in FBWA/MANUAL/STABILIZE takeoffs in addition to autotakeoffs

Copy link
Contributor

@timtuxworth timtuxworth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this idea - some suggestions.

ArduPlane/mode_autoland.cpp Outdated Show resolved Hide resolved
ArduPlane/mode_autoland.cpp Outdated Show resolved Hide resolved
ArduPlane/mode_autoland.cpp Show resolved Hide resolved
@robustini
Copy link
Contributor

robustini commented Nov 29, 2024

Very interesting, I would instead have a suggestion for a much more solid approach in my opinion, since yours is great for taxiing takeoffs but not for hand launches, which is often not necessarily the direction of the runway.
The automatism I propose requires a very trivial thing in Mission Planner, then Ardupilot on that can do all the reasoning for a land without doing complex missions.
This a simple emergency LAND mission that I often use with some of my fpv planes.
The operation is simple, the automatic manual launch that gives me time to switch to Loiter or force an RTL once the takeoff has happened correctly (so during the LOITER_TIME), gives me time to put on goggles and then switch to other flight modes and proceed.
I also set an alternate home a short distance away because I don't want it to loiter over our heads in an emergency.
In case of failsafe AUTO intervenes, then the plane goes back to the LOITER_TIME event that I had not let it finish and shortly thereafter executes the circuit for LAND.
During that LOITER_TIME if I have the tx out I have time to decide whether to have it continue or maybe intervene in telemetry in some other way, a system that has been tried hundreds of times before.

immagine

Instead, here is what I propose, in my opinion the most logical and hyper simple: if there was the possibility in Ardupilot to fix two points on the runway, to indicate LR of the correct axis would be more than enough to tell Ardupilot to use that line to perform any kind of LAND, so something like this.

immagine

In this very simple approach Ardupilot knows of the runway the direction, the center and the correct length, so he knows that that is the runway in all its useful aspects.
Then 2 coordinates (latitude and longitude for each of the two points) that can be entered perhaps from mission planning or with parameters would suffice.
This simple line would be enough to then do any kind of automated LAND developed for this approach, without perhaps having to resort to complex planning on Mission Planner.
This is an aviation approach already known for planes performing ILS or any other instrumental approaches to the runway, and has been using Micropilot for at least a decade.
These two points are enough to allow AUTOLAND to make no mistake.
Certainly your PR is more immediate but in my opinion less secure in many contexts, of course definitely better that than nothing but supplementing it with this would make it infallible imho.

@Hwurzburg
Copy link
Collaborator Author

Hwurzburg commented Nov 29, 2024

@robustini many people never use MP after initial setup and arent comfortable with mission planning....I never use missions other than autotakeoff/do-land-start/landing sequence with my mission selector app to select land direction for my field based on wind direction....or my UniversalAutoLand lua when travelling to other locations

this is the C++ implementation of my UniversalAutoLand lua script which I use when traveling and just stop at a location and fly...no laptop used..

@Hwurzburg Hwurzburg force-pushed the autoland branch 2 times, most recently from fcf710d to a1b1b13 Compare November 29, 2024 13:38
@timtuxworth
Copy link
Contributor

Should this be disabling fences (autoenabled, and floor) when doing a landing?

@Hwurzburg
Copy link
Collaborator Author

It does a NAV_LAND....so whatever it does or does not

@Hwurzburg Hwurzburg force-pushed the autoland branch 2 times, most recently from b4a7cc2 to e9b36f1 Compare November 30, 2024 15:08
@Hwurzburg Hwurzburg requested a review from tridge November 30, 2024 16:59
@Hwurzburg Hwurzburg force-pushed the autoland branch 8 times, most recently from 60a6dc9 to 64d7e89 Compare December 2, 2024 02:04
Tools/autotest/arduplane.py Outdated Show resolved Hide resolved
Tools/autotest/arduplane.py Outdated Show resolved Hide resolved
ArduPlane/Parameters.h Outdated Show resolved Hide resolved
ArduPlane/mode.h Outdated Show resolved Hide resolved
ArduPlane/events.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 branch 3 times, most recently from dc09056 to 9cba0f3 Compare December 2, 2024 19:05
@Hwurzburg Hwurzburg added the WikiNeeded needs wiki update label Dec 2, 2024
ArduPlane/mode.h Outdated Show resolved Hide resolved
ArduPlane/mode_autoland.cpp Outdated Show resolved Hide resolved
@tridge
Copy link
Contributor

tridge commented Dec 24, 2024

@peterbarker need the bin log of your tests

@peterbarker
Copy link
Contributor

@Hwurzburg
Copy link
Collaborator Author

this looks 100% correct and matches what master would do if that final waypoint and nav_land waypoint were the content of a do_land_start sequence....verified that in master in SITL

Copy link
Member

@IamPete1 IamPete1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New mode needs adding to this array for the available modes message.

Sorry, this was added after you started your PR. I can push a commit for it if you prefer.

@Hwurzburg
Copy link
Collaborator Author

@IamPete1 if you could, it would help...I tried adding it and get an error message that MODE_AUTOLAND_ENABLED is not defined around the addition

@IamPete1
Copy link
Member

@IamPete1 if you could, it would help...I tried adding it and get an error message that MODE_AUTOLAND_ENABLED is not defined around the addition

@Hwurzburg Fix here: https://github.com/IamPete1/ardupilot/tree/autoland I also rebased.

@Hwurzburg
Copy link
Collaborator Author

@IamPete1 fix added...thanks....can you approve now?

Copy link
Member

@IamPete1 IamPete1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@tridge
Copy link
Contributor

tridge commented Dec 26, 2024

I think this needs a base leg of 1/4 of the approach distance, like this:
image
the base leg will keep the aircraft in the part of the field the pilot is flying in, otherwise we end up with a path like the black line above which is what we got with the bixler

@tridge
Copy link
Contributor

tridge commented Dec 27, 2024

@Hwurzburg I've added a base leg to the PR. This is with the base leg:
image

@IamPete1
Copy link
Member

I think this needs a base leg of 1/4 of the approach distance, like this: image the base leg will keep the aircraft in the part of the field the pilot is flying in, otherwise we end up with a path like the black line above which is what we got with the bixler

I don't understand how the shown path related to the red(?) line which I guess was the points this added as it was when it was flown? If it was no where near the set path then how does adding the extra leg help?

@Hwurzburg
Copy link
Collaborator Author

@IamPete1 the base leg addition was to minimize the overshoot of the final approach waypoint by forcing the approach to it to be no more than 90 degs before the turn onto final....otherwise the approach to the final approach waypoint could have been from 180degs to landing direction resulting in larger overshoot and more track error to correct as it lined back up on final leg...
depending on plane config, roll max, and wp-rad you can get a large overshoot otherwise without base leg and Tridge has fences to the south of the landing approach that could breach....adding a base leg minimizes the overshoot amounts which can be further tunedd with wp_rad,max bank, etc.

@trdige SITL looks good....will test fly this weekend

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.

7 participants