-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
72 changed files
with
1,707 additions
and
1,800 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
photon-client/src/components/settings/ApriltagControlCard.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, °</th> | ||
<th class="text-center">θ<sub>y</sub> angle, °</th> | ||
<th class="text-center">θ<sub>z</sub> angle, °</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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.