mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-25 01:41:40 +00:00
feat: crosshair toggle for driver mode (#1822)
closes #1818  Here's what the added toggle looks like, I just put in the input settings. It'll also hide itself when drivermode is off.
This commit is contained in:
@@ -170,5 +170,13 @@ const interactiveCols = computed(() =>
|
||||
:select-cols="interactiveCols"
|
||||
@input="(args) => handleStreamResolutionChange(args)"
|
||||
/>
|
||||
<pv-switch
|
||||
v-if="useCameraSettingsStore().isDriverMode"
|
||||
v-model="useCameraSettingsStore().currentPipelineSettings.crosshair"
|
||||
label="Crosshair"
|
||||
:switch-cols="interactiveCols"
|
||||
tooltip="Enables or disables a crosshair overlay on the camera stream"
|
||||
@input="(args) => useCameraSettingsStore().changeCurrentPipelineSetting({ crosshair: args }, false)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -68,10 +68,12 @@ public class DriverModePipeline
|
||||
if (!emptyIn) {
|
||||
totalNanos += resizeImagePipe.run(inputMat).nanosElapsed;
|
||||
|
||||
var draw2dCrosshairResult = draw2dCrosshairPipe.run(Pair.of(inputMat, List.of()));
|
||||
if (settings.crosshair) {
|
||||
var draw2dCrosshairResult = draw2dCrosshairPipe.run(Pair.of(inputMat, List.of()));
|
||||
|
||||
// calculate elapsed nanoseconds
|
||||
totalNanos += draw2dCrosshairResult.nanosElapsed;
|
||||
// calculate elapsed nanoseconds
|
||||
totalNanos += draw2dCrosshairResult.nanosElapsed;
|
||||
}
|
||||
}
|
||||
|
||||
var fpsResult = calculateFPSPipe.run(null);
|
||||
@@ -92,6 +94,7 @@ public class DriverModePipeline
|
||||
|
||||
@Override
|
||||
public void release() {
|
||||
// we never actually need to give resources up since pipelinemanager only makes one of us
|
||||
// we never actually need to give resources up since pipelinemanager only makes
|
||||
// one of us
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.photonvision.vision.processes.PipelineManager;
|
||||
@JsonTypeName("DriverModePipelineSettings")
|
||||
public class DriverModePipelineSettings extends CVPipelineSettings {
|
||||
public DoubleCouple offsetPoint = new DoubleCouple();
|
||||
public boolean crosshair = true;
|
||||
|
||||
public DriverModePipelineSettings() {
|
||||
super();
|
||||
|
||||
Reference in New Issue
Block a user