Mavlink: round battery percentage up instead of down #8986
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I propse this change because of a user experience issue I found even myself running into almost every time: I set the low battery reaction to e.g. 15% in QGC through the parameter menu, test it while flying around looking at the battery percentage and when the percentage in QGC shows 15% I expect something to happen but it doesn't. It happens when QGC shows 14%.
Because:
It's mathematically all resonable but still not intuitive to the user like me or @potaito and I'm sure we're not alone. We expect the reaction to happen when the percentage is reached in terms of the integer we can see in the UI.
I think we need to fix the user experience no matter how it's done technically. We could als trigger the reaction with the rounded up number or similar. It just ssemed to me that the root cause is the rounding during conversion to MAVLink and that's why rounding up instead of down exactly where it happens is the go to solution.
FYI @Stifael