Skip to content

Commit 831df40

Browse files
authored
Disable 3d mode for OD (#2121)
## Description There isn't anything that 3D mode adds for OD, and the results are typically messed up. Thus, we disable 3D mode when we're using an OD pipeline. ## Meta Merge checklist: - [x] Pull Request title is [short, imperative summary](https://cbea.ms/git-commit/) of proposed changes - [x] The description documents the _what_ and _why_ - [ ] If this PR changes behavior or adds a feature, user documentation is updated - [ ] If this PR touches photon-serde, all messages have been regenerated and hashes have not changed unexpectedly - [ ] If this PR touches configuration, this is backwards compatible with settings back to v2025.3.2 - [ ] If this PR touches pipeline settings or anything related to data exchange, the frontend typing is updated - [ ] If this PR addresses a bug, a regression test for it is added
1 parent b89ab49 commit 831df40

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

photon-client/src/components/dashboard/StreamConfigCard.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { computed } from "vue";
33
import { useCameraSettingsStore } from "@/stores/settings/CameraSettingsStore";
44
import { useStateStore } from "@/stores/StateStore";
55
import { useTheme } from "vuetify";
6+
import { PipelineType } from "@/types/PipelineTypes";
67
78
const theme = useTheme();
89
@@ -43,7 +44,10 @@ const processingMode = computed<number>({
4344
<v-btn
4445
color="buttonPassive"
4546
:disabled="
46-
!useCameraSettingsStore().hasConnected || !useCameraSettingsStore().isCurrentVideoFormatCalibrated
47+
!useCameraSettingsStore().hasConnected ||
48+
!useCameraSettingsStore().isCurrentVideoFormatCalibrated ||
49+
useCameraSettingsStore().currentPipelineSettings.pipelineType == PipelineType.ObjectDetection ||
50+
useCameraSettingsStore().currentPipelineSettings.pipelineType == PipelineType.ColoredShape
4751
"
4852
:variant="theme.global.name.value === 'LightTheme' ? 'elevated' : 'outlined'"
4953
class="w-50"

photon-core/src/main/java/org/photonvision/vision/processes/PipelineManager.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,16 @@ public void changePipelineType(int newType) {
488488
// Skip fields that are annotated with SuppressSettingCopy
489489
continue;
490490
}
491+
492+
// Object detection doesn't support 3D mode, so we gotta make sure that gets
493+
// turned off when we switch from a pipeline that had 3D mode enabled.
494+
if ((newType == PipelineType.ObjectDetection.baseIndex
495+
|| newType == PipelineType.ColoredShape.baseIndex)
496+
&& field.getName().equals("solvePNPEnabled")) {
497+
field.set(newSettings, false);
498+
continue;
499+
}
500+
491501
Object value = field.get(oldSettings);
492502
logger.debug("setting " + field.getName() + " to " + value);
493503
field.set(newSettings, value);

0 commit comments

Comments
 (0)