-
Notifications
You must be signed in to change notification settings - Fork 16.8k
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: Prevent failsafe from returning to DO_LAND_START if already past #13065
Plane: Prevent failsafe from returning to DO_LAND_START if already past #13065
Conversation
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.
Unfortunately this doesn't work as presented, you need to actual track when you enter/exit a landing sequence (which as far as I can tell actually means a DO_LAND_STOP
addition). To explain why this is needed it's important to realize that we can plan multiple DO_LAND_START
items in the mission and the aircraft will select the nearest geographic one when you ask it to jump to the landing. This can lead to the aircraft flying items after one of the planned landing items (as they can be anywhere in the mission, particularly when jumps get involved) and it would not actually be landing.
A simpler example of this is simply consider the case where the landing was planned as the first thing in the mission, you'd never jump to the landing in this case. (This is not a hypothetical I've seen people plan this before).
Your change will also result in the plane always being in a FLIGHT_LAND
stage as soon as the vehicle is beyond the first landing item, I believe.
8d5a576
to
a4528b1
Compare
Having had a chat with @WickedShell I understand some of the different ways that users are typically using the DO_LAND_START flag. I would like to discuss it on the dev call to get agreement on the best way forward. |
a4528b1
to
b8dfd73
Compare
b51a712
to
952d69d
Compare
952d69d
to
2fc87f9
Compare
975ced5
to
41e05ba
Compare
2760223
to
fe4c0c7
Compare
b657417
to
8d0da99
Compare
8d0da99
to
f3407b5
Compare
f40386d
to
43bdfe2
Compare
cee81a7
to
2acf691
Compare
An interesting scenario just came up with quadplanes. I was asked by an operator of a large quadplane how they would force the landing sequence to restart if the plane is coming in too high for a landing and it won't have enough battery to safely vertically land. I would normally say to just switch to RTL and the landing sequence would restart, and the plane will go around, losing height. This PR would seem to defeat that. |
Yes, switching to RTL will still work with this PR. This only effects the behaviour when the battery failsafe is first actioned. Therefore, even if the aircraft is in failsafe, changing mode to RTL will ultimatly clear the in_landing_sequence flag and the aircraft will return to the nearest DO_LAND_START marker to attempt another landing. To be sure I have tested this scenario in SITL and I can confirm that setting the mode to RTL will give the behaviour you expect. Another option is for the operator to trigger an abort landing. Again, I have tested this in SITL and it intiates a go around and attempts another landing. |
2acf691
to
3e2f6a1
Compare
3e2f6a1
to
35bf8b3
Compare
White space issues resolved. Ready for merge. |
I didn't review this one, but it was decided it could be merged after @Gone4Dirt 's whitespace fixes. |
This PR is commissioned by DUALRC
This is to fix this issue #12264
Problem:
The aircraft will return to the DO_LAND_START marker when a failsafe initiates an RTL or Land command, despite having already passed the DO_LAND_START flag in the mission. This causes the aircraft to extend its flight time and power drain when a battery failsafe has been triggered. This behaviour is demonstrated in the image below:
This PR fixes the problem by setting the flight state to FLIGHT_LAND once the DO_LAND_START flag has been passed. The resulting behaviour is illustrated below:
Testing
This has been tested in SITL/Real Flight 8 for both land and RTL failsafe actions. Quadplanes and regular fixed wings have been tested. It has also been tested with multiple DO_LAND_START flags as I have heard of some users that do this. In all of the aforementioned cases the aircraft continues along the intended auto mission after the DO_LAND_START as is intended. RTL mode has been initiated from non-auto modes to ensure that the intended behaviour remains unchanged.
I have tried to think of all of the potential Gotchyas with this approach. I am keen to discuss on Devcall as there maybe some subtleties that I have missed.