-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
Conversation
…landing when RTL is triggered Signed-off-by: RomanBapst <bapstroman@gmail.com>
@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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dagar exactly
The feasibility checker is probably where we want to lock down the mission landing sequence requirement. |
@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. |
@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. |
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. |
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 |
Correct. |
|
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). 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. |
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:
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.
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