mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-21 01:01:41 +00:00
Fix sockethandler rotation mode/orientation bug
This commit is contained in:
@@ -4,7 +4,6 @@ import com.chameleonvision.Main;
|
||||
import com.chameleonvision.vision.camera.CameraCapture;
|
||||
import com.chameleonvision.vision.camera.CaptureStaticProperties;
|
||||
import com.chameleonvision.vision.pipeline.pipes.*;
|
||||
import com.chameleonvision.vision.enums.ImageRotationMode;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.opencv.core.*;
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.chameleonvision.config.ConfigManager;
|
||||
import com.chameleonvision.vision.VisionManager;
|
||||
import com.chameleonvision.vision.VisionProcess;
|
||||
import com.chameleonvision.vision.camera.CameraCapture;
|
||||
import com.chameleonvision.vision.enums.ImageRotationMode;
|
||||
import com.chameleonvision.vision.pipeline.CVPipeline;
|
||||
import com.chameleonvision.vision.pipeline.CVPipeline2dSettings;
|
||||
import com.chameleonvision.vision.pipeline.CVPipelineSettings;
|
||||
@@ -135,7 +136,21 @@ public class SocketHandler {
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
setField(currentPipeline.settings, entry.getKey(), entry.getValue());
|
||||
// TODO fix this hack
|
||||
String key;
|
||||
Object value;
|
||||
if(entry.getKey().equals("orientation")) { // FIXME the field is now called rotationMode
|
||||
value = entry.getValue();
|
||||
var int_ = (Integer) value;
|
||||
if (int_ == 1) {
|
||||
currentPipeline.settings.rotationMode = ImageRotationMode.DEG_180;
|
||||
} else {
|
||||
currentPipeline.settings.rotationMode = ImageRotationMode.DEG_0;
|
||||
}
|
||||
} else {
|
||||
setField(currentPipeline.settings, entry.getKey(), entry.getValue());
|
||||
}
|
||||
|
||||
switch (entry.getKey()) {
|
||||
case "exposure": {
|
||||
currentCamera.setExposure((Integer) entry.getValue());
|
||||
|
||||
Reference in New Issue
Block a user