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

FlightTasks: disable failsafe descend on RC loss #13125

Closed
wants to merge 1 commit into from

Conversation

julianoes
Copy link
Contributor

@julianoes julianoes commented Oct 8, 2019

The problem with returning false and therefore causing a FlightTask failsafe is that it does not follow the configuration that one might set using the commander params.

Specifically if the RC failsafe behaviour is set to "Disabled" (0), then the FlightTasks failsafe causes the drone to descend even though it supposedly should not react at all.

With this change the behaviour is as follows with NAV_RCL_ACT = 0:

  • POSCLT: stays in POSCTL but with all sticks 0, so it stays still.
  • ALTCTL: stays in ALTCTL but with all sticks 0, so it stays horizontal and keeps altitude.
  • MANUAL: stays in MANUAL but with all sticks 0, so it stays horizontal but throttle will be half-way which either leads to a descent or fly away. This case is clearly not optimal.
    Alternatives could be:
    1. 0 throttle, basically drop from the sky
    2. hover throttle
    3. automatic switch to either DESCEND or ALTCTL
    4. Remove the DISABLED option because it doesn't make any sense. It does make sense for non-manual modes.

Tested in SITL only so far.

Fixes #12307.

The problem with returning false and therefore causing a FlightTask
failsafe is that it does not follow the configuration that one might set
using the commander params.

Specifically if the RC failsafe behaviour is set to "Disabled" (0), then
the FlightTasks failsafe causes the drone to descend even though it
supposedly should not react at all.

With this change the behaviour is as follows with NAV_RCL_ACT = 0:
- POSCLT: stays in POSCTL but with all sticks 0, so it stays still.
- ALTCTL: stays in ALTCTL but with all sticks 0, so it stays horizontal
  and keeps altitude.
- MANUAL: stays in MANUAL but with all sticks 0, so it stays horizontal
  but throttle will be half-way which either leads to a descent or fly
  away. This case is clearly not optimal.
Copy link
Member

@MaEtUgR MaEtUgR left a comment

Choose a reason for hiding this comment

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

Like I wrote in #12307 (comment) I consider no reaction during manual piloted flight when having RC loss totally unsafe. At least the vehicle needs to stop relying on RC data, that might be reside in arbitrary state depending on the implementation, anymore.

We should not ignore error cases but handle them in the way we want. Let me check if I can come up with a solution that covers the original issue.

@MaEtUgR
Copy link
Member

MaEtUgR commented Oct 8, 2019

How about #13130 ? I'm just handling the failsafe differently. What do you think?

@julianoes
Copy link
Contributor Author

@MaEtUgR this seems to work fine for POSCTL and ALTCTL but for MANUAL it just keeps going in the last direction while (in my case) descending.

@MaEtUgR
Copy link
Member

MaEtUgR commented Oct 9, 2019

Well since #10805 stabilized mode is back to the attitude control module which makes sense in terms of not needing the position controller to fly manual and having a lower level independent fallback but also means it doesn't go through the same processing pipeline. As a result neither my nor your pr change anything there. I am not exactly sure yet what you would expect in the case of flying in manual mode, RC getting lost and the state machine not doing anything. There should be an emergency emergency failsafe where the controller does the best thing it can do. That was never the case before and I planned to roll over the attitude and rate controller to improve these cases, it was just not a priority.

Can we do this in steps, first merge the solution for position and altitude mode and I try to find good handling in attitude control?

@julianoes
Copy link
Contributor Author

Ok, I understand but the confusing part is that MANUAL seemed to work with my fix. I guess I need to try it again. Maybe it's some race condition that makes it work.

@julianoes
Copy link
Contributor Author

@MaEtUgR ok, you're right. My tests were wrong. Also with my/this PR it will just keep going in MANUAL.

@julianoes
Copy link
Contributor Author

While this fix alleviates the problem where a vehicle lands when it should keep hovering, it adds the scary case where flying STABILIZED/MANUAL can lead to a hard landing or a fly-away.
Therefore, it makes more sense to fix this properly in the commander failsafe state machine as @MaEtUgR suggested. However, this failsafe state machine change will have to follow later, once proper tests for it are in place.

@julianoes julianoes closed this Oct 14, 2019
@julianoes julianoes deleted the fix-rclact-disabled branch October 14, 2019 13:00
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.

RC loss behavior
2 participants