Skip to content

Commit 9db866c

Browse files
committed
update to use toggle
1 parent 9a0d56e commit 9db866c

19 files changed

+93
-708
lines changed

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ const validNewPipelineTypes = computed(() => {
130130
{ name: "Reflective", value: WebsocketPipelineType.Reflective },
131131
{ name: "Colored Shape", value: WebsocketPipelineType.ColoredShape },
132132
{ name: "AprilTag", value: WebsocketPipelineType.AprilTag },
133-
{ name: "AprilTagCuda", value: WebsocketPipelineType.AprilTagCuda },
134133
{ name: "Aruco", value: WebsocketPipelineType.Aruco }
135134
];
136135
if (useSettingsStore().general.supportedBackends.length > 0) {
@@ -169,7 +168,6 @@ const pipelineTypesWrapper = computed<{ name: string; value: number }[]>(() => {
169168
{ name: "Reflective", value: WebsocketPipelineType.Reflective },
170169
{ name: "Colored Shape", value: WebsocketPipelineType.ColoredShape },
171170
{ name: "AprilTag", value: WebsocketPipelineType.AprilTag },
172-
{ name: "AprilTagCuda", value: WebsocketPipelineType.AprilTagCuda },
173171
{ name: "Aruco", value: WebsocketPipelineType.Aruco }
174172
];
175173
if (useSettingsStore().general.supportedBackends.length > 0) {
@@ -226,9 +224,6 @@ useCameraSettingsStore().$subscribe((mutation, state) => {
226224
case PipelineType.AprilTag:
227225
pipelineType.value = WebsocketPipelineType.AprilTag;
228226
break;
229-
case PipelineType.AprilTagCuda:
230-
pipelineType.value = WebsocketPipelineType.AprilTagCuda;
231-
break;
232227
case PipelineType.Aruco:
233228
pipelineType.value = WebsocketPipelineType.Aruco;
234229
break;

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

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import InputTab from "@/components/dashboard/tabs/InputTab.vue";
77
import ThresholdTab from "@/components/dashboard/tabs/ThresholdTab.vue";
88
import ContoursTab from "@/components/dashboard/tabs/ContoursTab.vue";
99
import AprilTagTab from "@/components/dashboard/tabs/AprilTagTab.vue";
10-
import AprilTagCudaTab from "@/components/dashboard/tabs/AprilTagCudaTab.vue";
1110
import ArucoTab from "@/components/dashboard/tabs/ArucoTab.vue";
1211
import ObjectDetectionTab from "@/components/dashboard/tabs/ObjectDetectionTab.vue";
1312
import OutputTab from "@/components/dashboard/tabs/OutputTab.vue";
@@ -42,10 +41,6 @@ const allTabs = Object.freeze({
4241
tabName: "AprilTag",
4342
component: AprilTagTab
4443
},
45-
apriltagCudaTab: {
46-
tabName: "AprilTagCuda",
47-
component: AprilTagCudaTab
48-
},
4944
arucoTab: {
5045
tabName: "Aruco",
5146
component: ArucoTab
@@ -85,7 +80,6 @@ const getTabGroups = (): ConfigOption[][] => {
8580
allTabs.thresholdTab,
8681
allTabs.contoursTab,
8782
allTabs.apriltagTab,
88-
allTabs.apriltagCudaTab,
8983
allTabs.arucoTab,
9084
allTabs.objectDetectionTab,
9185
allTabs.outputTab
@@ -99,7 +93,6 @@ const getTabGroups = (): ConfigOption[][] => {
9993
allTabs.thresholdTab,
10094
allTabs.contoursTab,
10195
allTabs.apriltagTab,
102-
allTabs.apriltagCudaTab,
10396
allTabs.arucoTab,
10497
allTabs.objectDetectionTab,
10598
allTabs.outputTab
@@ -110,14 +103,7 @@ const getTabGroups = (): ConfigOption[][] => {
110103
return [
111104
[allTabs.inputTab],
112105
[allTabs.thresholdTab],
113-
[
114-
allTabs.contoursTab,
115-
allTabs.apriltagTab,
116-
allTabs.apriltagCudaTab,
117-
allTabs.arucoTab,
118-
allTabs.objectDetectionTab,
119-
allTabs.outputTab
120-
],
106+
[allTabs.contoursTab, allTabs.apriltagTab, allTabs.arucoTab, allTabs.objectDetectionTab, allTabs.outputTab],
121107
[allTabs.targetsTab, allTabs.pnpTab, allTabs.map3dTab]
122108
];
123109
}
@@ -130,7 +116,6 @@ const tabGroups = computed<ConfigOption[][]>(() => {
130116
131117
const allow3d = useCameraSettingsStore().currentPipelineSettings.solvePNPEnabled;
132118
const isAprilTag = useCameraSettingsStore().currentWebsocketPipelineType === WebsocketPipelineType.AprilTag;
133-
const isAprilTagCuda = useCameraSettingsStore().currentWebsocketPipelineType === WebsocketPipelineType.AprilTagCuda;
134119
const isAruco = useCameraSettingsStore().currentWebsocketPipelineType === WebsocketPipelineType.Aruco;
135120
const isObjectDetection =
136121
useCameraSettingsStore().currentWebsocketPipelineType === WebsocketPipelineType.ObjectDetection;
@@ -140,14 +125,10 @@ const tabGroups = computed<ConfigOption[][]>(() => {
140125
tabGroup.filter(
141126
(tabConfig) =>
142127
!(!allow3d && tabConfig.tabName === "3D") && //Filter out 3D tab any time 3D isn't calibrated
143-
!(
144-
(!allow3d || isAprilTag || isAprilTagCuda || isAruco || isObjectDetection) &&
145-
tabConfig.tabName === "PnP"
146-
) && //Filter out the PnP config tab if 3D isn't available, or we're doing AprilTags
147-
!((isAprilTag || isAprilTagCuda || isAruco || isObjectDetection) && tabConfig.tabName === "Threshold") && //Filter out threshold tab if we're doing AprilTags
148-
!((isAprilTag || isAprilTagCuda || isAruco || isObjectDetection) && tabConfig.tabName === "Contours") && //Filter out contours if we're doing AprilTags
128+
!((!allow3d || isAprilTag || isAruco || isObjectDetection) && tabConfig.tabName === "PnP") && //Filter out the PnP config tab if 3D isn't available, or we're doing AprilTags
129+
!((isAprilTag || isAruco || isObjectDetection) && tabConfig.tabName === "Threshold") && //Filter out threshold tab if we're doing AprilTags
130+
!((isAprilTag || isAruco || isObjectDetection) && tabConfig.tabName === "Contours") && //Filter out contours if we're doing AprilTags
149131
!(!isAprilTag && tabConfig.tabName === "AprilTag") && //Filter out apriltag unless we actually are doing AprilTags
150-
!(!isAprilTagCuda && tabConfig.tabName === "AprilTagCuda") && //Filter out apriltag unless we actually are doing AprilTags
151132
!(!isAruco && tabConfig.tabName === "Aruco") &&
152133
!(!isObjectDetection && tabConfig.tabName === "Object Detection") //Filter out aruco unless we actually are doing Aruco
153134
)

photon-client/src/components/dashboard/tabs/AprilTagCudaTab.vue

Lines changed: 0 additions & 93 deletions
This file was deleted.

photon-client/src/components/dashboard/tabs/AprilTagTab.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,14 @@ const interactiveCols = computed(() =>
8888
(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ refineEdges: value }, false)
8989
"
9090
/>
91+
<pv-switch
92+
v-model="currentPipelineSettings.cudaAcceleration"
93+
:switch-cols="interactiveCols"
94+
label="CUDA Acceleration"
95+
tooltip="Use CUDA acceleration for AprilTag detection, requires a compatible NVIDIA GPU and the CUDA version of OpenCV"
96+
@update:modelValue="
97+
(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ cudaAcceleration: value }, false)
98+
"
99+
/>
91100
</div>
92101
</template>

photon-client/src/components/dashboard/tabs/OutputTab.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const theme = useTheme();
1414
const isTagPipeline = computed(
1515
() =>
1616
useCameraSettingsStore().currentPipelineType === PipelineType.AprilTag ||
17-
useCameraSettingsStore().currentPipelineType === PipelineType.AprilTagCuda ||
1817
useCameraSettingsStore().currentPipelineType === PipelineType.Aruco
1918
);
2019
@@ -72,7 +71,6 @@ const interactiveCols = computed(() =>
7271
<pv-switch
7372
v-if="
7473
(currentPipelineSettings.pipelineType === PipelineType.AprilTag ||
75-
currentPipelineSettings.pipelineType === PipelineType.AprilTagCuda ||
7674
currentPipelineSettings.pipelineType === PipelineType.Aruco) &&
7775
useCameraSettingsStore().isCurrentVideoFormatCalibrated &&
7876
useCameraSettingsStore().currentPipelineSettings.solvePNPEnabled
@@ -89,7 +87,6 @@ const interactiveCols = computed(() =>
8987
<pv-switch
9088
v-if="
9189
(currentPipelineSettings.pipelineType === PipelineType.AprilTag ||
92-
currentPipelineSettings.pipelineType === PipelineType.AprilTagCuda ||
9390
currentPipelineSettings.pipelineType === PipelineType.Aruco) &&
9491
useCameraSettingsStore().isCurrentVideoFormatCalibrated &&
9592
useCameraSettingsStore().currentPipelineSettings.solvePNPEnabled

photon-client/src/components/dashboard/tabs/TargetsTab.vue

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ const resetCurrentBuffer = () => {
4545
<th
4646
v-if="
4747
currentPipelineSettings.pipelineType === PipelineType.AprilTag ||
48-
currentPipelineSettings.pipelineType === PipelineType.AprilTagCuda ||
4948
currentPipelineSettings.pipelineType === PipelineType.Aruco
5049
"
5150
class="text-center text-white"
@@ -70,7 +69,6 @@ const resetCurrentBuffer = () => {
7069
<template
7170
v-if="
7271
(currentPipelineSettings.pipelineType === PipelineType.AprilTag ||
73-
currentPipelineSettings.pipelineType === PipelineType.AprilTagCuda ||
7472
currentPipelineSettings.pipelineType === PipelineType.Aruco) &&
7573
useCameraSettingsStore().currentPipelineSettings.solvePNPEnabled
7674
"
@@ -88,7 +86,6 @@ const resetCurrentBuffer = () => {
8886
<td
8987
v-if="
9088
currentPipelineSettings.pipelineType === PipelineType.AprilTag ||
91-
currentPipelineSettings.pipelineType === PipelineType.AprilTagCuda ||
9289
currentPipelineSettings.pipelineType === PipelineType.Aruco
9390
"
9491
class="text-center"
@@ -121,7 +118,6 @@ const resetCurrentBuffer = () => {
121118
<template
122119
v-if="
123120
(currentPipelineSettings.pipelineType === PipelineType.AprilTag ||
124-
currentPipelineSettings.pipelineType === PipelineType.AprilTagCuda ||
125121
currentPipelineSettings.pipelineType === PipelineType.Aruco) &&
126122
useCameraSettingsStore().currentPipelineSettings.solvePNPEnabled
127123
"
@@ -138,7 +134,6 @@ const resetCurrentBuffer = () => {
138134
<v-container
139135
v-if="
140136
(currentPipelineSettings.pipelineType === PipelineType.AprilTag ||
141-
currentPipelineSettings.pipelineType === PipelineType.AprilTagCuda ||
142137
currentPipelineSettings.pipelineType === PipelineType.Aruco) &&
143138
currentPipelineSettings.doMultiTarget &&
144139
useCameraSettingsStore().isCurrentVideoFormatCalibrated &&

photon-client/src/types/PipelineTypes.ts

Lines changed: 4 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ export enum PipelineType {
77
ColoredShape = 3,
88
AprilTag = 4,
99
Aruco = 5,
10-
ObjectDetection = 6,
11-
AprilTagCuda = 7
10+
ObjectDetection = 6
1211
}
1312

1413
export enum AprilTagFamily {
@@ -222,6 +221,7 @@ export interface AprilTagPipelineSettings extends PipelineSettings {
222221
tagFamily: AprilTagFamily;
223222
doMultiTarget: boolean;
224223
doSingleTargetAlways: boolean;
224+
cudaAcceleration: boolean;
225225
}
226226
export type ConfigurableAprilTagPipelineSettings = Partial<
227227
Omit<AprilTagPipelineSettings, "pipelineType" | "hammingDist" | "debug">
@@ -246,47 +246,8 @@ export const DefaultAprilTagPipelineSettings: AprilTagPipelineSettings = {
246246
threads: 4,
247247
tagFamily: AprilTagFamily.Family36h11,
248248
doMultiTarget: false,
249-
doSingleTargetAlways: false
250-
};
251-
252-
export interface AprilTagCudaPipelineSettings extends PipelineSettings {
253-
pipelineType: PipelineType.AprilTagCuda;
254-
hammingDist: number;
255-
numIterations: number;
256-
decimate: number;
257-
blur: number;
258-
decisionMargin: number;
259-
refineEdges: boolean;
260-
debug: boolean;
261-
threads: number;
262-
tagFamily: AprilTagFamily;
263-
doMultiTarget: boolean;
264-
doSingleTargetAlways: boolean;
265-
}
266-
export type ConfigurableAprilTagCudaPipelineSettings = Partial<
267-
Omit<AprilTagCudaPipelineSettings, "pipelineType" | "hammingDist" | "debug">
268-
> &
269-
ConfigurablePipelineSettings;
270-
export const DefaultAprilTagCudaPipelineSettings: AprilTagCudaPipelineSettings = {
271-
...DefaultPipelineSettings,
272-
cameraGain: 75,
273-
targetModel: TargetModel.AprilTag6p5in_36h11,
274-
ledMode: false,
275-
outputShowMultipleTargets: true,
276-
cameraExposureRaw: 20,
277-
pipelineType: PipelineType.AprilTagCuda,
278-
279-
hammingDist: 0,
280-
numIterations: 40,
281-
decimate: 1,
282-
blur: 0,
283-
decisionMargin: 35,
284-
refineEdges: true,
285-
debug: false,
286-
threads: 4,
287-
tagFamily: AprilTagFamily.Family36h11,
288-
doMultiTarget: false,
289-
doSingleTargetAlways: false
249+
doSingleTargetAlways: false,
250+
cudaAcceleration: false
290251
};
291252

292253
export interface ArucoPipelineSettings extends PipelineSettings {
@@ -381,7 +342,6 @@ export type ActivePipelineSettings =
381342
| AprilTagPipelineSettings
382343
| ArucoPipelineSettings
383344
| ObjectDetectionPipelineSettings
384-
| AprilTagCudaPipelineSettings
385345
| Calibration3dPipelineSettings;
386346

387347
export type ActiveConfigurablePipelineSettings =
@@ -390,5 +350,4 @@ export type ActiveConfigurablePipelineSettings =
390350
| ConfigurableAprilTagPipelineSettings
391351
| ConfigurableArucoPipelineSettings
392352
| ConfigurableObjectDetectionPipelineSettings
393-
| ConfigurableAprilTagCudaPipelineSettings
394353
| ConfigurableCalibration3dPipelineSettings;

photon-client/src/types/WebsocketDataTypes.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,5 @@ export enum WebsocketPipelineType {
115115
ColoredShape = 1,
116116
AprilTag = 2,
117117
Aruco = 3,
118-
ObjectDetection = 4,
119-
AprilTagCuda = 5
118+
ObjectDetection = 4
120119
}

0 commit comments

Comments
 (0)