Skip to content

fix(GimbalIndicator): prevent angle text jittering in toolbar#14663

Open
DonLakeFlyer wants to merge 1 commit into
mavlink:masterfrom
DonLakeFlyer:fix-gimbal-indicator-jitter
Open

fix(GimbalIndicator): prevent angle text jittering in toolbar#14663
DonLakeFlyer wants to merge 1 commit into
mavlink:masterfrom
DonLakeFlyer:fix-gimbal-indicator-jitter

Conversation

@DonLakeFlyer

Copy link
Copy Markdown
Contributor

Description

Fixes the gimbal toolbar indicator angle text jittering around as telemetry noise changes the values.

  • Round displayed pitch/yaw/azimuth to whole degrees (raw fact values are untouched, so map arrow etc. stay smooth)
  • Normalize -0 to 0 so the sign doesn't flicker around zero
  • Show -- instead of NaN when no valid angle has been received
  • Give each angle label a fixed width (via TextMetrics on the widest possible value) so the toolbar no longer shifts when the digit count changes (e.g. 9 ↔ 10, sign appearing)

Follows the approach discussed in #13204.

Fixes #13427

Testing

  • qmllint pre-commit hook passes
  • Incremental build succeeds
  • ctest -R ToolbarIndicatorUITest passes (strict QML warning checking)

Round displayed gimbal angles to whole degrees, normalize -0 to 0, show
-- for NaN, and give the pitch/pan labels a fixed width based on the
widest possible value so the toolbar no longer shifts as telemetry
noise changes the value.

Fixes mavlink#13427
Copilot AI review requested due to automatic review settings July 20, 2026 21:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the gimbal toolbar indicator QML to stabilize the on-screen pitch/yaw/azimuth text, preventing visual “jitter” caused by minor telemetry fluctuations and changing digit widths.

Changes:

  • Added a shared formatAngle(...) helper to round displayed angles to whole degrees, normalize -0 to 0, and display -- for invalid (NaN) values.
  • Introduced fixed-width angle labels using TextMetrics so the toolbar layout does not shift when signs/digit counts change.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Build results unavailable — artifact download from one or more platform workflows failed (likely artifact retention expiry or transient API error). The combined report cannot be generated for this run.

See the Build Results workflow run for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gimbal: Fix text jittering on angle values

2 participants