-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[NAV] Restrict MC RoC/RoD rate-limiting to the case where we actually accelerate #4245
Conversation
// if we are decelerating - don't limit (allow better recovery from falling) | ||
if (fabsf(targetVel) > fabsf(posControl.desiredState.vel.z)) { | ||
const bool isSameDirection = (targetVel > 0 && posControl.desiredState.vel.z > 0) || (targetVel < 0 && posControl.desiredState.vel.z < 0); |
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.
What do you think about using signbit here?
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.
signbit will be less practical since it returns zero for both "0" and positive numbers.
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.
@digitalentity If your confident that the patch will do the job.
I'm willing to give it a test, before 2.1 is released. Just to be sure.
Target - Omnibus F4 Pro
@kardon18 here you are |
Thanks Konstantin :) Thank you once again |
This fix doesn't actually "fix" the issue - that would be impossible without rethinking the "takeoff" procedure. This fix merely minimizes the effect of the bug. Not perfect, but much safer than before. Throttle increase is expected - target RTH altitude is higher than current altitude and quad needs to build up climb rate to reach it. It also needs to compensate for that drop in throttle. |
Thanks for testing. I'm going to merge this now. |
Fixes #4240