fix(Joystick): match actual update rate to joystick setting - #14797
fix(Joystick): match actual update rate to joystick setting#14797bosism wants to merge 1 commit into
Conversation
|
Thanks for your first pull request! 🎉 A maintainer will review this soon. Please ensure:
We appreciate your contribution to QGroundControl! |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #14797 +/- ##
==========================================
+ Coverage 25.47% 32.73% +7.26%
==========================================
Files 769 784 +15
Lines 65912 67635 +1723
Branches 30495 31330 +835
==========================================
+ Hits 16788 22141 +5353
+ Misses 37285 30589 -6696
- Partials 11839 14905 +3066
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 475 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Build ResultsPlatform Status
All builds passed. Pre-commit
Pre-commit hooks: 0 passed, 0 failed, 0 skipped. Test Resultslinux-coverage-integration: 37 passed, 0 skipped Code CoverageCoverage: 69.5% No baseline available for comparison Artifact Sizes
Updated: 2026-08-09 15:48:28 UTC • Commit: 0c25e13 • Triggered by: MacOS |
Bug Description
The joystick's actual axis update rate can be lower than the value configured in Axis frequency. With the default 25 Hz setting, the configured interval is 40 ms, but an update at exactly 40 ms was rejected.
Root Cause
The polling thread checks joystick state approximately every 20 ms.
_handleAxis()returned while the elapsed time was less than or equal to the configured interval. A poll at exactly 40 ms was therefore skipped and the update could be delayed until the next poll, around 60 ms.Solution
Treat the configured interval as inclusive: an axis update is due when
elapsed >= delay. A deterministic regression test covers the boundary at 39, 40, and 41 ms.Testing
Validation performed:
BluetoothWorkerTestfails because the host BlueZ backend emits an unexpected warning for the test's invalid Bluetooth address; the failure reproduces when that test is run alone.Platforms Tested
Flight Stacks Tested
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the project's dual license (Apache 2.0 and GPL v3).