From e27f77619f522f20ff602827313098c70de80af0 Mon Sep 17 00:00:00 2001 From: Sriman Achanta <68172138+srimanachanta@users.noreply.github.com> Date: Fri, 29 Dec 2023 19:13:33 -0500 Subject: [PATCH] typing nit --- .../stores/settings/CameraSettingsStore.ts | 1 - .../src/types/PhotonTrackingTypes.ts | 41 +++++++++++-------- photon-client/src/types/SettingTypes.ts | 6 +-- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/photon-client/src/stores/settings/CameraSettingsStore.ts b/photon-client/src/stores/settings/CameraSettingsStore.ts index e47489f1af..968f3eea1d 100644 --- a/photon-client/src/stores/settings/CameraSettingsStore.ts +++ b/photon-client/src/stores/settings/CameraSettingsStore.ts @@ -3,7 +3,6 @@ import type { CalibrationBoardTypes, CameraSettings, ConfigurableCameraSettings, - Resolution, RobotOffsetType, VideoFormat } from "@/types/SettingTypes"; diff --git a/photon-client/src/types/PhotonTrackingTypes.ts b/photon-client/src/types/PhotonTrackingTypes.ts index c5589dc0ab..4ba79ad2d6 100644 --- a/photon-client/src/types/PhotonTrackingTypes.ts +++ b/photon-client/src/types/PhotonTrackingTypes.ts @@ -1,3 +1,26 @@ +export interface Quaternion { + X: number; + Y: number; + Z: number; + W: number; +} + +export interface Translation3d { + x: number + y: number + z: number +} + +export interface Rotation3d { + quaternion: Quaternion +} + +export interface Pose3d { + translation: Translation3d, + rotation: Rotation3d +} + +// TODO update backend to serialize this using correct layout export interface Transform3d { x: number; y: number; @@ -11,13 +34,6 @@ export interface Transform3d { angle_z: number; } -export interface Quaternion { - X: number; - Y: number; - Z: number; - W: number; -} - export interface AprilTagFieldLayout { field: { length: number; @@ -25,16 +41,7 @@ export interface AprilTagFieldLayout { }; tags: { ID: number; - pose: { - translation: { - x: number; - y: number; - z: number; - }; - rotation: { - quaternion: Quaternion; - }; - }; + pose: Pose3d; }[]; } diff --git a/photon-client/src/types/SettingTypes.ts b/photon-client/src/types/SettingTypes.ts index a8f59782f2..3db2d3f043 100644 --- a/photon-client/src/types/SettingTypes.ts +++ b/photon-client/src/types/SettingTypes.ts @@ -1,4 +1,5 @@ import { type ActivePipelineSettings, DefaultAprilTagPipelineSettings } from "@/types/PipelineTypes"; +import type { Pose3d } from "@/types/PhotonTrackingTypes"; export interface GeneralSettings { version?: string; @@ -107,11 +108,6 @@ export interface CvPoint { y: number; } -export interface Pose3d { - translation: { x: number; y: number; z: number }; - rotation: { quaternion: { W: number; X: number; Y: number; Z: number } }; -} - export interface BoardObservation { locationInObjectSpace: CvPoint3[]; locationInImageSpace: CvPoint[];