Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run multitag on coprocessor #816

Merged
merged 142 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from 141 commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
3c8a789
Matt's confused
mcm001 Jan 25, 2023
a5816af
Update classes from Nolan's sim PR
mcm001 Jan 25, 2023
25aff1b
Update ApriltagWorkbenchTest.java
mcm001 Jan 25, 2023
8c58a20
Move into Photonlib
mcm001 Jan 31, 2023
83ad026
Run spotless and fix NPE
mcm001 Jan 31, 2023
5f98887
Publish camera coeffs to NT
Bankst Feb 6, 2023
b8908a9
less dumb no-cal send
Bankst Feb 6, 2023
6525272
Remove PhotonFrameProp, use separate matrices
Bankst Feb 6, 2023
87337bf
Add camera matrices to PhotonLib
Bankst Feb 6, 2023
b5fa928
Make most of the C++ changes
mcm001 Feb 8, 2023
607e4b9
Run wpiformat
mcm001 Feb 8, 2023
ae1c63d
Update ApriltagWorkbenchTest.java
mcm001 Feb 8, 2023
9565a9e
Run spotless
mcm001 Feb 8, 2023
2d6191c
Add fallback strategy
mcm001 Feb 8, 2023
1d3ff64
Const in PhotonPoseEstimator (#20)
MrRedness Feb 8, 2023
e14a048
Add calibration to photoncamera, change names
mcm001 Feb 8, 2023
4b05469
Merge branch 'master' into multiag-pnp
mcm001 Feb 8, 2023
a5aa77e
Update PhotonCamera.java
mcm001 Feb 8, 2023
8d0bc33
Delete libphotonlibcamera.so
mcm001 Feb 8, 2023
1dad2b1
a
mcm001 Feb 8, 2023
97af0ec
Bump opencv again
mcm001 Feb 8, 2023
e15f297
Update OpenCVHelp.java
mcm001 Feb 8, 2023
87c052d
Update javadocs again
mcm001 Feb 8, 2023
155eaa9
Create C++ Apriltag example
mcm001 Jan 13, 2023
d5ec114
Fix warning spam
mcm001 Feb 10, 2023
f1f7e70
Merge remote-tracking branch 'upstream/master' into multiag-pnp
mcm001 Feb 10, 2023
44c6a80
Update SimPhotonCamera.java
mcm001 Feb 10, 2023
c790c2a
Merge remote-tracking branch 'upstream/master' into multiag-pnp
mcm001 Feb 12, 2023
89e802d
Attempt to add AprilTagFieldLayout to PhotonConfiguration
mcm001 Feb 27, 2023
6c78e66
Force flush on shutdown? idk
mcm001 Feb 28, 2023
0c282f8
Added ability to construct PhotonPoseEstimator without a PhotonCamera…
megalinee Apr 12, 2023
2921ca9
Fixed accidental file change
megalinee Apr 12, 2023
dd58ce8
Changed raw double arrays to use optional matrices
megalinee Apr 12, 2023
7ef9a70
Implemented PhotonPoseEstimator changes in C++ & removed camera default
megalinee Apr 14, 2023
6c91ba1
Fixed formatting
megalinee Apr 14, 2023
fc8bd6c
Fixed minor issues
megalinee Apr 14, 2023
b9f65f7
Declared C++ methods
megalinee Apr 16, 2023
9061e1a
Make PhotonCamera a shared-ptr
mcm001 Apr 17, 2023
c4af7e6
Whoops
mcm001 Apr 17, 2023
25c1656
Merge branch 'master' into multiag-pnp
mcm001 Jun 11, 2023
087547d
Run linters
mcm001 Jun 11, 2023
25f1fda
Add multiTagResult to CVPipelineResult
mcm001 Jun 11, 2023
3b5c4f2
Run lint
mcm001 Jun 11, 2023
0af4855
Revert changed to package-lock
srimanachanta Jun 16, 2023
60317e5
actually fixes it
srimanachanta Jun 16, 2023
eb04961
Merge branch 'master' into pr/816
srimanachanta Jun 16, 2023
ce68925
Formatting fixes
srimanachanta Jun 16, 2023
4780cd4
Merge branch 'master' into multiag-pnp
mcm001 Jul 28, 2023
7907b90
Fix accidental changes
mcm001 Jul 28, 2023
b5007f7
Generate hash/equals
mcm001 Jul 28, 2023
a321fee
Merge remote-tracking branch 'upstream/master' into multiag-pnp
mcm001 Jul 28, 2023
2ed6ca6
Update PNPResults.java
mcm001 Jul 28, 2023
f3193f4
Fix most of the merge conflicts
mcm001 Jul 28, 2023
92eae41
Update SqlConfigProvider.java
mcm001 Jul 28, 2023
2ebd4af
Add equals
mcm001 Jul 28, 2023
06279ed
spotless
mcm001 Jul 28, 2023
bec84fd
Merge branch 'master' into multiag-pnp
srimanachanta Aug 9, 2023
e0681b1
Save ATFL from upload
srimanachanta Aug 9, 2023
1aa7e57
Add HTTP request for ATFL upload
srimanachanta Aug 9, 2023
7335257
Add ATFL to full settings
mcm001 Aug 12, 2023
1b02c33
Merge branch 'master' into multiag-pnp
srimanachanta Aug 22, 2023
d9a6ff8
Typescript fixes
srimanachanta Aug 22, 2023
afc1a0b
rename shouldMange to shouldManage
srimanachanta Aug 22, 2023
a7ae573
Move ATFL to settings
srimanachanta Aug 22, 2023
ed0e752
Add ATFL to websocket types
srimanachanta Aug 22, 2023
e4e391b
Handle reciving the ATFL
srimanachanta Aug 22, 2023
96517c0
Move Transform serialization to SerializationUtils
srimanachanta Aug 22, 2023
316de53
Add multitag data to UIDataPublisher
srimanachanta Aug 22, 2023
473e489
Formatting fixes
srimanachanta Aug 22, 2023
ce709dd
add doMultiTarget to apriltag settings type
srimanachanta Aug 22, 2023
aee455c
Add switch for multitag
srimanachanta Aug 22, 2023
c33ec6c
Merge branch 'master' into multiag-pnp
srimanachanta Aug 23, 2023
d4b2e1e
Add IDs used to multi-tag result
mcm001 Aug 23, 2023
b7fb097
Update PhotonTrackingTypes.ts
mcm001 Aug 23, 2023
6a92beb
Update MultiTargetPNPResults.java
mcm001 Aug 23, 2023
34330fa
Fix atfl always being null
mcm001 Aug 24, 2023
1d22a23
Add apriltag import button
mcm001 Aug 30, 2023
e5a1eea
Only encode positive IDs
mcm001 Aug 30, 2023
494c0cc
Fix javadoc error
mcm001 Aug 30, 2023
341e358
Add tostring and stuff for result classes
mcm001 Aug 31, 2023
e9dacb7
Merge remote-tracking branch 'upstream/master' into multiag-pnp
mcm001 Sep 1, 2023
4bd8583
Fix merge conflicts & run lint
mcm001 Sep 1, 2023
0e4fa38
Add tooltip to multi-tag switch
mcm001 Sep 1, 2023
54a03b6
Merge branch 'master' into multiag-pnp
srimanachanta Sep 9, 2023
97c3d17
Add support to save all pipeline results in store
srimanachanta Sep 9, 2023
465b97a
add default field layout
srimanachanta Sep 9, 2023
e56ae83
Merge branch 'master' of https://github.com/PhotonVision/photonvision…
mcm001 Sep 23, 2023
a55cad8
Set apriltag layout over NT
mcm001 Sep 23, 2023
72eaf9b
Update PhotonCamera.java
mcm001 Sep 23, 2023
f03db7c
Formatting fixes
srimanachanta Sep 23, 2023
cf010dc
Merge branch 'master' into multiag-pnp
srimanachanta Sep 25, 2023
50d4267
Merge branch 'master' into multiag-pnp
srimanachanta Sep 27, 2023
f65f1c9
Add C++ photonlib support
mcm001 Sep 30, 2023
6523add
Update PhotonPipelineResult.h
mcm001 Sep 30, 2023
0ae2b49
?????
mcm001 Sep 30, 2023
a1f2447
Update photon-core/src/main/java/org/photonvision/common/configuratio…
mcm001 Oct 1, 2023
89aa79e
Update photon-core/src/main/java/org/photonvision/common/configuratio…
mcm001 Oct 1, 2023
d71a670
Merge branch 'master' into multiag-pnp
mcm001 Oct 1, 2023
e322fd1
Update photon-core/src/main/java/org/photonvision/vision/pipe/impl/Mu…
mcm001 Oct 1, 2023
fdcad62
Address code review
mcm001 Oct 1, 2023
34479ce
Add rather ugly view of multi tag solution
mcm001 Oct 1, 2023
45e9734
Fix photonlib build
mcm001 Oct 1, 2023
64b424c
Fix implicit cast in C++ land
mcm001 Oct 1, 2023
7ca017a
Run lint
mcm001 Oct 1, 2023
be92020
Run lint
mcm001 Oct 1, 2023
9573bef
Update TargetsTab.vue
mcm001 Oct 1, 2023
9f7882d
Merge branch 'master' into multiag-pnp
srimanachanta Oct 2, 2023
91ad713
Address review
mcm001 Oct 2, 2023
2d08030
Fix CI errors
mcm001 Oct 2, 2023
f5a5cfc
Update ApriltagControlCard.vue
mcm001 Oct 2, 2023
687d157
Update ApriltagControlCard.vue
mcm001 Oct 2, 2023
699f153
Lint again
mcm001 Oct 2, 2023
234b2bd
yeet the print
mcm001 Oct 2, 2023
47d5b9c
Switch to int16s for multi-target
mcm001 Oct 3, 2023
2823171
Merge remote-tracking branch 'upstream/master' into multiag-pnp
mcm001 Oct 8, 2023
2aa95e3
Fix merge conflictsr
mcm001 Oct 8, 2023
63279ef
Add some comments?
mcm001 Oct 8, 2023
5ee7fdf
The definition of insanity is writing the same code twice and expecti…
mcm001 Oct 8, 2023
3980e66
switch width to meters
mcm001 Oct 8, 2023
3ed1d7f
Merge remote-tracking branch 'upstream/master' into multiag-pnp
mcm001 Oct 8, 2023
a6d53ac
Update RequestHandler.java
mcm001 Oct 9, 2023
d00e4bd
Merge branch 'master' into pr/816
amquake Oct 10, 2023
4afb772
Merge branch 'master' into multiag-pnp
amquake Oct 10, 2023
648b0ec
Merge branch 'master' into multiag-pnp
mcm001 Oct 10, 2023
16fc61f
remove unused nativeposeest flag
amquake Oct 11, 2023
7f3f4ce
filter used IDs to tag layout
amquake Oct 11, 2023
577c89f
allow disabling single-tag when multi-tag used
amquake Oct 11, 2023
23626ea
doSingleTargetAlways ui switch
amquake Oct 11, 2023
2e4e0ce
make sure multitag targets are valid
amquake Oct 11, 2023
82dfb56
ensure tvec/rvec is null when tag estimate is null
amquake Oct 11, 2023
12221a5
format
amquake Oct 11, 2023
a883fcb
Merge branch 'master' into multiag-pnp
srimanachanta Oct 11, 2023
2bd6dd4
Merge branch 'master' into multiag-pnp
srimanachanta Oct 12, 2023
f0368c7
find camera-to-tag for multitarget tags
amquake Oct 14, 2023
56df1b2
Run lint
mcm001 Oct 14, 2023
75bf4ae
hide multitag ambiguity
amquake Oct 15, 2023
b23677b
format
amquake Oct 15, 2023
dffecaf
Merge branch 'master' into multiag-pnp
amquake Oct 15, 2023
cd351f6
Merge remote-tracking branch 'upstream' into multiag-pnp
mcm001 Oct 15, 2023
f44aa75
Run lint and fix imports
mcm001 Oct 15, 2023
77c0502
Merge branch 'master' into multiag-pnp
srimanachanta Oct 17, 2023
cb40a4d
Update CameraSettingsStore.ts
mcm001 Oct 17, 2023
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ fabric.properties
**/.settings
**/.classpath
**/.project
**/settings
**/dependency-reduced-pom.xml
# photon-server/photon-vision.iml

Expand Down
2 changes: 1 addition & 1 deletion photon-client/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const websocket = new AutoReconnectingWebsocket(
useSettingsStore().updateMetricsFromWebsocket(data.metrics);
}
if (data.updatePipelineResult !== undefined) {
useStateStore().updatePipelineResultsFromWebsocket(data.updatePipelineResult);
useStateStore().updateBackendResultsFromWebsocket(data.updatePipelineResult);
}
if (data.mutatePipelineSettings !== undefined && data.cameraIndex !== undefined) {
useCameraSettingsStore().changePipelineSettingsInStore(data.mutatePipelineSettings, data.cameraIndex);
Expand Down
2 changes: 1 addition & 1 deletion photon-client/src/components/app/photon-log-view.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ document.addEventListener("keydown", (e) => {
</v-btn>
</v-btn-toggle>
<v-card-text v-if="logs.length === 0" style="font-size: 18px; font-weight: 600">
There are no Logs to show
There are no logs to show
</v-card-text>
<v-virtual-scroll v-else :items="logs" item-height="50" height="600">
<template #default="{ item }">
Expand Down
6 changes: 3 additions & 3 deletions photon-client/src/components/cameras/CamerasView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const driverMode = computed<boolean>({
});

const fpsTooLow = computed<boolean>(() => {
const currFPS = useStateStore().pipelineResults?.fps || 0;
const currFPS = useStateStore().currentPipelineResults?.fps || 0;
const targetFPS = useCameraSettingsStore().currentVideoFormat.fps;
const driverMode = useCameraSettingsStore().isDriverMode;
const gpuAccel = useSettingsStore().general.gpuAcceleration !== undefined;
Expand Down Expand Up @@ -58,8 +58,8 @@ const fpsTooLow = computed<boolean>(() => {
style="font-size: 1rem; padding: 0; margin: 0"
>
<span class="pr-1">
{{ Math.round(useStateStore().pipelineResults?.fps || 0) }}&nbsp;FPS &ndash;
{{ Math.min(Math.round(useStateStore().pipelineResults?.latency || 0), 9999) }} ms latency
{{ Math.round(useStateStore().currentPipelineResults?.fps || 0) }}&nbsp;FPS &ndash;
{{ Math.min(Math.round(useStateStore().currentPipelineResults?.latency || 0), 9999) }} ms latency
</span>
</v-chip>
</div>
Expand Down
6 changes: 3 additions & 3 deletions photon-client/src/components/dashboard/CamerasCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const driverMode = computed<boolean>({
});

const fpsTooLow = computed<boolean>(() => {
const currFPS = useStateStore().pipelineResults?.fps || 0;
const currFPS = useStateStore().currentPipelineResults?.fps || 0;
const targetFPS = useCameraSettingsStore().currentVideoFormat.fps;
const driverMode = useCameraSettingsStore().isDriverMode;
const gpuAccel = useSettingsStore().general.gpuAcceleration !== undefined;
Expand All @@ -46,7 +46,7 @@ const fpsTooLow = computed<boolean>(() => {
style="font-size: 1rem; padding: 0; margin: 0"
>
<span class="pr-1">
Processing @ {{ Math.round(useStateStore().pipelineResults?.fps || 0) }}&nbsp;FPS &ndash;
Processing @ {{ Math.round(useStateStore().currentPipelineResults?.fps || 0) }}&nbsp;FPS &ndash;
</span>
<span
v-if="
Expand All @@ -61,7 +61,7 @@ const fpsTooLow = computed<boolean>(() => {
stop viewing the raw stream for better performance
</span>
<span v-else>
{{ Math.min(Math.round(useStateStore().pipelineResults?.latency || 0), 9999) }} ms latency
{{ Math.min(Math.round(useStateStore().currentPipelineResults?.latency || 0), 9999) }} ms latency
</span>
</v-chip>
</div>
Expand Down
2 changes: 1 addition & 1 deletion photon-client/src/components/dashboard/tabs/Map3DTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { PhotonTarget } from "@/types/PhotonTrackingTypes";
import { useStateStore } from "@/stores/StateStore";
import Photon3dVisualizer from "@/components/app/photon-3d-visualizer.vue";

const trackedTargets = computed<PhotonTarget[]>(() => useStateStore().pipelineResults?.targets || []);
const trackedTargets = computed<PhotonTarget[]>(() => useStateStore().currentPipelineResults?.targets || []);
</script>

<template>
Expand Down
28 changes: 27 additions & 1 deletion photon-client/src/components/dashboard/tabs/OutputTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ const offsetPoints = computed<MetricItem[]>(() => {
}
});

const currentPipelineSettings = useCameraSettingsStore().currentPipelineSettings;

const interactiveCols = computed(
() =>
(getCurrentInstance()?.proxy.$vuetify.breakpoint.mdAndDown || false) &&
Expand Down Expand Up @@ -75,13 +77,37 @@ const interactiveCols = computed(
<cv-switch
v-model="useCameraSettingsStore().currentPipelineSettings.outputShowMultipleTargets"
label="Show Multiple Targets"
tooltip="If enabled, up to five targets will be displayed and sent to user code, instead of just one"
tooltip="If enabled, up to five targets will be displayed and sent via PhotonLib, instead of just one"
:disabled="isTagPipeline"
:switch-cols="interactiveCols"
@input="
(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ outputShowMultipleTargets: value }, false)
"
/>
<cv-switch
v-if="
currentPipelineSettings.pipelineType === PipelineType.AprilTag &&
useCameraSettingsStore().isCurrentVideoFormatCalibrated
"
v-model="currentPipelineSettings.doMultiTarget"
label="Do Multi-Target Estimation"
tooltip="If enabled, all visible fiducial targets will be used to provide a single pose estimate from their combined model."
:switch-cols="interactiveCols"
:disabled="!isTagPipeline"
@input="(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ doMultiTarget: value }, false)"
/>
<cv-switch
v-if="
currentPipelineSettings.pipelineType === PipelineType.AprilTag &&
useCameraSettingsStore().isCurrentVideoFormatCalibrated
"
v-model="currentPipelineSettings.doSingleTargetAlways"
label="Always Do Single-Target Estimation"
tooltip="If disabled, visible fiducial targets used for multi-target estimation will not also be used for single-target estimation."
:switch-cols="interactiveCols"
:disabled="!isTagPipeline || !currentPipelineSettings.doMultiTarget"
@input="(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ doSingleTargetAlways: value }, false)"
/>
<v-divider />
<table
v-if="useCameraSettingsStore().currentPipelineSettings.offsetRobotOffsetMode !== RobotOffsetPointMode.None"
Expand Down
34 changes: 28 additions & 6 deletions photon-client/src/components/dashboard/tabs/TargetsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ import { useStateStore } from "@/stores/StateStore";
<div>
<v-row align="start" class="pb-4" style="height: 300px">
<!-- Simple table height must be set here and in the CSS for the fixed-header to work -->
<v-simple-table fixed-header height="100%" dense dark>
<v-simple-table fixed-header dense dark>
<template #default>
<thead style="font-size: 1.25rem">
<tr>
<th class="text-center">Target Count</th>
<th
v-if="
useCameraSettingsStore().currentPipelineType === PipelineType.AprilTag ||
Expand Down Expand Up @@ -44,8 +43,7 @@ import { useStateStore } from "@/stores/StateStore";
</tr>
</thead>
<tbody>
<tr v-for="(target, index) in useStateStore().pipelineResults?.targets" :key="index">
<td>{{ index }}</td>
<tr v-for="(target, index) in useStateStore().currentPipelineResults?.targets" :key="index">
<td
v-if="
useCameraSettingsStore().currentPipelineType === PipelineType.AprilTag ||
Expand All @@ -63,21 +61,45 @@ import { useStateStore } from "@/stores/StateStore";
<template v-else-if="useCameraSettingsStore().currentPipelineSettings.solvePNPEnabled">
<td>{{ target.pose?.x.toFixed(2) }}&nbsp;m</td>
<td>{{ target.pose?.y.toFixed(2) }}&nbsp;m</td>
<td>{{ ((target.pose?.angle_z * 180.0) / Math.PI).toFixed(2) }}&deg;</td>
<td>{{ (((target.pose?.angle_z || 0) * 180.0) / Math.PI).toFixed(2) }}&deg;</td>
</template>
<template
v-if="
useCameraSettingsStore().currentPipelineType === PipelineType.AprilTag &&
useCameraSettingsStore().currentPipelineSettings.solvePNPEnabled
"
>
<td>{{ target.ambiguity?.toFixed(2) }}%</td>
<td>{{ target.ambiguity >= 0 ? target.ambiguity?.toFixed(2) + "%" : "(In Multi-Target)" }}</td>
</template>
</tr>
</tbody>
</template>
</v-simple-table>
</v-row>
<v-row
v-if="
useCameraSettingsStore().currentPipelineSettings.pipelineType === PipelineType.AprilTag &&
useCameraSettingsStore().currentPipelineSettings.doMultiTarget
"
align="start"
class="pb-4 white--text"
>
<v-card-subtitle>Multi-tag pose, field-to-camera</v-card-subtitle>
<v-simple-table fixed-header height="100%" dense dark>
<thead style="font-size: 1.25rem">
<th class="text-center">X meters</th>
<th class="text-center">Y meters</th>
<th class="text-center">Z Angle &theta;&deg;</th>
<th class="text-center">Tags</th>
</thead>
<tbody>
<td>{{ useStateStore().currentPipelineResults?.multitagResult?.bestTransform.x.toFixed(2) }}</td>
<td>{{ useStateStore().currentPipelineResults?.multitagResult?.bestTransform.y.toFixed(2) }}</td>
<td>{{ useStateStore().currentPipelineResults?.multitagResult?.bestTransform.angle_z.toFixed(2) }}</td>
<td>{{ useStateStore().currentPipelineResults?.multitagResult?.fiducialIDsUsed }}</td>
</tbody>
</v-simple-table>
</v-row>
</div>
</template>

Expand Down
93 changes: 93 additions & 0 deletions photon-client/src/components/settings/ApriltagControlCard.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<script setup lang="ts">
import { useSettingsStore } from "@/stores/settings/GeneralSettingsStore";
import { Euler, Quaternion as ThreeQuat } from "three";
import type { Quaternion } from "@/types/PhotonTrackingTypes";

const quatToEuler = (quat: Quaternion): Euler => {
const three_quat = new ThreeQuat(quat.X, quat.Y, quat.Z, quat.W);
return new Euler().setFromQuaternion(three_quat, "ZYX");
};

// Convert from radians to degrees.
const degrees = (radians: number): number => (radians * 180) / Math.PI;
</script>

<template>
<v-card dark class="mb-3 pr-6 pb-3" style="background-color: #006492">
<v-card-title>Apriltag Layout</v-card-title>
<div class="ml-5">
<p>Field width: {{ useSettingsStore().currentFieldLayout.field.width.toFixed(2) }} meters</p>
<p>Field length: {{ useSettingsStore().currentFieldLayout.field.length.toFixed(2) }} meters</p>

<!-- Simple table height must be set here and in the CSS for the fixed-header to work -->
<v-simple-table fixed-header height="100%" dense dark>
<template #default>
<thead style="font-size: 1.25rem">
<tr>
<th class="text-center">ID</th>
<th class="text-center">X, meters</th>
<th class="text-center">Y, meters</th>
<th class="text-center">Z, meters</th>
<th class="text-center">θ<sub>x</sub> angle, &deg;</th>
<th class="text-center">θ<sub>y</sub> angle, &deg;</th>
<th class="text-center">θ<sub>z</sub> angle, &deg;</th>
</tr>
</thead>
<tbody>
<tr v-for="(tag, index) in useSettingsStore().currentFieldLayout.tags" :key="index">
<td>{{ tag.ID }}</td>
<td v-for="(val, idx) in Object.values(tag.pose.translation).slice(0, 3).map(degrees)" :key="idx">
{{ val.toFixed(2) }}
</td>
<td
v-for="(val, idx) in Object.values(quatToEuler(tag.pose.rotation.quaternion)).slice(0, 3).map(degrees)"
:key="idx"
>
{{ val.toFixed(2) }}
</td>
</tr>
</tbody>
</template>
</v-simple-table>
</div>
</v-card>
</template>

<style scoped lang="scss">
.v-data-table {
width: 100%;
height: 100%;
text-align: center;
background-color: #006492 !important;

th,
td {
background-color: #006492 !important;
font-size: 1rem !important;
}

td {
font-family: monospace !important;
}

tbody :hover td {
background-color: #005281 !important;
}

::-webkit-scrollbar {
width: 0;
height: 0.55em;
border-radius: 5px;
}

::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
border-radius: 10px;
}

::-webkit-scrollbar-thumb {
background-color: #ffd843;
border-radius: 10px;
}
}
</style>
14 changes: 12 additions & 2 deletions photon-client/src/components/settings/DeviceControlCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ enum ImportType {
AllSettings,
HardwareConfig,
HardwareSettings,
NetworkConfig
NetworkConfig,
ApriltagFieldLayout
}
const showImportDialog = ref(false);
const importType = ref<ImportType | number>(-1);
Expand All @@ -157,6 +158,9 @@ const handleSettingsImport = () => {
case ImportType.NetworkConfig:
settingsEndpoint = "/networkConfig";
break;
case ImportType.ApriltagFieldLayout:
settingsEndpoint = "/aprilTagFieldLayout";
break;
default:
case ImportType.AllSettings:
settingsEndpoint = "";
Expand Down Expand Up @@ -249,7 +253,13 @@ const handleSettingsImport = () => {
v-model="importType"
label="Type"
tooltip="Select the type of settings file you are trying to upload"
:items="['All Settings', 'Hardware Config', 'Hardware Settings', 'Network Config']"
:items="[
'All Settings',
'Hardware Config',
'Hardware Settings',
'Network Config',
'Apriltag Layout'
]"
:select-cols="10"
style="width: 100%"
/>
Expand Down
4 changes: 2 additions & 2 deletions photon-client/src/components/settings/MetricsCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ const fetchMetrics = () => {
if (error.request) {
useStateStore().showSnackbarMessage({
color: "error",
message: "Unable to fetch Metrics! The backend didn't respond."
message: "Unable to fetch metrics! The backend didn't respond."
});
} else {
useStateStore().showSnackbarMessage({
color: "error",
message: "An error occurred while trying to fetch Metrics."
message: "An error occurred while trying to fetch metrics."
});
}
})
Expand Down
20 changes: 12 additions & 8 deletions photon-client/src/stores/StateStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface StateStore {
logMessages: LogMessage[];
currentCameraIndex: number;

pipelineResults?: PipelineResult;
backendResults: Record<string, PipelineResult>;

colorPickingMode: boolean;

Expand Down Expand Up @@ -58,7 +58,7 @@ export const useStateStore = defineStore("state", {
logMessages: [],
currentCameraIndex: 0,

pipelineResults: undefined,
backendResults: {},

colorPickingMode: false,

Expand All @@ -77,6 +77,11 @@ export const useStateStore = defineStore("state", {
}
};
},
getters: {
currentPipelineResults(): PipelineResult | undefined {
return this.backendResults[this.currentCameraIndex.toString()];
}
},
actions: {
setSidebarFolded(value: boolean) {
this.sidebarFolded = value;
Expand All @@ -95,12 +100,11 @@ export const useStateStore = defineStore("state", {
clients: data.clients
};
},
updatePipelineResultsFromWebsocket(data: WebsocketPipelineResultUpdate) {
for (const cameraIndex in data) {
if (parseInt(cameraIndex) === this.currentCameraIndex) {
this.pipelineResults = data[cameraIndex];
}
}
updateBackendResultsFromWebsocket(data: WebsocketPipelineResultUpdate) {
this.backendResults = {
...this.backendResults,
...data
};
mcm001 marked this conversation as resolved.
Show resolved Hide resolved
},
updateCalibrationStateValuesFromWebsocket(data: WebsocketCalibrationData) {
this.calibrationData = {
Expand Down
Loading