-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
Implement offset and gain stick Calibration #441
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mmmaisel
commented
May 3, 2022
pktiuk
requested changes
May 4, 2022
The layout of the JoySensorEditDialog jumps around when the number of decimals in the bearing and safezone labels change. Fix it by putting all stick labels and values from the left column in a QGridLayout and set the length of the first value to the length of a dummy string with nine decimals.
If a nullptr is passed as stick to the status box, it crashes. This will be a problem in the new combined sensor/stick calibration dialog.
The existing axis calibration just clipped the allowed axis values to a given maximum. Replace this with linear offset and gain calibration. Calibration is applied when queueing pending events so that all following calculations receive corrected values. Replace the existing "clipping" steps with the previously uncalibrated case - clipping to the global minimum/maximum value. Temporarily remove load/store to XML and disable the existing calibration dialog. They will be implemented again in the following commits.
It was removed in the previous commit. Implement calibration storage on the InputDevice so that calibration is applied to all sets of the current device. Add XML load/store again.
This helper class will be used during calibration in the following commits to estimate offset and gain values and theier accuracy.
The PT1 class implements a first order lag filter (or PT1). This filter willl be used to denoise the calibration values and later for sensor data processing.
Implement an interactive calibration workflow which automatically detects when enough data was collected by evaluation statistic properties. The current estimated calibration values are shown live in red and turn black if the relative error is below 1%. If not enough values are collected after 30 seconds, time out and continue with the available data. This avoids long calibration times that may lead to bug reports because users think it hangs in case of noisy devices. Determine the final calibration values with a linear regression. Rework the calibration dialog, e.g remove redundant ProgressBars and reduce empty space. The new dialog is also ready to be extended for sensor calibration. Encode the device index with a bitmask into the type int since this allows using the QVariant::int user data in the combo box directly.
pktiuk
approved these changes
May 5, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The existing axis calibration just clipped the allowed axis values to a
given maximum. Replace this with linear offset and gain calibration.
Calibration is applied when queueing pending events so that all
following calculations receive corrected values.
Replace the existing "clipping" steps with the previously uncalibrated
case - clipping to the global minimum/maximum value.
Implement an interactive calibration workflow which
automatically detects when enough data was collected by evaluation
statistic properties. The current estimated calibration values are shown
live in red and turn black if the relative error is below 1%.
If not enough values are collected after 30 seconds, time out and
continue with the available data. This avoids long calibration times
that may lead to bug reports because users think it hangs in case of
noisy devices. Determine the final calibration values with a linear regression.
Rework the calibration dialog, e.g remove redundant ProgressBars and
reduce empty space. The new dialog is also ready to be extended for
sensor calibration.
Should also help with #407.