-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Multicopter land detector - Add robustifying condition #11167
Conversation
As you are currently in the land detector with #11172 can you check this PR as well? Thanks |
tested on pixhawk4 mini v5 pixhawk v4 pro pixhawk race v4 |
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.
I totally see how this can make sense, still I'm constantly thinking about how it can be simplified or what is broken such that it's needed.
It's basically introducing different conditions to fall out of the landed state compared to switching into it. In detection you require the estimated speeds to be within thresholds to fall out only the thrust.
Do we generally need that? Can we structure the code simpler to make these cases clear?
Your thorough description of how you found out with I sometimes see the problem in jMAVSim and I'd even have a possible fix but I want to be able to test that it's fixed for sure but can't reproduce the problem all the time. |
@bresch I like this change.
I guess you meant "When landed was detected and the thrust is low, then the drone has to be on ground". That is also what you have implemented here |
427264c
to
14d3288
Compare
@MaEtUgR I moved the condition to |
14d3288
to
4415edf
Compare
@MaEtUgR Can we merge that? @RomanBapst Tested it and it seems to reject bad velocity estimates that would trigger a takeoff detection. |
Can you please rebase so that CI is re-run? |
I can accept it because it's not wrong. I'm only hesitant because it could cover up other fundamental issues that have more impact when we have to discover them in a different way. For example:
I think both might go unnoticed and would later cause other unexpected symptoms. |
…hrottle is low to avoid detecting takeoff due to measurement and estimation inaccuracies
4415edf
to
a744338
Compare
There's a new example: #11331 (comment) |
In those cases, freefall detection (that works really well) saves you from falling like a stone. Remember that the freefall detection has the highest priority. |
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.
We can try.
- As I mentioned it's not wrong and has the big advantage that there's no way the vehicle kicks out of the landed state while no takeoff action happens e.g. when someone knocks the drone over while it's armed on the ground and estimates overshoot it will not suddenly try to go into hover.
- We should just be aware of a certain risk because falling out of a false positive landed state in air is not given anymore.
- Also it might cover some existing or upcoming problems with the takeoff.
The problem @bresch described in the description was solved by #11206. I see it like the case this pr helps is when you arm the drone, want to let it sit there in idle and it takes off prematurely because it gets moved hard enough. But the logic is this way to prevent a crash when false detecting a landing in air. So I'm concerned about a case the drone detects landing to the last stage in air and doesn't get out anymore because the position controller is holding the thrust low thinking it's landed. |
I will close this PR since it's not really needed yet. If we discover that we have some false positive takeoff detections, we can still reopen it or discuss about an other solution. |
Description
This shortcut comes from the fact that "When landed and that the thrust is low, the drone has to be on the ground"
This also fixes a bug in jMavSim where the takeoff delay parameter
MPC_IDLE_TKO
was ignored due to false takeoff detection.False takeoff detection also occurs in real life when the baro and/or GPS wrongly drive the velocity estimate to a value above the detection threshold.
SITL tests
Manual position control
Before:
As soon as the vehicle is armed, takeoff is detected
After:
Even the large vz estimate error, takeoff is only detected when the throttle is high enough.
Mission
Before:
Note that the delay between idle (actuator outputs at 900ms [0.9 on the graph]) and takeoff is ignored. We don't even see the actuators going to 900ms.
After:
Note the delay of 3 seconds between idle and takeoff. The actuator output first goes to 0.9 (900ms) during those 3 seconds defined by
MPC_IDLE_TKO
.