Record standard deviations for multi-tag pose (#1019)

* Record standard deviations for multi-tag pose

* Add XYZ translation and angle to stdev uI

* create multitag result buffer in store

allows results to be stored in the background

* simplify logic in targeting tab

also adds a reset button

* Formatting fixes

* convert rad angles to deg

---------

Co-authored-by: Sriman Achanta <68172138+srimanachanta@users.noreply.github.com>
This commit is contained in:
Matt
2023-12-19 15:47:53 -05:00
committed by GitHub
parent 796b8e73d5
commit 954ca9a577
4 changed files with 142 additions and 30 deletions

View File

@@ -1,7 +1,7 @@
import { defineStore } from "pinia";
import type { LogMessage } from "@/types/SettingTypes";
import type { AutoReconnectingWebsocket } from "@/lib/AutoReconnectingWebsocket";
import type { PipelineResult } from "@/types/PhotonTrackingTypes";
import type { MultitagResult, PipelineResult } from "@/types/PhotonTrackingTypes";
import type {
WebsocketCalibrationData,
WebsocketLogMessage,
@@ -25,6 +25,7 @@ interface StateStore {
currentCameraIndex: number;
backendResults: Record<string, PipelineResult>;
multitagResultBuffer: Record<string, MultitagResult[]>;
colorPickingMode: boolean;
@@ -59,6 +60,7 @@ export const useStateStore = defineStore("state", {
currentCameraIndex: 0,
backendResults: {},
multitagResultBuffer: {},
colorPickingMode: false,
@@ -80,6 +82,9 @@ export const useStateStore = defineStore("state", {
getters: {
currentPipelineResults(): PipelineResult | undefined {
return this.backendResults[this.currentCameraIndex.toString()];
},
currentMultitagBuffer(): MultitagResult[] | undefined {
return this.multitagResultBuffer[this.currentCameraIndex.toString()];
}
},
actions: {
@@ -105,6 +110,21 @@ export const useStateStore = defineStore("state", {
...this.backendResults,
...data
};
for (const key in data) {
const multitagRes = data[key].multitagResult;
if (multitagRes) {
if (!this.multitagResultBuffer[key]) {
this.multitagResultBuffer[key] = [];
}
this.multitagResultBuffer[key].push(multitagRes);
if (this.multitagResultBuffer[key].length > 100) {
this.multitagResultBuffer[key].shift();
}
}
}
},
updateCalibrationStateValuesFromWebsocket(data: WebsocketCalibrationData) {
this.calibrationData = {