mirror of
https://github.com/PhotonVision/photonvision
synced 2026-07-05 03:21:40 +00:00
Store calibration board measurements in native units (#2480)
This commit is contained in:
@@ -24,11 +24,11 @@ import org.opencv.objdetect.Objdetect;
|
||||
public class UICalibrationData {
|
||||
public int videoModeIndex;
|
||||
public int count;
|
||||
public double squareSizeIn;
|
||||
public double squareSizeMeters;
|
||||
public int patternWidth;
|
||||
public int patternHeight;
|
||||
public BoardType boardType;
|
||||
public double markerSizeIn;
|
||||
public double markerSizeMeters;
|
||||
public boolean useOldPattern;
|
||||
public TagFamily tagFamily;
|
||||
|
||||
@@ -37,8 +37,8 @@ public class UICalibrationData {
|
||||
public UICalibrationData(
|
||||
int count,
|
||||
int videoModeIndex,
|
||||
double squareSizeIn,
|
||||
double markerSizeIn,
|
||||
double squareSizeMeters,
|
||||
double markerSizeMeters,
|
||||
int patternWidth,
|
||||
int patternHeight,
|
||||
BoardType boardType,
|
||||
@@ -46,8 +46,8 @@ public class UICalibrationData {
|
||||
TagFamily tagFamily) {
|
||||
this.count = count;
|
||||
this.videoModeIndex = videoModeIndex;
|
||||
this.squareSizeIn = squareSizeIn;
|
||||
this.markerSizeIn = markerSizeIn;
|
||||
this.squareSizeMeters = squareSizeMeters;
|
||||
this.markerSizeMeters = markerSizeMeters;
|
||||
this.patternWidth = patternWidth;
|
||||
this.patternHeight = patternHeight;
|
||||
this.boardType = boardType;
|
||||
@@ -98,10 +98,10 @@ public class UICalibrationData {
|
||||
+ videoModeIndex
|
||||
+ ", count="
|
||||
+ count
|
||||
+ ", squareSizeIn="
|
||||
+ squareSizeIn
|
||||
+ ", markerSizeIn="
|
||||
+ markerSizeIn
|
||||
+ ", squareSizeMeters="
|
||||
+ squareSizeMeters
|
||||
+ ", markerSizeMeters="
|
||||
+ markerSizeMeters
|
||||
+ ", patternWidth="
|
||||
+ patternWidth
|
||||
+ ", patternHeight="
|
||||
|
||||
@@ -55,7 +55,6 @@ import org.photonvision.vision.pipeline.UICalibrationData;
|
||||
import org.photonvision.vision.pipeline.result.CVPipelineResult;
|
||||
import org.photonvision.vision.target.TargetModel;
|
||||
import org.photonvision.vision.target.TrackedTarget;
|
||||
import org.wpilib.math.util.Units;
|
||||
import org.wpilib.vision.camera.CameraServerJNI;
|
||||
import org.wpilib.vision.camera.VideoException;
|
||||
|
||||
@@ -391,8 +390,8 @@ public class VisionModule {
|
||||
+ data.videoModeIndex
|
||||
+ " and settings "
|
||||
+ data);
|
||||
settings.gridSize = Units.inchesToMeters(data.squareSizeIn);
|
||||
settings.markerSize = Units.inchesToMeters(data.markerSizeIn);
|
||||
settings.gridSize = data.squareSizeMeters;
|
||||
settings.markerSize = data.markerSizeMeters;
|
||||
settings.boardHeight = data.patternHeight;
|
||||
settings.boardWidth = data.patternWidth;
|
||||
settings.boardType = data.boardType;
|
||||
|
||||
Reference in New Issue
Block a user