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 JavaCVMat and Size objects is performed as a method in the new CameraCalibrationValue kotlin data class. Might add a ctor which also accepts Mat values to keep all of the Mat to CameraCalibrationValue logic isolated to the same file.
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
JavaCV
Mat
andSize
objects is performed as a method in the newCameraCalibrationValue
kotlin data class. Might add a ctor which also acceptsMat
values to keep all of theMat
toCameraCalibrationValue
logic isolated to the same file.