🪓 Moves model loading to own file

This commit is contained in:
Rune Harlyk
2024-02-05 23:05:34 +01:00
parent f562d1c1e0
commit bfcf2d4865
5 changed files with 51 additions and 35 deletions
+6 -1
View File
@@ -9,11 +9,16 @@
import FileCache from './lib/cache';
import { socketLocation } from './lib/location';
import Settings from './routes/Settings.svelte';
import { jointNames, model } from './lib/store';
import { loadModelAsync } from './lib/modelLoader';
export let url = window.location.pathname
onMount(() => {
onMount(async () => {
connect(socketLocation);
registerFetchIntercept()
const [urdf, JOINT_NAME] = await loadModelAsync('/spot_micro.urdf.xacro')
jointNames.set(JOINT_NAME)
model.set(urdf)
});
const registerFetchIntercept = () => {