@viamrobotics/motion-tools 0.8.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/App.svelte +1 -1
- package/dist/components/Camera.svelte +16 -17
- package/dist/components/CameraControls.svelte +5 -4
- package/dist/components/Details.svelte +1 -1
- package/dist/components/Focus.svelte +1 -1
- package/dist/components/Label.svelte +25 -0
- package/dist/components/Label.svelte.d.ts +6 -0
- package/dist/components/Labels.svelte +0 -0
- package/dist/components/{Frames.svelte.d.ts → Labels.svelte.d.ts} +14 -6
- package/dist/components/Line.svelte +5 -2
- package/dist/components/Line.svelte.d.ts +2 -0
- package/dist/components/Pointcloud.svelte +4 -1
- package/dist/components/Pointcloud.svelte.d.ts +2 -0
- package/dist/components/RefreshRate.svelte +4 -4
- package/dist/components/Scene.svelte +3 -6
- package/dist/components/SceneProviders.svelte +4 -4
- package/dist/components/Selected.svelte +5 -1
- package/dist/components/Tree/Settings.svelte +37 -17
- package/dist/components/Tree/TreeContainer.svelte +1 -1
- package/dist/components/WorldObjects.svelte +131 -0
- package/dist/components/{Shapes.svelte.d.ts → WorldObjects.svelte.d.ts} +3 -3
- package/dist/components/dashboard/Dashboard.svelte +1 -1
- package/dist/hooks/{useShapes.svelte.d.ts → useDrawAPI.svelte.d.ts} +3 -2
- package/dist/hooks/{useShapes.svelte.js → useDrawAPI.svelte.js} +8 -5
- package/dist/hooks/useFrames.svelte.js +2 -13
- package/dist/hooks/useGeometries.svelte.js +22 -17
- package/dist/hooks/useMachineSettings.svelte.d.ts +8 -0
- package/dist/hooks/useMachineSettings.svelte.js +40 -0
- package/dist/hooks/useObjects.svelte.js +8 -8
- package/dist/hooks/usePointclouds.svelte.js +28 -21
- package/dist/hooks/usePose.svelte.js +3 -3
- package/dist/hooks/usePoses.svelte.js +2 -2
- package/dist/hooks/useSettings.svelte.d.ts +1 -0
- package/dist/hooks/useSettings.svelte.js +1 -0
- package/package.json +31 -31
- package/dist/components/Frames.svelte +0 -54
- package/dist/components/Pointclouds.svelte +0 -21
- package/dist/components/Pointclouds.svelte.d.ts +0 -18
- package/dist/components/Shapes.svelte +0 -54
- package/dist/hooks/useRefreshRates.svelte.d.ts +0 -5
- package/dist/hooks/useRefreshRates.svelte.js +0 -23
|
@@ -5,7 +5,7 @@ import { parsePcdInWorker } from '../loaders/pcd';
|
|
|
5
5
|
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
6
6
|
import { BatchedArrow } from '../three/BatchedArrow';
|
|
7
7
|
import { WorldObject } from '../WorldObject';
|
|
8
|
-
const key = Symbol('
|
|
8
|
+
const key = Symbol('draw-api-context-key');
|
|
9
9
|
const tryParse = (json) => {
|
|
10
10
|
try {
|
|
11
11
|
return JSON.parse(json);
|
|
@@ -31,7 +31,7 @@ class Float32Reader {
|
|
|
31
31
|
return result;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
export const
|
|
34
|
+
export const provideDrawAPI = () => {
|
|
35
35
|
let pointsIndex = 0;
|
|
36
36
|
let geometryIndex = 0;
|
|
37
37
|
let poseIndex = 0;
|
|
@@ -44,7 +44,7 @@ export const provideShapes = () => {
|
|
|
44
44
|
const poses = $state([]);
|
|
45
45
|
const nurbs = $state([]);
|
|
46
46
|
const models = $state([]);
|
|
47
|
-
let camera = $state();
|
|
47
|
+
let camera = $state.raw();
|
|
48
48
|
let connectionStatus = $state('connecting');
|
|
49
49
|
const color = new Color();
|
|
50
50
|
const direction = new Vector3();
|
|
@@ -174,7 +174,7 @@ export const provideShapes = () => {
|
|
|
174
174
|
: {
|
|
175
175
|
color: new Color(r, g, b).convertLinearToSRGB(),
|
|
176
176
|
};
|
|
177
|
-
points.push(new WorldObject(label
|
|
177
|
+
points.push(new WorldObject(label, undefined, undefined, {
|
|
178
178
|
case: 'points',
|
|
179
179
|
value: positions,
|
|
180
180
|
}, metadata));
|
|
@@ -386,8 +386,11 @@ export const provideShapes = () => {
|
|
|
386
386
|
get camera() {
|
|
387
387
|
return camera;
|
|
388
388
|
},
|
|
389
|
+
clearCamera: () => {
|
|
390
|
+
camera = undefined;
|
|
391
|
+
},
|
|
389
392
|
});
|
|
390
393
|
};
|
|
391
|
-
export const
|
|
394
|
+
export const useDrawAPI = () => {
|
|
392
395
|
return getContext(key);
|
|
393
396
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { getContext, setContext, untrack } from 'svelte';
|
|
2
2
|
import { useRobotClient, createRobotQuery, useMachineStatus, useResourceNames, } from '@viamrobotics/svelte-sdk';
|
|
3
3
|
import { WorldObject } from '../WorldObject';
|
|
4
|
-
import { useRefreshRates } from './useRefreshRates.svelte';
|
|
5
4
|
import { observe } from '@threlte/core';
|
|
6
5
|
import { useLogs } from './useLogs.svelte';
|
|
7
6
|
import { resourceColors } from '../color';
|
|
@@ -11,24 +10,14 @@ export const provideFrames = (partID) => {
|
|
|
11
10
|
const client = useRobotClient(partID);
|
|
12
11
|
const machineStatus = useMachineStatus(partID);
|
|
13
12
|
const logs = useLogs();
|
|
14
|
-
const refreshRates = useRefreshRates();
|
|
15
|
-
if (!refreshRates.has('Frames')) {
|
|
16
|
-
refreshRates.set('Frames', 1);
|
|
17
|
-
}
|
|
18
13
|
const query = createRobotQuery(client, 'frameSystemConfig');
|
|
19
14
|
const revision = $derived(machineStatus.current?.config.revision);
|
|
20
|
-
const shouldFetch = $derived(refreshRates.get('Frames') === 1);
|
|
21
15
|
observe.pre(() => [revision], () => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
logs.add('Fetching frames...');
|
|
25
|
-
}
|
|
16
|
+
untrack(() => query.current).refetch();
|
|
17
|
+
logs.add('Fetching frames...');
|
|
26
18
|
});
|
|
27
19
|
const current = $derived.by(() => {
|
|
28
20
|
const objects = [];
|
|
29
|
-
if (!shouldFetch) {
|
|
30
|
-
return objects;
|
|
31
|
-
}
|
|
32
21
|
for (const { frame } of query.current.data ?? []) {
|
|
33
22
|
if (frame === undefined) {
|
|
34
23
|
continue;
|
|
@@ -3,7 +3,7 @@ import { createQueries, queryOptions } from '@tanstack/svelte-query';
|
|
|
3
3
|
import { createResourceClient, useResourceNames } from '@viamrobotics/svelte-sdk';
|
|
4
4
|
import { setContext, getContext } from 'svelte';
|
|
5
5
|
import { fromStore, toStore } from 'svelte/store';
|
|
6
|
-
import {
|
|
6
|
+
import { useMachineSettings } from './useMachineSettings.svelte';
|
|
7
7
|
import { WorldObject } from '../WorldObject';
|
|
8
8
|
import { usePersistentUUIDs } from './usePersistentUUIDs.svelte';
|
|
9
9
|
import { useLogs } from './useLogs.svelte';
|
|
@@ -15,7 +15,7 @@ export const provideGeometries = (partID) => {
|
|
|
15
15
|
const cameras = useResourceNames(partID, 'camera');
|
|
16
16
|
const grippers = useResourceNames(partID, 'gripper');
|
|
17
17
|
const logs = useLogs();
|
|
18
|
-
const refreshRates =
|
|
18
|
+
const { refreshRates } = useMachineSettings();
|
|
19
19
|
const armClients = $derived(arms.current.map((arm) => createResourceClient(ArmClient, partID, () => arm.name)));
|
|
20
20
|
const gripperClients = $derived(grippers.current.map((gripper) => createResourceClient(GripperClient, partID, () => gripper.name)));
|
|
21
21
|
const cameraClients = $derived(cameras.current.map((camera) => createResourceClient(CameraClient, partID, () => camera.name)));
|
|
@@ -23,22 +23,27 @@ export const provideGeometries = (partID) => {
|
|
|
23
23
|
if (!refreshRates.has('Geometries')) {
|
|
24
24
|
refreshRates.set('Geometries', 1000);
|
|
25
25
|
}
|
|
26
|
-
const options = $derived
|
|
26
|
+
const options = $derived.by(() => {
|
|
27
27
|
const interval = refreshRates.get('Geometries');
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
const results = [];
|
|
29
|
+
for (const client of clients) {
|
|
30
|
+
const options = queryOptions({
|
|
31
|
+
enabled: interval !== -1 && client.current !== undefined,
|
|
32
|
+
refetchInterval: interval === 0 ? false : interval,
|
|
33
|
+
queryKey: ['partID', partID(), client.current?.name, 'getGeometries'],
|
|
34
|
+
queryFn: async () => {
|
|
35
|
+
if (!client.current) {
|
|
36
|
+
throw new Error('No client');
|
|
37
|
+
}
|
|
38
|
+
logs.add(`Fetching geometries for ${client.current.name}...`);
|
|
39
|
+
const geometries = await client.current.getGeometries();
|
|
40
|
+
return { name: client.current.name, geometries };
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
results.push(options);
|
|
44
|
+
}
|
|
45
|
+
return results;
|
|
46
|
+
});
|
|
42
47
|
const { updateUUIDs } = usePersistentUUIDs();
|
|
43
48
|
const queries = fromStore(createQueries({ queries: toStore(() => options) }));
|
|
44
49
|
const geometries = $derived.by(() => {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SvelteMap } from 'svelte/reactivity';
|
|
2
|
+
type Context = {
|
|
3
|
+
refreshRates: SvelteMap<string, number>;
|
|
4
|
+
disabledCameras: SvelteMap<string, boolean>;
|
|
5
|
+
};
|
|
6
|
+
export declare const provideMachineSettings: () => void;
|
|
7
|
+
export declare const useMachineSettings: () => Context;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { get, set } from 'idb-keyval';
|
|
2
|
+
import { getContext, setContext } from 'svelte';
|
|
3
|
+
import { SvelteMap } from 'svelte/reactivity';
|
|
4
|
+
const key = Symbol('polling-rate-context');
|
|
5
|
+
const refreshRatesKey = 'polling-rate';
|
|
6
|
+
const disabledCamerasKey = 'disabled-cameras';
|
|
7
|
+
const setFromEntries = (map, entries) => {
|
|
8
|
+
if (entries) {
|
|
9
|
+
for (const [key, value] of entries) {
|
|
10
|
+
map.set(key, value);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
export const provideMachineSettings = () => {
|
|
15
|
+
const refreshRates = new SvelteMap();
|
|
16
|
+
const disabledCameras = new SvelteMap();
|
|
17
|
+
get(refreshRatesKey).then((entries) => {
|
|
18
|
+
setFromEntries(refreshRates, entries);
|
|
19
|
+
});
|
|
20
|
+
get(disabledCamerasKey).then((entries) => {
|
|
21
|
+
setFromEntries(disabledCameras, entries);
|
|
22
|
+
});
|
|
23
|
+
$effect(() => {
|
|
24
|
+
set(refreshRatesKey, [...refreshRates.entries()]);
|
|
25
|
+
});
|
|
26
|
+
$effect(() => {
|
|
27
|
+
set(disabledCamerasKey, [...disabledCameras.entries()]);
|
|
28
|
+
});
|
|
29
|
+
setContext(key, {
|
|
30
|
+
get refreshRates() {
|
|
31
|
+
return refreshRates;
|
|
32
|
+
},
|
|
33
|
+
get disabledCameras() {
|
|
34
|
+
return disabledCameras;
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
export const useMachineSettings = () => {
|
|
39
|
+
return getContext(key);
|
|
40
|
+
};
|
|
@@ -2,26 +2,26 @@ import { getContext, setContext } from 'svelte';
|
|
|
2
2
|
import { useFrames } from './useFrames.svelte';
|
|
3
3
|
import { useGeometries } from './useGeometries.svelte';
|
|
4
4
|
import { useStaticGeometries } from './useStaticGeometries.svelte';
|
|
5
|
-
import {
|
|
5
|
+
import { useDrawAPI } from './useDrawAPI.svelte';
|
|
6
6
|
import { usePointClouds } from './usePointclouds.svelte';
|
|
7
7
|
const key = Symbol('objects-context');
|
|
8
8
|
export const provideObjects = () => {
|
|
9
9
|
const frames = useFrames();
|
|
10
10
|
const geometries = useGeometries();
|
|
11
11
|
const statics = useStaticGeometries();
|
|
12
|
-
const
|
|
12
|
+
const drawAPI = useDrawAPI();
|
|
13
13
|
const points = usePointClouds();
|
|
14
14
|
const objects = $derived([
|
|
15
15
|
...frames.current,
|
|
16
16
|
...geometries.current,
|
|
17
17
|
...points.current,
|
|
18
|
-
...shapes.meshes,
|
|
19
|
-
...shapes.models,
|
|
20
|
-
...shapes.nurbs,
|
|
21
|
-
...shapes.points,
|
|
22
|
-
...shapes.lines,
|
|
23
18
|
...statics.current,
|
|
24
|
-
...
|
|
19
|
+
...drawAPI.meshes,
|
|
20
|
+
...drawAPI.models,
|
|
21
|
+
...drawAPI.nurbs,
|
|
22
|
+
...drawAPI.points,
|
|
23
|
+
...drawAPI.lines,
|
|
24
|
+
...drawAPI.poses,
|
|
25
25
|
]);
|
|
26
26
|
setContext(key, {
|
|
27
27
|
get current() {
|
|
@@ -4,39 +4,46 @@ import { setContext, getContext } from 'svelte';
|
|
|
4
4
|
import { fromStore, toStore } from 'svelte/store';
|
|
5
5
|
import { createResourceClient, useResourceNames } from '@viamrobotics/svelte-sdk';
|
|
6
6
|
import { parsePcdInWorker } from '../loaders/pcd';
|
|
7
|
-
import {
|
|
7
|
+
import { useMachineSettings } from './useMachineSettings.svelte';
|
|
8
8
|
import { WorldObject } from '../WorldObject';
|
|
9
9
|
import { usePersistentUUIDs } from './usePersistentUUIDs.svelte';
|
|
10
10
|
import { useLogs } from './useLogs.svelte';
|
|
11
11
|
const key = Symbol('pointcloud-context');
|
|
12
12
|
export const providePointclouds = (partID) => {
|
|
13
13
|
const logs = useLogs();
|
|
14
|
-
const refreshRates =
|
|
14
|
+
const { refreshRates, disabledCameras } = useMachineSettings();
|
|
15
15
|
const cameras = useResourceNames(partID, 'camera');
|
|
16
16
|
if (!refreshRates.has('Pointclouds')) {
|
|
17
17
|
refreshRates.set('Pointclouds', -1);
|
|
18
18
|
}
|
|
19
19
|
const clients = $derived(cameras.current.map((camera) => createResourceClient(CameraClient, partID, () => camera.name)));
|
|
20
|
-
const options = $derived
|
|
21
|
-
const name = cameraClient.current?.name ?? '';
|
|
20
|
+
const options = $derived.by(() => {
|
|
22
21
|
const interval = refreshRates.get('Pointclouds');
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
22
|
+
const results = [];
|
|
23
|
+
for (const cameraClient of clients) {
|
|
24
|
+
const name = cameraClient.current?.name ?? '';
|
|
25
|
+
const options = queryOptions({
|
|
26
|
+
enabled: interval !== -1 &&
|
|
27
|
+
cameraClient.current !== undefined &&
|
|
28
|
+
disabledCameras.get(name) !== true,
|
|
29
|
+
refetchInterval: interval === 0 ? false : interval,
|
|
30
|
+
queryKey: ['partID', partID(), name, 'getPointCloud'],
|
|
31
|
+
queryFn: async () => {
|
|
32
|
+
if (!cameraClient.current) {
|
|
33
|
+
throw new Error('No camera client');
|
|
34
|
+
}
|
|
35
|
+
logs.add(`Fetching pointcloud for ${cameraClient.current.name}`);
|
|
36
|
+
const response = await cameraClient.current.getPointCloud();
|
|
37
|
+
if (!response)
|
|
38
|
+
return null;
|
|
39
|
+
const { positions, colors } = await parsePcdInWorker(new Uint8Array(response));
|
|
40
|
+
return new WorldObject(`${name}:pointcloud`, undefined, name, { case: 'points', value: positions }, colors ? { colors } : undefined);
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
results.push(options);
|
|
44
|
+
}
|
|
45
|
+
return results;
|
|
46
|
+
});
|
|
40
47
|
const { updateUUIDs } = usePersistentUUIDs();
|
|
41
48
|
const queries = fromStore(createQueries({
|
|
42
49
|
queries: toStore(() => options),
|
|
@@ -2,17 +2,17 @@ import { createResourceClient, useResourceNames } from '@viamrobotics/svelte-sdk
|
|
|
2
2
|
import { usePartID } from './usePartID.svelte';
|
|
3
3
|
import { MotionClient } from '@viamrobotics/sdk';
|
|
4
4
|
import { createQuery, queryOptions } from '@tanstack/svelte-query';
|
|
5
|
-
import {
|
|
5
|
+
import { useMachineSettings } from './useMachineSettings.svelte';
|
|
6
6
|
import { fromStore, toStore } from 'svelte/store';
|
|
7
7
|
import { useMotionClient } from './useMotionClient.svelte';
|
|
8
8
|
export const usePose = (name, parent) => {
|
|
9
|
-
const refreshRates =
|
|
9
|
+
const { refreshRates } = useMachineSettings();
|
|
10
10
|
const partID = usePartID();
|
|
11
11
|
const motionClient = useMotionClient();
|
|
12
12
|
const resources = useResourceNames(() => partID.current);
|
|
13
13
|
const resource = $derived(resources.current.find((resource) => resource.name === name()));
|
|
14
14
|
const client = createResourceClient(MotionClient, () => partID.current, () => motionClient.current ?? '');
|
|
15
|
-
const interval = refreshRates.get('Poses');
|
|
15
|
+
const interval = $derived(refreshRates.get('Poses'));
|
|
16
16
|
const options = $derived(queryOptions({
|
|
17
17
|
enabled: interval !== -1 && client.current !== undefined && resource !== undefined,
|
|
18
18
|
refetchInterval: interval === 0 ? false : interval,
|
|
@@ -3,10 +3,10 @@ import { MotionClient, PoseInFrame, ResourceName } from '@viamrobotics/sdk';
|
|
|
3
3
|
import { createResourceClient, useResourceNames } from '@viamrobotics/svelte-sdk';
|
|
4
4
|
import { getContext, setContext } from 'svelte';
|
|
5
5
|
import { fromStore, toStore } from 'svelte/store';
|
|
6
|
-
import {
|
|
6
|
+
import { useMachineSettings } from './useMachineSettings.svelte';
|
|
7
7
|
const key = Symbol('poses-context');
|
|
8
8
|
export const providePoses = (partID) => {
|
|
9
|
-
const refreshRates =
|
|
9
|
+
const { refreshRates } = useMachineSettings();
|
|
10
10
|
const resources = useResourceNames(partID);
|
|
11
11
|
const components = $derived(resources.current.filter(({ type }) => type === 'component'));
|
|
12
12
|
const motionResources = useResourceNames(partID, 'motion');
|
package/package.json
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viamrobotics/motion-tools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "Motion visualization with Viam",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"devDependencies": {
|
|
8
|
-
"@ag-grid-community/client-side-row-model": "32.3.
|
|
9
|
-
"@ag-grid-community/core": "32.3.
|
|
10
|
-
"@ag-grid-community/styles": "32.3.
|
|
8
|
+
"@ag-grid-community/client-side-row-model": "32.3.8",
|
|
9
|
+
"@ag-grid-community/core": "32.3.8",
|
|
10
|
+
"@ag-grid-community/styles": "32.3.8",
|
|
11
11
|
"@changesets/cli": "2.29.5",
|
|
12
|
-
"@dimforge/rapier3d-compat": "0.
|
|
12
|
+
"@dimforge/rapier3d-compat": "0.18.0",
|
|
13
13
|
"@eslint/compat": "1.3.1",
|
|
14
|
-
"@eslint/js": "9.
|
|
15
|
-
"@playwright/test": "1.54.
|
|
16
|
-
"@sentry/sveltekit": "
|
|
14
|
+
"@eslint/js": "9.32.0",
|
|
15
|
+
"@playwright/test": "1.54.2",
|
|
16
|
+
"@sentry/sveltekit": "10.1.0",
|
|
17
17
|
"@skeletonlabs/skeleton": "3.1.7",
|
|
18
18
|
"@skeletonlabs/skeleton-svelte": "1.3.1",
|
|
19
19
|
"@sveltejs/adapter-static": "3.0.8",
|
|
20
|
-
"@sveltejs/kit": "2.
|
|
20
|
+
"@sveltejs/kit": "2.27.1",
|
|
21
21
|
"@sveltejs/package": "2.4.0",
|
|
22
22
|
"@sveltejs/vite-plugin-svelte": "6.1.0",
|
|
23
23
|
"@tailwindcss/forms": "0.5.10",
|
|
24
24
|
"@tailwindcss/vite": "4.1.11",
|
|
25
|
-
"@tanstack/svelte-query": "5.83.
|
|
26
|
-
"@tanstack/svelte-query-devtools": "5.
|
|
27
|
-
"@testing-library/jest-dom": "6.6.
|
|
25
|
+
"@tanstack/svelte-query": "5.83.1",
|
|
26
|
+
"@tanstack/svelte-query-devtools": "5.84.0",
|
|
27
|
+
"@testing-library/jest-dom": "6.6.4",
|
|
28
28
|
"@testing-library/svelte": "5.2.8",
|
|
29
|
-
"@threlte/core": "8.1.
|
|
30
|
-
"@threlte/extras": "9.4.
|
|
31
|
-
"@threlte/rapier": "3.1.
|
|
29
|
+
"@threlte/core": "8.1.4",
|
|
30
|
+
"@threlte/extras": "9.4.4",
|
|
31
|
+
"@threlte/rapier": "3.1.5",
|
|
32
32
|
"@threlte/xr": "1.0.8",
|
|
33
33
|
"@types/bun": "1.2.19",
|
|
34
34
|
"@types/lodash-es": "4.17.12",
|
|
35
|
-
"@types/three": "0.
|
|
36
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
37
|
-
"@typescript-eslint/parser": "8.
|
|
35
|
+
"@types/three": "0.179.0",
|
|
36
|
+
"@typescript-eslint/eslint-plugin": "8.39.0",
|
|
37
|
+
"@typescript-eslint/parser": "8.39.0",
|
|
38
38
|
"@viamrobotics/prime-core": "0.1.5",
|
|
39
39
|
"@viamrobotics/sdk": "0.46.0",
|
|
40
|
-
"@viamrobotics/svelte-sdk": "0.4.
|
|
40
|
+
"@viamrobotics/svelte-sdk": "0.4.5",
|
|
41
41
|
"@vitejs/plugin-basic-ssl": "2.1.0",
|
|
42
|
-
"@zag-js/svelte": "1.
|
|
43
|
-
"@zag-js/tree-view": "1.
|
|
42
|
+
"@zag-js/svelte": "1.21.1",
|
|
43
|
+
"@zag-js/tree-view": "1.21.1",
|
|
44
44
|
"camera-controls": "3.1.0",
|
|
45
|
-
"eslint": "9.
|
|
45
|
+
"eslint": "9.32.0",
|
|
46
46
|
"eslint-config-prettier": "10.1.8",
|
|
47
|
-
"eslint-plugin-svelte": "3.
|
|
47
|
+
"eslint-plugin-svelte": "3.11.0",
|
|
48
48
|
"globals": "16.3.0",
|
|
49
49
|
"idb-keyval": "6.2.2",
|
|
50
50
|
"jsdom": "26.1.0",
|
|
51
51
|
"lodash-es": "4.17.21",
|
|
52
|
-
"lucide-svelte": "0.
|
|
52
|
+
"lucide-svelte": "0.536.0",
|
|
53
53
|
"prettier": "3.6.2",
|
|
54
54
|
"prettier-plugin-svelte": "3.4.0",
|
|
55
55
|
"prettier-plugin-tailwindcss": "0.6.14",
|
|
56
56
|
"publint": "0.3.12",
|
|
57
|
-
"runed": "0.31.
|
|
58
|
-
"svelte": "5.
|
|
59
|
-
"svelte-check": "4.3.
|
|
57
|
+
"runed": "0.31.1",
|
|
58
|
+
"svelte": "5.37.3",
|
|
59
|
+
"svelte-check": "4.3.1",
|
|
60
60
|
"svelte-virtuallists": "1.4.2",
|
|
61
61
|
"tailwindcss": "4.1.11",
|
|
62
|
-
"three": "0.
|
|
62
|
+
"three": "0.179.1",
|
|
63
63
|
"threlte-uikit": "1.2.0",
|
|
64
64
|
"tsx": "4.20.3",
|
|
65
|
-
"typescript": "5.
|
|
66
|
-
"typescript-eslint": "8.
|
|
65
|
+
"typescript": "5.9.2",
|
|
66
|
+
"typescript-eslint": "8.39.0",
|
|
67
67
|
"vite": "6.3.5",
|
|
68
|
-
"vite-plugin-devtools-json": "0.
|
|
68
|
+
"vite-plugin-devtools-json": "0.4.1",
|
|
69
69
|
"vite-plugin-mkcert": "1.17.8",
|
|
70
70
|
"vitest": "3.2.4"
|
|
71
71
|
},
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Portal, PortalTarget } from './portal'
|
|
3
|
-
import Frame from './Frame.svelte'
|
|
4
|
-
import { useFrames } from '../hooks/useFrames.svelte'
|
|
5
|
-
import { useGeometries } from '../hooks/useGeometries.svelte'
|
|
6
|
-
import Pose from './Pose.svelte'
|
|
7
|
-
|
|
8
|
-
const frames = useFrames()
|
|
9
|
-
const geometries = useGeometries()
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
{#each frames.current as object (object.uuid)}
|
|
13
|
-
<Pose name={object.name}>
|
|
14
|
-
{#snippet children({ pose })}
|
|
15
|
-
{#if pose}
|
|
16
|
-
<Frame
|
|
17
|
-
uuid={object.uuid}
|
|
18
|
-
name={object.name}
|
|
19
|
-
{pose}
|
|
20
|
-
geometry={object.geometry}
|
|
21
|
-
metadata={object.metadata}
|
|
22
|
-
>
|
|
23
|
-
<PortalTarget id={object.name} />
|
|
24
|
-
</Frame>
|
|
25
|
-
{:else}
|
|
26
|
-
<Portal id={object.referenceFrame}>
|
|
27
|
-
<Frame
|
|
28
|
-
uuid={object.uuid}
|
|
29
|
-
name={object.name}
|
|
30
|
-
pose={pose ?? object.pose}
|
|
31
|
-
geometry={object.geometry}
|
|
32
|
-
metadata={object.metadata}
|
|
33
|
-
>
|
|
34
|
-
<PortalTarget id={object.name} />
|
|
35
|
-
</Frame>
|
|
36
|
-
</Portal>
|
|
37
|
-
{/if}
|
|
38
|
-
{/snippet}
|
|
39
|
-
</Pose>
|
|
40
|
-
{/each}
|
|
41
|
-
|
|
42
|
-
{#each geometries.current as object (object.uuid)}
|
|
43
|
-
<Portal id={object.referenceFrame}>
|
|
44
|
-
<Frame
|
|
45
|
-
uuid={object.uuid}
|
|
46
|
-
name={object.name}
|
|
47
|
-
pose={object.pose}
|
|
48
|
-
geometry={object.geometry}
|
|
49
|
-
metadata={object.metadata}
|
|
50
|
-
>
|
|
51
|
-
<PortalTarget id={object.name} />
|
|
52
|
-
</Frame>
|
|
53
|
-
</Portal>
|
|
54
|
-
{/each}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Portal } from './portal'
|
|
3
|
-
import { usePointClouds } from '../hooks/usePointclouds.svelte'
|
|
4
|
-
import { useShapes } from '../hooks/useShapes.svelte'
|
|
5
|
-
import Pointcloud from './Pointcloud.svelte'
|
|
6
|
-
|
|
7
|
-
const points = usePointClouds()
|
|
8
|
-
const shapes = useShapes()
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
{#each points.current as object (object.uuid)}
|
|
12
|
-
<Portal id={object.referenceFrame}>
|
|
13
|
-
<Pointcloud {object} />
|
|
14
|
-
</Portal>
|
|
15
|
-
{/each}
|
|
16
|
-
|
|
17
|
-
{#each shapes.points as object (object.uuid)}
|
|
18
|
-
<Portal id={object.referenceFrame}>
|
|
19
|
-
<Pointcloud {object} />
|
|
20
|
-
</Portal>
|
|
21
|
-
{/each}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
-
$$bindings?: Bindings;
|
|
4
|
-
} & Exports;
|
|
5
|
-
(internal: unknown, props: {
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
declare const Pointclouds: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
}, {}, {}, string>;
|
|
17
|
-
type Pointclouds = InstanceType<typeof Pointclouds>;
|
|
18
|
-
export default Pointclouds;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { T } from '@threlte/core'
|
|
3
|
-
import { Portal, PortalTarget } from './portal'
|
|
4
|
-
import { useShapes } from '../hooks/useShapes.svelte'
|
|
5
|
-
import WorldObject from './WorldObject.svelte'
|
|
6
|
-
import Frame from './Frame.svelte'
|
|
7
|
-
import Line from './Line.svelte'
|
|
8
|
-
|
|
9
|
-
const shapes = useShapes()
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<T
|
|
13
|
-
name={shapes.object3ds.batchedArrow.object3d.name}
|
|
14
|
-
is={shapes.object3ds.batchedArrow.object3d}
|
|
15
|
-
dispose={false}
|
|
16
|
-
/>
|
|
17
|
-
|
|
18
|
-
{#each shapes.meshes as object (object.uuid)}
|
|
19
|
-
<Portal id={object.referenceFrame}>
|
|
20
|
-
<Frame
|
|
21
|
-
uuid={object.uuid}
|
|
22
|
-
name={object.name}
|
|
23
|
-
pose={object.pose}
|
|
24
|
-
geometry={object.geometry}
|
|
25
|
-
metadata={object.metadata}
|
|
26
|
-
>
|
|
27
|
-
<PortalTarget id={object.name} />
|
|
28
|
-
</Frame>
|
|
29
|
-
</Portal>
|
|
30
|
-
{/each}
|
|
31
|
-
|
|
32
|
-
{#each shapes.nurbs as object (object.uuid)}
|
|
33
|
-
<Portal id={object.referenceFrame}>
|
|
34
|
-
<Frame
|
|
35
|
-
uuid={object.uuid}
|
|
36
|
-
name={object.name}
|
|
37
|
-
pose={object.pose}
|
|
38
|
-
geometry={object.geometry}
|
|
39
|
-
metadata={object.metadata}
|
|
40
|
-
>
|
|
41
|
-
<PortalTarget id={object.name} />
|
|
42
|
-
</Frame>
|
|
43
|
-
</Portal>
|
|
44
|
-
{/each}
|
|
45
|
-
|
|
46
|
-
{#each shapes.models as object (object.uuid)}
|
|
47
|
-
<WorldObject {object}>
|
|
48
|
-
<PortalTarget id={object.name} />
|
|
49
|
-
</WorldObject>
|
|
50
|
-
{/each}
|
|
51
|
-
|
|
52
|
-
{#each shapes.lines as object (object.uuid)}
|
|
53
|
-
<Line {object} />
|
|
54
|
-
{/each}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { get, set } from 'idb-keyval';
|
|
2
|
-
import { getContext, setContext } from 'svelte';
|
|
3
|
-
import { SvelteMap } from 'svelte/reactivity';
|
|
4
|
-
const key = Symbol('polling-rate-context');
|
|
5
|
-
const idbKey = 'polling-rate';
|
|
6
|
-
export const provideRefreshRates = () => {
|
|
7
|
-
const map = new SvelteMap();
|
|
8
|
-
get(idbKey).then((entries) => {
|
|
9
|
-
if (entries) {
|
|
10
|
-
for (const [key, value] of entries) {
|
|
11
|
-
map.set(key, value);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
$effect(() => {
|
|
16
|
-
set(idbKey, [...map.entries()]);
|
|
17
|
-
});
|
|
18
|
-
setContext(key, map);
|
|
19
|
-
return map;
|
|
20
|
-
};
|
|
21
|
-
export const useRefreshRates = () => {
|
|
22
|
-
return getContext(key);
|
|
23
|
-
};
|