fix(Joystick): fix 0-to-MAX trigger axis calibration and UI preview - #15032
fix(Joystick): fix 0-to-MAX trigger axis calibration and UI preview#15032M4rkoHR wants to merge 1 commit into
Conversation
- Lower movement delta thresholds during Joystick mode so half-axis (0-to-MAX) triggers auto-detect. - Update _validateAndAdjustCalibrationValues to prevent resetting valid trigger spans that do not cross 0. - Stretch half-axis values in _adjustChannelRawValue to display full -MAX to +MAX travel in the QML Attitude Controls preview.
|
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
❌ Your patch check has failed because the patch coverage (3.33%) is below the target coverage (30.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #15032 +/- ##
==========================================
+ Coverage 25.47% 34.52% +9.05%
==========================================
Files 769 945 +176
Lines 65912 85676 +19764
Branches 30495 39492 +8997
==========================================
+ Hits 16788 29583 +12795
+ Misses 37285 36440 -845
- Partials 11839 19653 +7814
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 662 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: 2 passed, 76 failed, 7 skipped. Test Resultslinux-coverage-integration: 52 passed, 0 skipped Code CoverageCoverage: 70.6% No baseline available for comparison Artifact Sizes
Updated: 2026-09-03 09:18:52 UTC • Commit: f31d2da • Triggered by: Linux |
Description
When calibrating a gamepad trigger or other half-axis control (which physically outputs
0to32767rather than-32768to32767) mapped to a primary attitude control like Throttle, the calibration workflow previously suffered from three key issues:0or16383failed to trigger automatic stick movement detection during_inputStickDetectand_inputStickMinbecause the logic required crossing a hardcoded negative center threshold (0). Users were forced to manually click the "Next" button to proceed._validateAndAdjustCalibrationValues()reset any non-extension channel whosechannelMindid not cross a negative lower bound (_calValidMinValue). This wiped valid trigger calibrations back to default-32768bounds.-32768to32767range, applying non-negative trigger inputs against default bounds caused the preview dot to sit at the middle (0) at rest and only move through the upper half of the display.Changes Made:
_inputStickDetect&_inputStickMin: Lowered the movement delta requirement in Joystick mode to8000and updated the_inputStickMincheck to compare movement relative to the captured center value rather than hardcoded0._validateAndAdjustCalibrationValues: Added avalidSpancheck (channelMax - channelMin > 10000) so valid half-axis calibrations are retained rather than reset to defaults, and automatically setschannelTrimto the true midpoint when a trigger edge-resting trim is detected._adjustChannelRawValue: Added linear range normalization in Joystick mode to scale physical0 -> 32767inputs across the full-32768 -> 32767range for proper QML Attitude Controls preview rendering.Type of Change
Testing
Platforms Tested
Flight Stacks Tested
Screenshots
Throttle at minimum (channel 5):

Throttle at maximum:

Checklist
Related Issues
#11017
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).