Refactors and adds new mode concept

This commit is contained in:
Rune Harlyk
2024-02-24 01:50:05 +01:00
committed by Rune Harlyk
parent e6296555da
commit 0f676e3543
20 changed files with 244 additions and 177 deletions
+1
View File
@@ -1,2 +1,3 @@
export * from './socket-store';
export * from './logging-store';
export * from './model-store';
+24
View File
@@ -0,0 +1,24 @@
import type { ControllerInput } from '$lib/models';
import { persistentStore } from '$lib/utilities';
import { writable, type Writable } from 'svelte/store';
export const emulateModel = writable(true);
export const jointNames = persistentStore('joint_names', []);
export const model = writable();
export const modes = ['idle', 'stand', 'walk'] as const;
export type Modes = (typeof modes)[number];
export const mode: Writable<Modes> = writable('idle');
export const outControllerData = writable(new Int8Array([0, 0, 0, 0, 0, 70, 0]));
export const input: Writable<ControllerInput> = writable({
left: { x: 0, y: 0 },
right: { x: 0, y: 0 },
height: 70,
speed: 0
});