cockpit icon indicating copy to clipboard operation
cockpit copied to clipboard

Add support for deadband calibration and exponential scaling on the joystick

Open rafaellehmkuhl opened this issue 7 months ago • 5 comments

This patch adds support for deadband/deadzone calibration and exponential scaling. The deadband calibration is applied before the exponential scaling, which means the exponential curve starts as 0 in the deadband threshold.

Circle correction was still not implemented as I understand it is a less important form of calibration, and its not yet clear to me how it should be accounted for.

https://github.com/user-attachments/assets/2dfb4dd7-c3a0-492e-862c-13c42458f23f

Fix #1851 Fix #1852

rafaellehmkuhl avatar Apr 28 '25 17:04 rafaellehmkuhl

The cancel button on both calibration screens are on the right side. To prevent misclicks and to maintain UI consistency this button should be moved to the left side of the modal:

image

ArturoManzoli avatar May 05 '25 10:05 ArturoManzoli

I think the helper text for the calibration could be more complete. Not everyone using this calibration features fully understand them.

Update: Later I saw the helper text inside each modal. I think they explain well the usage of the calibration, but even though making a more complete description on the main joystick info panel would be nice.

image

ArturoManzoli avatar May 05 '25 10:05 ArturoManzoli

And if you make the calibration bars background bg-[#FFFFFF33] the whole modal feel will be a lot lighter: After: image

Before: image

ArturoManzoli avatar May 05 '25 11:05 ArturoManzoli

Thanks for the UI feedback @ArturoManzoli! Agree with all and will perform the changes.

About the discussion @ES-Alexander has started and you commented on, around combining the two UIs, I agree with you on that having the individual calibrations is more intuitive for someone that is looking for just one of them, but I believe what @ES-Alexander mentioned (around them individually not expressing the reality of things for the user) is true. When the calibration and scaled are combined, they do have a side-effect that needs to be mentioned, that is the fact that the exponential scaling only happens on the non-deadbanded zone, and your suggestion @ES-Alexander around using the linear graphs with the deadbands in the middle to show that the end of the deadband is considered 0, and not the threshold value, makes it more clear on what is the behavior.

I will take more time, as this PR is not ultra critical, to improve with what was suggested, making sure it is intuitive as well on the single-calibration scenario.

rafaellehmkuhl avatar May 05 '25 14:05 rafaellehmkuhl

I don't see why performing dead-zone calibration would be any more complex on a chart showing a red, expanding obviously "off" output region vs on a bar showing nothing in particular other than an expanding red input region.

Performing deadband calibration and changing the exponential factor would still happen independently, they just change different parts of the displayed graphs.

I would note that QGC's deadband auto-calibration has just a single "calibrate" button that starts the calibration for all axes, which seems desirable because it would simplify the suggested interface, and avoids needing to determine which joystick corresponds to which axis ahead of time. The regions can also be changed manually be dragging on their bars, which I think should be fine for us to implement on the plots, and/or we could add a separate slider for it if we want to.

ES-Alexander avatar May 07 '25 09:05 ES-Alexander

Updated the PR with all the suggestions:

https://github.com/user-attachments/assets/c57b39a1-11aa-4d73-90fd-bb73870ccc16

rafaellehmkuhl avatar May 14 '25 19:05 rafaellehmkuhl