Skip to content

Commit

Permalink
Address review
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm001 committed Oct 2, 2023
1 parent 9f7882d commit 91ad713
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 22 deletions.
13 changes: 10 additions & 3 deletions photon-client/src/components/dashboard/tabs/TargetsTab.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { useCameraSettingsStore } from "@/stores/settings/CameraSettingsStore";
import { PipelineType } from "@/types/PipelineTypes";
import { DefaultAprilTagPipelineSettings, PipelineType } from "@/types/PipelineTypes";

Check warning on line 3 in photon-client/src/components/dashboard/tabs/TargetsTab.vue

View workflow job for this annotation

GitHub Actions / photonclient-check-lint

'DefaultAprilTagPipelineSettings' is defined but never used
import { useStateStore } from "@/stores/StateStore";
</script>

Expand Down Expand Up @@ -76,8 +76,15 @@ import { useStateStore } from "@/stores/StateStore";
</template>
</v-simple-table>
</v-row>
<v-row align="start" class="pb-4 white--text">
<span>Multi-tag pose, field-to-robot</span>
<v-row
align="start"
class="pb-4 white--text"
v-if="
useCameraSettingsStore().currentPipelineSettings.pipelineType === PipelineType.AprilTag &&
useCameraSettingsStore().currentPipelineSettings.doMultiTarget
"
>
<v-card-subtitle>Multi-tag pose, field-to-robot</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>
Expand Down
36 changes: 17 additions & 19 deletions photon-client/src/components/settings/ApriltagControlCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@ import { useStateStore } from "@/stores/StateStore";
import { useSettingsStore } from "@/stores/settings/GeneralSettingsStore";
import { Euler, Quaternion } from "three";
function quatToEuler(quat) {
const quatToEuler = (quat: { X: number; Y: number; Z: number; W: number }): Euler => {
console.log(quat);
quat = new Quaternion(quat.X, quat.Y, quat.Z, quat.W);
return new Euler().setFromQuaternion(quat, "ZYX");
}
const three_quat = new Quaternion(quat.X, quat.Y, quat.Z, quat.W);
return new Euler().setFromQuaternion(three_quat, "ZYX");
};
// Convert from radians to degrees.
const degrees = function (radians) {
return (radians * 180) / Math.PI;
};
const degrees = (radians: number): number => (radians * 180) / Math.PI;
</script>

<template>
Expand All @@ -30,23 +28,23 @@ const degrees = function (radians) {
<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>
<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>{{ 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>
<td v-for="val in Object.values(tag.pose.translation).slice(0, 3).map(degrees)">

Check failure on line 42 in photon-client/src/components/settings/ApriltagControlCard.vue

View workflow job for this annotation

GitHub Actions / photonclient-check-lint

Elements in iteration expect to have 'v-bind:key' directives
{{ val.toFixed(2) }}
</td>
<td v-for="val in Object.values(quatToEuler(tag.pose.rotation.quaternion)).slice(0, 3).map(degrees)">

Check failure on line 45 in photon-client/src/components/settings/ApriltagControlCard.vue

View workflow job for this annotation

GitHub Actions / photonclient-check-lint

Elements in iteration expect to have 'v-bind:key' directives
{{ val.toFixed(2) }}
</td>
</tr>
</tbody>
</template>
Expand Down
1 change: 1 addition & 0 deletions photon-client/src/types/PipelineTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ export type ActivePipelineSettings =
| ColoredShapePipelineSettings
| AprilTagPipelineSettings
| ArucoPipelineSettings;

export type ActiveConfigurablePipelineSettings =
| ConfigurableReflectivePipelineSettings
| ConfigurableColoredShapePipelineSettings
Expand Down

0 comments on commit 91ad713

Please sign in to comment.