Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": {
"pnpm": "^11.0.8"
}
}
26 changes: 26 additions & 0 deletions photon-client/src/components/dashboard/tabs/AprilTagTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { useStateStore } from "@/stores/StateStore";
import { useCameraSettingsStore } from "@/stores/settings/CameraSettingsStore";
import { useDisplay } from "vuetify";

import { useSettingsStore } from "@/stores/settings/GeneralSettingsStore";

// TODO fix pipeline typing in order to fix this, the store settings call should be able to infer that only valid pipeline type settings are exposed based on pre-checks for the entire config section
// Defer reference to store access method
const currentPipelineSettings = computed<AprilTagPipelineSettings>(
Expand Down Expand Up @@ -90,5 +92,29 @@ const interactiveCols = computed(() =>
(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ refineEdges: value }, false)
"
/>
<pv-switch
v-for="(tag, index) in useSettingsStore().currentFieldLayout.tags"
:key="index"
:model-value="
currentPipelineSettings.excludeTags instanceof Set ? currentPipelineSettings.excludeTags.has(tag.ID) : false
"
:switch-cols="interactiveCols"
:label="`Ignore tag ${tag.ID}`"
@update:modelValue="
(value) => {
const next = new Set<number>(
currentPipelineSettings.excludeTags instanceof Set ? currentPipelineSettings.excludeTags : []
);

if (value) {
next.add(tag.ID);
} else {
next.delete(tag.ID);
}

useCameraSettingsStore().changeCurrentPipelineSetting({ excludeTags: next }, true);
}
"
/>
</div>
</template>
8 changes: 6 additions & 2 deletions photon-client/src/types/PipelineTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ export interface AprilTagPipelineSettings extends PipelineSettings {
tagFamily: AprilTagFamily;
doMultiTarget: boolean;
doSingleTargetAlways: boolean;
excludeTags: Set<number>;
}
export type ConfigurableAprilTagPipelineSettings = Partial<
Omit<AprilTagPipelineSettings, "pipelineType" | "hammingDist" | "debug">
Expand All @@ -299,7 +300,8 @@ export const DefaultAprilTagPipelineSettings: AprilTagPipelineSettings = {
threads: 4,
tagFamily: AprilTagFamily.Family36h11,
doMultiTarget: false,
doSingleTargetAlways: false
doSingleTargetAlways: false,
excludeTags: new Set<number>()
};

export interface ArucoPipelineSettings extends PipelineSettings {
Expand All @@ -320,6 +322,7 @@ export interface ArucoPipelineSettings extends PipelineSettings {

doMultiTarget: boolean;
doSingleTargetAlways: boolean;
excludeTags: Set<number>;
}
export type ConfigurableArucoPipelineSettings = Partial<Omit<ArucoPipelineSettings, "pipelineType">> &
ConfigurablePipelineSettings;
Expand All @@ -342,7 +345,8 @@ export const DefaultArucoPipelineSettings: ArucoPipelineSettings = {
aruco3MinMarkerSideRatio: 0.02,
aruco3MinCanonicalImgSide: 32,
doMultiTarget: false,
doSingleTargetAlways: false
doSingleTargetAlways: false,
excludeTags: new Set<number>()
};

export interface ObjectDetectionPipelineSettings extends PipelineSettings {
Expand Down
2 changes: 1 addition & 1 deletion photon-client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
"paths": {
"@/*": ["./src/*"]
}
},
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,16 @@ protected CVPipelineResult process(Frame frame, AprilTagPipelineSettings setting
// Populate target list for multitag
// (TODO: Address circular dependencies. Multitag only requires corners and IDs, this should
// not be necessary.)
TrackedTarget target =
new TrackedTarget(
detection,
null,
new TargetCalculationParameters(
false, null, null, null, null, frameStaticProperties));

targetList.add(target);
if (settings.excludeTags.contains(detection.getId())) {
TrackedTarget target =
new TrackedTarget(
detection,
null,
new TargetCalculationParameters(
false, null, null, null, null, frameStaticProperties));

targetList.add(target);
}
}

// Do multi-tag pose estimation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
package org.photonvision.vision.pipeline;

import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.HashSet;
import org.photonvision.vision.apriltag.AprilTagFamily;
import org.photonvision.vision.target.TargetModel;

@JsonTypeName("AprilTagPipelineSettings")
public class AprilTagPipelineSettings extends AdvancedPipelineSettings {
public AprilTagFamily tagFamily = AprilTagFamily.kTag36h11;
public HashSet<Integer> excludeTags = new HashSet<>();
public int decimate = 1;
public double blur = 0;
public int threads = 4; // Multiple threads seems to be better performance on most platforms
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,14 @@ protected CVPipelineResult process(Frame frame, ArucoPipelineSettings settings)
// Populate target list for multitag
// (TODO: Address circular dependencies. Multitag only requires corners and IDs, this should
// not be necessary.)

targetList.add(
new TrackedTarget(
detection,
null,
new TargetCalculationParameters(
false, null, null, null, null, frameStaticProperties)));
if (settings.excludeTags.contains(detection.getId())) {
targetList.add(
new TrackedTarget(
detection,
null,
new TargetCalculationParameters(
false, null, null, null, null, frameStaticProperties)));
}
}

// Do multi-tag pose estimation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
package org.photonvision.vision.pipeline;

import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.HashSet;
import org.photonvision.common.util.numbers.IntegerCouple;
import org.photonvision.vision.apriltag.AprilTagFamily;
import org.photonvision.vision.target.TargetModel;

@JsonTypeName("ArucoPipelineSettings")
public class ArucoPipelineSettings extends AdvancedPipelineSettings {
public AprilTagFamily tagFamily = AprilTagFamily.kTag36h11;

public HashSet<Integer> excludeTags = new HashSet<>();
public IntegerCouple threshWinSizes = new IntegerCouple(11, 91);
public int threshStepSize = 40;
public double threshConstant = 10;
Expand Down
Loading