-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
rc_update: throttle trim centering fix for reverse channel #21682
Conversation
The entire logic did not work for the case when the throttle channel is reversed because then QGC sets trim = max for that channel and the result is only half the throttle range.
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.
Thanks for this cleaned up fix!
const bool normal_case = !throttle_rev && (throttle_trim == throttle_min); | ||
const bool reversed_case = throttle_rev && (throttle_trim == throttle_max); |
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.
These cases are relevant only because of the hotfix in the QGC right? If so, should we note it in the code?
Codewise this is a nice way to wrap up #21576!
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.
Yes, that's written in the comment just above this logic:
https://github.com/PX4/PX4-Autopilot/pull/21682/files#diff-bc65e8936281291b7e9801b185ee1740a6f2d4207e3b539c059469daa6cdfcc9R210-R211
This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there: https://discuss.px4.io/t/px4-maintainers-call-june-06-2023/32473/1 |
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.
Thanks for reviewing! Then I'll merge when everything passes.
const bool normal_case = !throttle_rev && (throttle_trim == throttle_min); | ||
const bool reversed_case = throttle_rev && (throttle_trim == throttle_max); |
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.
Yes, that's written in the comment just above this logic:
https://github.com/PX4/PX4-Autopilot/pull/21682/files#diff-bc65e8936281291b7e9801b185ee1740a6f2d4207e3b539c059469daa6cdfcc9R210-R211
Needs to also go on 1.14 👀 |
This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there: https://discuss.px4.io/t/driving-backwards-with-a-boat-rover-in-manual-mode/25714/9 |
Solved Problem
When integrating an airframe I found that if the throttle channel is reversed the logic that corrects for QGC calibrating the throttle to half the range (see #15949 (comment))
Solution
Changelog Entry
For release notes:
Alternatives
This can be removed again once the calibration in QGC is revised and available in a stable release for long enough.
Test coverage