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

WIP: Use loiter to alt & vtol land for RTL #12464

Closed
wants to merge 1 commit into from
Closed

Conversation

RomanBapst
Copy link
Contributor

@RomanBapst RomanBapst commented Jul 11, 2019

I wanted to find out what changes are required in order to improve the RTL behavior for VTOL.
A similar approach is already implemented for fixed wing where the vehicle will execute a planned mission landing during RTL if it's available.

In this issue we are already discussing a new approach for back-transition approach where we loiter to transition altitude at a planned location and exit the loiter on the tangent to the landing point.

I now connected both ideas such that RTL will make the vehicle fly to the loiter point, loiter to altitude and then transition in a predictable manner toward the landing point.

Currently, in order to do this you need to do the following steps:

  1. Plan a mission that at least contains a LOITER_TO_ALT waypoint followed by a VTOL_TRANSITION_AND_LAND waypoint. For the loiter waypoint make sure to set "Heading wait" to true and "Exit loiter from" to tangent.
    Set the altitude of the loiter waypoint to the desired transition altitude.

  2. Set RTL_TYPE to "Return to a planned mission landing, if available, via direct path, else return to home via direct path"

The following log shows the results from a real flight. Notice that we executed the transition at 20m which is much lower than most of the trees around the field. But it was not a problem as this approach makes the maneuver very predictable.
https://logs.px4.io/plot_app?log=6d36fc4a-a195-4666-a667-1f05289a9712

image

…landing

when RTL is triggered

Signed-off-by: RomanBapst <bapstroman@gmail.com>
@RomanBapst
Copy link
Contributor Author

@dagar Let's discuss how we want to move from here.

/* not supposed to happen unless the datamanager can't access the SD card, etc. */
PX4_ERR("dataman read failure");

} else if (missionitem.nav_cmd == NAV_CMD_LOITER_TO_ALT) {
Copy link
Member

Choose a reason for hiding this comment

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

Is this intended to be temporary until QGC complex mission item handling for VTOL land is in place?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dagar exactly

@dagar
Copy link
Member

dagar commented Jul 11, 2019

The feasibility checker is probably where we want to lock down the mission landing sequence requirement.

@Antiheavy
Copy link
Contributor

@RomanBapst one step you forgot is the requirement for a Do_Land_Start at the beginning of the landing sequence.

A new function could be added to QGC (or similar) can generate a VTOL Landing Pattern similar to the current Fixed Wing Landing Pattern. Feasibility checker can be expanded to check for correct sequence of mission items following the Do_Land_Start, similar to the fixed wing landing pattern checker that runs when RTL_TYPE = 1 is selected.

Different flavors of this issue for VTOL landings have come up many times in the past, I think the approach you've described is the correct one.

@RomanBapst
Copy link
Contributor Author

@Antiheavy Thanks for your inputs! I was aware of the Do_Land_Start for fixed wing but I kind of did not know for what reason I should use it for VTOL. Is it just a placeholder to let the navigator know that there is a landing sequence?

@dagar
Copy link
Member

dagar commented Jul 13, 2019

@Antiheavy Thanks for your inputs! I was aware of the Do_Land_Start for fixed wing but I kind of did not know for what reason I should use it for VTOL. Is it just a placeholder to let the navigator know that there is a landing sequence?

Yes it's a marker of the landing sequence, that's currently Landing = DO_LAND_START + LOITER_TO_ALT + LAND, but it could be anything (including VTOL_LAND).

Through the combination of RTL type = planned mission landing, the feasibility checker (requiring a valid landing sequence), and requiring commander to have a valid mission to arm we can close most of the holes for safe tablet only operation.

The only missing piece that still comes to mind is the mavlink mission sync that replaces the mission before verifying feasibility, which means you could potentially lose the landing landing sequence midflight.

@Antiheavy
Copy link
Contributor

The only missing piece that still comes to mind is the mavlink mission sync that replaces the mission before verifying feasibility, which means you could potentially lose the landing landing sequence midflight.

This is a major architectural flaw in PX4. I've been meaning to make a proper issue post about this for a long time... different topic though.

@Antiheavy
Copy link
Contributor

@Antiheavy Thanks for your inputs! I was aware of the Do_Land_Start for fixed wing but I kind of did not know for what reason I should use it for VTOL. Is it just a placeholder to let the navigator know that there is a landing sequence?

I was under the impression a DO_LAND_START is required for RTL_TYPE=1 to work.

maybe use this as a reference: https://github.com/PX4/Firmware/blob/7c8fa82e76cefc525deae23ecbc14dded91be29a/src/modules/navigator/mission_feasibility_checker.cpp#L409

@dagar
Copy link
Member

dagar commented Jul 13, 2019

I was under the impression a DO_LAND_START is required for RTL_TYPE=1 to work.

Correct.

@dagar
Copy link
Member

dagar commented Jul 13, 2019

This is a major architectural flaw in PX4. I've been meaning to make a proper issue post about this for a long time... different topic though.

#12473

@sfuhrer
Copy link
Contributor

sfuhrer commented Aug 14, 2019

The same effect as was the aim of this PR can also be achieved by planning a loiter to altitude before the back transition and setting a DO_LAND_START marker before that. If the parameter RTL_TYPE is in this case set to 1 (return to a planned mission landing), then during a RTL, the vehicle will do the normal mission landing, including a loiter to alt.

Further, the Fixed-wing landing pattern (which generates a DO_LAND_START + LOITER_TO_ALT + LAND) also works for VTOL (SITL tested). With that, the mission automatically includes a loiter to alt and DO_LAND_START marker, thus having also a RTL behavior (see below a VTOL mission with a fixed-wing landing pattern, where the RTL was triggered).

image

The fixed-wing landing pattern in QGC has a few options not aplicable to VTOLs (eg gliding slope), but otherwise no big changes would be necessary to also make a VTOL-landing pattern.

Let's test the FW landing pattern for now also for real VTOL missions, and see if it really works well or something entirely new is necessary.

@RomanBapst
Copy link
Contributor Author

@sfuhrer @dagar I think this can be closed as we figured out that the same landing logic used for fixed wings works perfectly fine for fixed wings.
We need to expose it on the QGC side though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants