Skip to content

Commit

Permalink
Run lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm001 committed Oct 1, 2023
1 parent 64b424c commit 7ca017a
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 8 deletions.
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
4 changes: 1 addition & 3 deletions photon-client/src/components/dashboard/tabs/TargetsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ import { useStateStore } from "@/stores/StateStore";
</template>
</v-simple-table>
</v-row>
<p class="white--text">
Estimated multi-tag pose: {{ useStateStore().currentPipelineResults?.multitagResult }}
</p>
<p class="white--text">Estimated multi-tag pose: {{ useStateStore().currentPipelineResults?.multitagResult }}</p>
</div>
</template>
Expand Down
95 changes: 95 additions & 0 deletions photon-client/src/components/settings/ApriltagControlCard.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<script setup lang="ts">
import CvSlider from "@/components/common/cv-slider.vue";

Check warning on line 2 in photon-client/src/components/settings/ApriltagControlCard.vue

View workflow job for this annotation

GitHub Actions / photonclient-check-lint

'CvSlider' is defined but never used
import { useCameraSettingsStore } from "@/stores/settings/CameraSettingsStore";

Check warning on line 3 in photon-client/src/components/settings/ApriltagControlCard.vue

View workflow job for this annotation

GitHub Actions / photonclient-check-lint

'useCameraSettingsStore' is defined but never used
import { useStateStore } from "@/stores/StateStore";

Check warning on line 4 in photon-client/src/components/settings/ApriltagControlCard.vue

View workflow job for this annotation

GitHub Actions / photonclient-check-lint

'useStateStore' is defined but never used
import { useSettingsStore } from "@/stores/settings/GeneralSettingsStore";
import { Euler, Quaternion } from "three";
function quatToEuler(quat) {
console.log(quat);
quat = new Quaternion(quat.X, quat.Y, quat.Z, quat.W);
return new Euler().setFromQuaternion(quat, "ZYX");
}
// Convert from radians to degrees.
const degrees = function (radians) {
return (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 * 3.28084).toFixed(2) }} ft</p>
<p>Field length: {{ (useSettingsStore().currentFieldLayout.field.length * 3.28084).toFixed(2) }} ft</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, m</th>
<th class="text-center">Y, m</th>
<th class="text-center">Z, m</th>
<th class="text-center">θ<sub>x</sub>, &deg;</th>
<th class="text-center">θ<sub>y</sub>, &deg;</th>
<th class="text-center">θ<sub>z</sub>, &deg;</th>
</tr>
</thead>
<tbody>
<tr v-for="(tag, index) in useSettingsStore().currentFieldLayout.tags" :key="index">
<td>{{ tag.ID }}</td>
<td>{{ tag.pose.translation.x.toFixed(2) }}</td>
<td>{{ tag.pose.translation.y.toFixed(2) }}</td>
<td>{{ tag.pose.translation.z.toFixed(2) }}</td>
<td>{{ degrees(quatToEuler(tag.pose.rotation.quaternion).x).toFixed(2) }}&deg;</td>
<td>{{ degrees(quatToEuler(tag.pose.rotation.quaternion).y).toFixed(2) }}&deg;</td>
<td>{{ degrees(quatToEuler(tag.pose.rotation.quaternion).z).toFixed(2) }}&deg;</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>
8 changes: 4 additions & 4 deletions photon-client/src/types/PhotonTrackingTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ export interface Transform3d {
}

export interface Quaternion {
X: number;
Y: number;
Z: number;
W: number;
X: number;
Y: number;
Z: number;
W: number;
}

export interface AprilTagFieldLayout {
Expand Down

0 comments on commit 7ca017a

Please sign in to comment.