Skip to content

GimbalIndicator: prevent text from jittering around #13204

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

julianoes
Copy link
Contributor

This fixes the issue where the gimbal indicators Azimuth and Yaw keep jumping around when the value is around 0, going from -0 to 0.

The fix (from what I understand):

  • Makes the boxes have a fixed width,
  • And round to full degrees.

This fixes the issue where the gimbal indicators Azimuth and Yaw keep
jumping around when the value is around 0, going from -0 to 0.

The fix (from what I understand):
- Makes the boxes have a fixed width,
- And round to full degrees.
@julianoes julianoes requested a review from Davidsastresas July 23, 2025 02:27
@Davidsastresas
Copy link
Member

Hi Julian, it is true that around 0 that behavior was annoying, thanks for addressing it.

Your approach seems fine to me. However, I am not sure if I like to remove completely floating points. Some users might like to have that decimal point there.

If you think it makes sense, I think we could expose a setting in gimbalcontrollersettings, a quick checkbox, and add it to GimbalIndicator.qml, we have the gimbal settings there too.

If you already tried your approach with floating points and the extra width made this all look weird, it isn't a big deal, I am fine too with no floating points.

Thanks!

@julianoes
Copy link
Contributor Author

Thanks for the review @Davidsastresas. I guess I don't understand why you would want the floating point. It's not like you do something with that exact number, it's more of an indicator. Or what would be the purpose of knowing 0.1 degrees?

@Davidsastresas
Copy link
Member

I agree most users won't mind.

I have in mind some niche users like survey people doing mapping of solar panels. For some reason it is really important for the sensor to be parallel to the panel's angle, and they could appreciate the extra floating point to be extra sure everything is fine during mission.

In any case, those niche users will probably have a QGC custom fork anyway, so if you think it is a good idea to remove the floating point I am fine with it too.

Thanks!

@DonLakeFlyer
Copy link
Contributor

I have in mind some niche users like survey people doing mapping of solar panels. For some reason it is really important for the sensor to be parallel to the panel's angle, and they could appreciate the extra floating point to be extra sure everything is fine during mission.

They could add the value to telemetry if they want more detailed?

@julianoes
Copy link
Contributor Author

Can they? Or do we need to add that somehow?

@DonLakeFlyer
Copy link
Contributor

Or do we need to add that somehow?

The Gimbal values could be set up as a FactGroup then they are available to the telemetry display.

@DonLakeFlyer
Copy link
Contributor

This fixes the issue where the gimbal indicators Azimuth and Yaw keep jumping around when the value is around 0, going from -0 to 0.

Is this just a problem with 0s? Would a gimbal angle bounce around between say 9 and 10 causing the digit count to change constantly? Reason I ask is that I'd rather not have this be fixed width. Toolbar space is at a premium. You want to take as little as possible.

@julianoes
Copy link
Contributor Author

Would a gimbal angle bounce around between say 9 and 10 causing the digit count to change constantly?

Yes, it also changes from 9 to 10, and any change really as it's not a monospace font.

If you ask me, the gimbal angle probably shouldn't be up there like that in the first place and could be a more intuitive indicator, but it's better than nothing.

@DonLakeFlyer
Copy link
Contributor

Yes, it also changes from 9 to 10, and any change really as it's not a monospace font.

Ok, let me play around with this a bit

@DonLakeFlyer
Copy link
Contributor

Yes, it also changes from 9 to 10

But if the gimbal position is static would it be possible for the gimbal angle reported to bounce between 9.5 and 9.4 causing the rounded value to bounce between 9 and 10 even though the gimbal is not moving.

Or to put the question another way if we just round the gimbal values and don't do fix width. Will the only time the gimbal indicator change size happen when the gimbal is actually being moved.

@Davidsastresas
Copy link
Member

Davidsastresas commented Jul 28, 2025

@DonLakeFlyer That's correct, with rounding that should only change when gimbal moves.

However keep in mind we have the option of showing yaw as azimuth or local yaw. So depending on this option and gimbal being on locked or follow mode, yaw/azimuth could change with vehicle yaw.

About having values there at all, I understand it is a larger indicator than usual. My initial idea for it was an additional button/indicator in flyview, something like this:
Screenshot from 2025-07-28 19-43-45

and after click expands to the whole controls panel. But I understand this could be too invasive for fly view as well.

So I am really okay with whatever you guys decide. We always have time to keep iterating if we miss anything in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants