Save calibration values to disk #312
Merged
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.
In this PR I'm adding a way to backup the results of the camera calibration between separate runs of the topside application. In creating this feature I decided to model the code after the motion power profile code. This code was going to be very similar so it made sense to make the profile controller a generic class. You can now save any object you want to disk by creating a
ValueStore<V>instance.This really helped clean up the camera calibration code. Instead of tracking if an object was created in the current runtime, just check the
ValueStore<CameraCalibrationValue>instance to see if there was a successful calibration. This removes the need to copy the valid camera calibration images to a separate folder, as the last calibration value can be grabbed without re-running the calibration code.Translating the value object into the
JavaCVMatandSizeobjects is performed as a method in the newCameraCalibrationValuekotlin data class. Might add a ctor which also acceptsMatvalues to keep all of theMattoCameraCalibrationValuelogic isolated to the same file.