@viamrobotics/motion-tools 1.13.1 → 1.15.0
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/FrameConfigUpdater.svelte.d.ts +2 -2
- package/dist/HoverUpdater.svelte.d.ts +1 -1
- package/dist/attribute.js +11 -3
- package/dist/buffer.d.ts +56 -7
- package/dist/buffer.js +70 -12
- package/dist/color.d.ts +1 -1
- package/dist/color.js +2 -2
- package/dist/components/App.svelte +25 -21
- package/dist/components/App.svelte.d.ts +1 -1
- package/dist/components/BatchedArrows.svelte +5 -3
- package/dist/components/Camera.svelte +1 -0
- package/dist/components/CameraControls.svelte +5 -3
- package/dist/components/Entities/Arrows/ArrowGroups.svelte +6 -3
- package/dist/components/Entities/Arrows/Arrows.svelte +6 -3
- package/dist/components/Entities/Entities.svelte +9 -7
- package/dist/components/Entities/Frame.svelte +48 -48
- package/dist/components/Entities/Frame.svelte.d.ts +3 -2
- package/dist/components/Entities/GLTF.svelte +8 -5
- package/dist/components/Entities/GLTF.svelte.d.ts +2 -2
- package/dist/components/Entities/Geometry.svelte +45 -173
- package/dist/components/Entities/Geometry.svelte.d.ts +5 -14
- package/dist/components/Entities/Line.svelte +69 -19
- package/dist/components/Entities/Line.svelte.d.ts +1 -1
- package/dist/components/Entities/LineDots.svelte +1 -1
- package/dist/components/Entities/LineGeometry.svelte +1 -1
- package/dist/components/Entities/Mesh.svelte +133 -0
- package/dist/components/Entities/Mesh.svelte.d.ts +4 -0
- package/dist/components/Entities/Points.svelte +9 -6
- package/dist/components/Entities/Points.svelte.d.ts +2 -2
- package/dist/components/Entities/Pose.svelte +4 -3
- package/dist/components/Entities/hooks/useEntityEvents.svelte.d.ts +1 -1
- package/dist/components/Entities/hooks/useEntityEvents.svelte.js +2 -2
- package/dist/components/FileDrop/FileDrop.svelte +10 -6
- package/dist/components/FileDrop/file-dropper.d.ts +1 -1
- package/dist/components/FileDrop/pcd-dropper.js +1 -1
- package/dist/components/FileDrop/ply-dropper.js +1 -1
- package/dist/components/FileDrop/snapshot-dropper.js +1 -1
- package/dist/components/Focus.svelte +4 -2
- package/dist/components/KeyboardControls.svelte +4 -2
- package/dist/components/Lasso/Debug.svelte +5 -2
- package/dist/components/Lasso/Lasso.svelte +9 -6
- package/dist/components/Lasso/Tool.svelte +10 -7
- package/dist/components/MeasureTool/MeasurePoint.svelte +2 -1
- package/dist/components/MeasureTool/MeasurePoint.svelte.d.ts +1 -1
- package/dist/components/MeasureTool/MeasureTool.svelte +7 -5
- package/dist/components/PCD.svelte +4 -3
- package/dist/components/PointerMissBox.svelte +3 -2
- package/dist/components/Scene.svelte +12 -9
- package/dist/components/SceneProviders.svelte +20 -18
- package/dist/components/Selected.svelte +7 -3
- package/dist/components/Snapshot.svelte +8 -5
- package/dist/components/StaticGeometries.svelte +10 -7
- package/dist/components/hover/HoveredEntities.svelte +2 -1
- package/dist/components/hover/HoveredEntity.svelte +2 -1
- package/dist/components/hover/HoveredEntityTooltip.svelte +1 -0
- package/dist/components/hover/LinkedHoveredEntity.svelte +7 -5
- package/dist/components/overlay/AddRelationship.svelte +4 -2
- package/dist/components/overlay/Details.svelte +21 -19
- package/dist/components/overlay/FloatingPanel.svelte +40 -3
- package/dist/components/overlay/FloatingPanel.svelte.d.ts +1 -0
- package/dist/components/overlay/LiveUpdatesBanner.svelte +1 -0
- package/dist/components/overlay/Logs.svelte +4 -2
- package/dist/components/overlay/Popover.svelte +3 -2
- package/dist/components/overlay/RefreshRate.svelte +4 -2
- package/dist/components/overlay/dashboard/Button.svelte +2 -1
- package/dist/components/overlay/dashboard/Button.svelte.d.ts +1 -1
- package/dist/components/overlay/dashboard/Dashboard.svelte +3 -1
- package/dist/components/overlay/left-pane/AddFrames.svelte +4 -2
- package/dist/components/overlay/left-pane/Drawer.svelte +3 -2
- package/dist/components/overlay/left-pane/Tree.svelte +6 -12
- package/dist/components/overlay/left-pane/TreeContainer.svelte +33 -50
- package/dist/components/overlay/left-pane/TreeContainer.svelte.d.ts +1 -1
- package/dist/components/overlay/left-pane/buildTree.js +15 -0
- package/dist/components/overlay/settings/Settings.svelte +37 -10
- package/dist/components/overlay/settings/Tabs.svelte +2 -1
- package/dist/components/overlay/widgets/ArmPositions.svelte +3 -2
- package/dist/components/overlay/widgets/Camera.svelte +6 -5
- package/dist/components/weblab/WeblabActive.svelte +2 -1
- package/dist/components/xr/ArmTeleop.svelte +7 -6
- package/dist/components/xr/BentPlaneGeometry.svelte +3 -2
- package/dist/components/xr/CameraFeed.svelte +2 -0
- package/dist/components/xr/Controllers.svelte +5 -3
- package/dist/components/xr/Draggable.svelte +4 -3
- package/dist/components/xr/HandCollider.svelte +2 -1
- package/dist/components/xr/JointLimitsWidget.svelte +1 -0
- package/dist/components/xr/OriginMarker.svelte +2 -1
- package/dist/components/xr/PointDistance.svelte +3 -2
- package/dist/components/xr/XR.svelte +8 -6
- package/dist/components/xr/XRConfigPanel.svelte +4 -3
- package/dist/components/xr/XRControllerSettings.svelte +2 -1
- package/dist/components/xr/XRToast.svelte +4 -3
- package/dist/ecs/traits.d.ts +3 -20
- package/dist/ecs/traits.js +34 -7
- package/dist/ecs/useQuery.svelte.js +1 -1
- package/dist/frame.js +1 -1
- package/dist/hooks/use3DModels.svelte.js +4 -6
- package/dist/hooks/useConfigFrames.svelte.js +3 -3
- package/dist/hooks/useDrawAPI.svelte.js +9 -9
- package/dist/hooks/useFramelessComponents.svelte.js +1 -1
- package/dist/hooks/useFrames.svelte.js +18 -19
- package/dist/hooks/useGeometries.svelte.js +66 -43
- package/dist/hooks/useMouseRaycaster.svelte.d.ts +1 -1
- package/dist/hooks/useMouseRaycaster.svelte.js +1 -1
- package/dist/hooks/usePartConfig.svelte.d.ts +1 -1
- package/dist/hooks/usePartConfig.svelte.js +3 -3
- package/dist/hooks/usePointcloudObjects.svelte.js +108 -63
- package/dist/hooks/usePointclouds.svelte.js +53 -33
- package/dist/hooks/usePose.svelte.js +7 -7
- package/dist/hooks/useSelection.svelte.d.ts +1 -1
- package/dist/hooks/useWeblabs.svelte.d.ts +1 -0
- package/dist/hooks/useWeblabs.svelte.js +15 -3
- package/dist/hooks/useWorldState.svelte.js +31 -31
- package/dist/metadata.d.ts +22 -0
- package/dist/metadata.js +66 -0
- package/dist/plugins/bvh.svelte.js +2 -2
- package/dist/snapshot.d.ts +22 -2
- package/dist/snapshot.js +67 -25
- package/dist/three/BatchedArrow.d.ts +1 -1
- package/dist/three/BatchedArrow.js +1 -1
- package/dist/three/InstancedArrows/InstancedArrows.d.ts +1 -1
- package/dist/three/InstancedArrows/InstancedArrows.js +3 -3
- package/dist/three/InstancedArrows/box.js +1 -1
- package/dist/three/InstancedArrows/geometry.js +1 -1
- package/dist/three/InstancedArrows/raycast.d.ts +1 -1
- package/dist/three/InstancedArrows/raycast.js +1 -1
- package/dist/three/OBBHelper.d.ts +3 -2
- package/dist/three/OBBHelper.js +17 -5
- package/dist/three/OrientationVector.js +1 -1
- package/dist/transform.js +1 -1
- package/package.json +3 -2
- package/dist/WorldObject.svelte.d.ts +0 -27
- package/dist/WorldObject.svelte.js +0 -127
- package/dist/hooks/__tests__/fixtures/ResizableTestWrapper.svelte +0 -41
- package/dist/hooks/__tests__/fixtures/ResizableTestWrapper.svelte.d.ts +0 -6
- package/dist/hooks/useResizable.svelte.d.ts +0 -12
- package/dist/hooks/useResizable.svelte.js +0 -46
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import { useSettings } from '../../../hooks/useSettings.svelte'
|
|
3
2
|
import { PortalTarget } from '@threlte/extras'
|
|
3
|
+
|
|
4
|
+
import { useSettings } from '../../../hooks/useSettings.svelte'
|
|
5
|
+
|
|
4
6
|
import Button from './Button.svelte'
|
|
5
7
|
|
|
6
8
|
let { dashboard, ...rest } = $props()
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { IconButton } from '@viamrobotics/prime-core'
|
|
3
|
-
|
|
4
|
-
import { usePartConfig } from '../../../hooks/usePartConfig.svelte'
|
|
3
|
+
|
|
5
4
|
import { useFramelessComponents } from '../../../hooks/useFramelessComponents.svelte'
|
|
5
|
+
import { usePartConfig } from '../../../hooks/usePartConfig.svelte'
|
|
6
|
+
|
|
7
|
+
import Drawer from './Drawer.svelte'
|
|
6
8
|
|
|
7
9
|
const framelessComponents = useFramelessComponents()
|
|
8
10
|
const partConfig = usePartConfig()
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { PersistedState } from 'runed'
|
|
3
|
-
import { Icon } from '@viamrobotics/prime-core'
|
|
4
2
|
import type { Snippet } from 'svelte'
|
|
5
3
|
|
|
4
|
+
import { Icon } from '@viamrobotics/prime-core'
|
|
5
|
+
import { PersistedState } from 'runed'
|
|
6
|
+
|
|
6
7
|
interface Props {
|
|
7
8
|
name: string
|
|
8
9
|
defaultOpen?: boolean
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { normalizeProps, useMachine } from '@zag-js/svelte'
|
|
2
3
|
import * as tree from '@zag-js/tree-view'
|
|
3
|
-
import { useMachine, normalizeProps } from '@zag-js/svelte'
|
|
4
4
|
import { ChevronRight, Eye, EyeOff } from 'lucide-svelte'
|
|
5
|
-
import { useVisibility } from '../../../hooks/useVisibility.svelte'
|
|
6
|
-
import type { TreeNode } from './buildTree'
|
|
7
5
|
import { VirtualList } from 'svelte-virtuallists'
|
|
8
|
-
import {
|
|
6
|
+
import { SvelteSet } from 'svelte/reactivity'
|
|
7
|
+
|
|
9
8
|
import { traits } from '../../../ecs'
|
|
10
9
|
import { useSelectedEntity } from '../../../hooks/useSelection.svelte'
|
|
11
|
-
import {
|
|
10
|
+
import { useVisibility } from '../../../hooks/useVisibility.svelte'
|
|
11
|
+
|
|
12
|
+
import type { TreeNode } from './buildTree'
|
|
12
13
|
|
|
13
14
|
const selected = useSelectedEntity()
|
|
14
15
|
const visibility = useVisibility()
|
|
@@ -177,13 +178,6 @@
|
|
|
177
178
|
|
|
178
179
|
<div class="root-node">
|
|
179
180
|
<div {...api.getRootProps() as object}>
|
|
180
|
-
<div class="border-medium flex items-center gap-1 border-b p-2">
|
|
181
|
-
<button bind:this={dragElement}>
|
|
182
|
-
<Icon name="drag" />
|
|
183
|
-
</button>
|
|
184
|
-
<h3 {...api.getLabelProps() as object}>{rootNode.entity.get(traits.Name)}</h3>
|
|
185
|
-
</div>
|
|
186
|
-
|
|
187
181
|
<div {...api.getTreeProps()}>
|
|
188
182
|
{#if rootChildren.length === 0}
|
|
189
183
|
<p class="text-subtle-2 px-2 py-4">No objects displayed</p>
|
|
@@ -1,31 +1,24 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import { provideTreeExpandedContext } from './useExpanded.svelte'
|
|
6
|
-
import AddFrames from './AddFrames.svelte'
|
|
2
|
+
import { type Entity, IsExcluded } from 'koota'
|
|
3
|
+
|
|
4
|
+
import { traits, useQuery, useWorld } from '../../../ecs'
|
|
7
5
|
import { useEnvironment } from '../../../hooks/useEnvironment.svelte'
|
|
8
|
-
import { usePartID } from '../../../hooks/usePartID.svelte'
|
|
9
|
-
import { usePartConfig } from '../../../hooks/usePartConfig.svelte'
|
|
10
6
|
import { useFrames } from '../../../hooks/useFrames.svelte'
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { MIN_DIMENSIONS, useResizable } from '../../../hooks/useResizable.svelte'
|
|
7
|
+
import { usePartConfig } from '../../../hooks/usePartConfig.svelte'
|
|
8
|
+
import { usePartID } from '../../../hooks/usePartID.svelte'
|
|
9
|
+
import { useSelectedEntity } from '../../../hooks/useSelection.svelte'
|
|
15
10
|
|
|
16
|
-
|
|
11
|
+
import FloatingPanel from '../FloatingPanel.svelte'
|
|
12
|
+
import AddFrames from './AddFrames.svelte'
|
|
13
|
+
import { buildTreeNodes, type TreeNode } from './buildTree'
|
|
14
|
+
import Tree from './Tree.svelte'
|
|
15
|
+
import { provideTreeExpandedContext } from './useExpanded.svelte'
|
|
17
16
|
|
|
18
17
|
provideTreeExpandedContext()
|
|
19
18
|
|
|
20
|
-
let container = $state.raw<HTMLDivElement>()
|
|
21
|
-
let dragElement = $state.raw<HTMLElement>()
|
|
22
|
-
|
|
23
19
|
const partID = usePartID()
|
|
24
20
|
const selectedEntity = useSelectedEntity()
|
|
25
|
-
|
|
26
|
-
() => 'treeview',
|
|
27
|
-
() => ({ width: 240, height: window.innerHeight - 20 })
|
|
28
|
-
)
|
|
21
|
+
|
|
29
22
|
const environment = useEnvironment()
|
|
30
23
|
const partConfig = usePartConfig()
|
|
31
24
|
const frames = useFrames()
|
|
@@ -46,39 +39,29 @@
|
|
|
46
39
|
entity: worldEntity,
|
|
47
40
|
children: rootNodes,
|
|
48
41
|
})
|
|
49
|
-
|
|
50
|
-
$effect(() => {
|
|
51
|
-
if (container) {
|
|
52
|
-
resizable.observe(container)
|
|
53
|
-
}
|
|
54
|
-
})
|
|
55
42
|
</script>
|
|
56
43
|
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
use:draggable={{
|
|
65
|
-
bounds: 'body',
|
|
66
|
-
handle: dragElement,
|
|
67
|
-
}}
|
|
68
|
-
{...rest}
|
|
44
|
+
<FloatingPanel
|
|
45
|
+
isOpen
|
|
46
|
+
defaultPosition={{ x: 10, y: 10 }}
|
|
47
|
+
defaultSize={{ width: 240, height: 400 }}
|
|
48
|
+
title="World"
|
|
49
|
+
exitable={false}
|
|
50
|
+
resizable
|
|
69
51
|
>
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
52
|
+
<div class="text-xs">
|
|
53
|
+
<Tree
|
|
54
|
+
{rootNode}
|
|
55
|
+
{nodeMap}
|
|
56
|
+
onSelectionChange={(event) => {
|
|
57
|
+
const value = event.selectedValue[0]
|
|
76
58
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
59
|
+
selectedEntity.set(value ? (Number(value) as Entity) : undefined)
|
|
60
|
+
}}
|
|
61
|
+
/>
|
|
80
62
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
</div>
|
|
63
|
+
{#if environment.current.isStandalone && partID.current && partConfig.hasEditPermissions}
|
|
64
|
+
<AddFrames />
|
|
65
|
+
{/if}
|
|
66
|
+
</div>
|
|
67
|
+
</FloatingPanel>
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { traits } from '../../../ecs';
|
|
2
|
+
function sortNodes(nodes) {
|
|
3
|
+
nodes.sort((a, b) => a.entity.get(traits.Name)?.localeCompare(b.entity.get(traits.Name) ?? '') ?? 0);
|
|
4
|
+
}
|
|
2
5
|
/**
|
|
3
6
|
* Creates a tree representing parent child / relationships from a set of frames.
|
|
4
7
|
*/
|
|
@@ -29,5 +32,17 @@ export const buildTreeNodes = (entities) => {
|
|
|
29
32
|
}
|
|
30
33
|
}
|
|
31
34
|
}
|
|
35
|
+
for (const node of rootNodes) {
|
|
36
|
+
if (!node.children)
|
|
37
|
+
continue;
|
|
38
|
+
sortNodes(node.children);
|
|
39
|
+
}
|
|
40
|
+
for (const node of childNodes) {
|
|
41
|
+
if (!node.children)
|
|
42
|
+
continue;
|
|
43
|
+
sortNodes(node.children);
|
|
44
|
+
}
|
|
45
|
+
sortNodes(rootNodes);
|
|
46
|
+
sortNodes(childNodes);
|
|
32
47
|
return { rootNodes, nodeMap };
|
|
33
48
|
};
|
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { useThrelte } from '@threlte/core'
|
|
3
3
|
import { Portal } from '@threlte/extras'
|
|
4
|
-
import
|
|
5
|
-
import { useSettings } from '../../../hooks/useSettings.svelte'
|
|
4
|
+
import { Input, Switch } from '@viamrobotics/prime-core'
|
|
6
5
|
import { useResourceNames } from '@viamrobotics/svelte-sdk'
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { PersistedState } from 'runed'
|
|
7
|
+
import { onMount } from 'svelte'
|
|
8
|
+
|
|
9
|
+
import DashboardButton from '../dashboard/Button.svelte'
|
|
10
|
+
import XRControllerSettings from '../../xr/XRControllerSettings.svelte'
|
|
9
11
|
import { useGeometries } from '../../../hooks/useGeometries.svelte'
|
|
12
|
+
import { RefreshRates, useMachineSettings } from '../../../hooks/useMachineSettings.svelte'
|
|
13
|
+
import { usePartID } from '../../../hooks/usePartID.svelte'
|
|
10
14
|
import { usePointClouds } from '../../../hooks/usePointclouds.svelte'
|
|
11
|
-
import { useThrelte } from '@threlte/core'
|
|
12
15
|
import { useRefetchPoses } from '../../../hooks/useRefetchPoses'
|
|
16
|
+
import { useSettings } from '../../../hooks/useSettings.svelte'
|
|
17
|
+
import { useWeblabs, WEBLABS_EXPERIMENTS } from '../../../hooks/useWeblabs.svelte'
|
|
18
|
+
|
|
13
19
|
import FloatingPanel from '../FloatingPanel.svelte'
|
|
14
|
-
import
|
|
15
|
-
import Tabs from './Tabs.svelte'
|
|
16
|
-
import { PersistedState } from 'runed'
|
|
20
|
+
import RefreshRate from '../RefreshRate.svelte'
|
|
17
21
|
import ToggleGroup from '../ToggleGroup.svelte'
|
|
18
|
-
import
|
|
22
|
+
import Tabs from './Tabs.svelte'
|
|
19
23
|
|
|
20
24
|
const { invalidate } = useThrelte()
|
|
21
25
|
const partID = usePartID()
|
|
@@ -26,6 +30,12 @@
|
|
|
26
30
|
const geometries = useGeometries()
|
|
27
31
|
const pointclouds = usePointClouds()
|
|
28
32
|
const { refetchPoses } = useRefetchPoses()
|
|
33
|
+
const weblabs = useWeblabs()
|
|
34
|
+
const knownWeblabs = Object.keys(WEBLABS_EXPERIMENTS)
|
|
35
|
+
|
|
36
|
+
onMount(() => {
|
|
37
|
+
weblabs.load(knownWeblabs)
|
|
38
|
+
})
|
|
29
39
|
|
|
30
40
|
// Invalidate the renderer for any settings change
|
|
31
41
|
$effect(() => {
|
|
@@ -269,6 +279,22 @@
|
|
|
269
279
|
</div>
|
|
270
280
|
{/snippet}
|
|
271
281
|
|
|
282
|
+
{#snippet Weblabs()}
|
|
283
|
+
<div class="flex flex-col gap-1 text-xs">
|
|
284
|
+
{#each knownWeblabs as experiment (experiment)}
|
|
285
|
+
<label class="flex items-center justify-between gap-2 py-0.5">
|
|
286
|
+
{experiment}
|
|
287
|
+
<Switch
|
|
288
|
+
on={weblabs.isActive(experiment)}
|
|
289
|
+
on:change={() => weblabs.toggle(experiment)}
|
|
290
|
+
/>
|
|
291
|
+
</label>
|
|
292
|
+
{:else}
|
|
293
|
+
No weblabs defined
|
|
294
|
+
{/each}
|
|
295
|
+
</div>
|
|
296
|
+
{/snippet}
|
|
297
|
+
|
|
272
298
|
{#snippet Widgets()}
|
|
273
299
|
<div class="text-gray-9 flex flex-col gap-1 text-xs">
|
|
274
300
|
<label class="flex items-center justify-between gap-2 py-1">
|
|
@@ -319,6 +345,7 @@
|
|
|
319
345
|
{ label: 'Vision', content: Vision },
|
|
320
346
|
{ label: 'Widgets', content: Widgets },
|
|
321
347
|
{ label: 'Stats', content: Stats },
|
|
348
|
+
{ label: 'Weblabs', content: Weblabs },
|
|
322
349
|
...('xr' in navigator ? [{ label: 'VR / AR', content: XR }] : []),
|
|
323
350
|
]}
|
|
324
351
|
onValueChange={(value) => {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte'
|
|
3
|
+
|
|
4
|
+
import { normalizeProps, useMachine } from '@zag-js/svelte'
|
|
3
5
|
import * as tabs from '@zag-js/tabs'
|
|
4
|
-
import { useMachine, normalizeProps } from '@zag-js/svelte'
|
|
5
6
|
|
|
6
7
|
interface Props {
|
|
7
8
|
defaultTab?: string
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { draggable } from '@neodrag/svelte'
|
|
3
|
-
import {
|
|
3
|
+
import { Icon, Label, Select } from '@viamrobotics/prime-core'
|
|
4
|
+
|
|
4
5
|
import Table from '../Table.svelte'
|
|
6
|
+
import { formatNumeric } from '../../../format'
|
|
5
7
|
import { useArmClient } from '../../../hooks/useArmClient.svelte'
|
|
6
|
-
import { Icon, Label, Select } from '@viamrobotics/prime-core'
|
|
7
8
|
|
|
8
9
|
const { ...rest } = $props()
|
|
9
10
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { draggable } from '@neodrag/svelte'
|
|
3
3
|
import { Icon, Select } from '@viamrobotics/prime-core'
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { usePartID } from '../../../hooks/usePartID.svelte'
|
|
4
|
+
import { MachineConnectionEvent, StreamClient } from '@viamrobotics/sdk'
|
|
5
|
+
import { CameraStream, useConnectionStatus, useRobotClient } from '@viamrobotics/svelte-sdk'
|
|
6
|
+
|
|
8
7
|
import { useEnvironment } from '../../../hooks/useEnvironment.svelte'
|
|
8
|
+
import { usePartID } from '../../../hooks/usePartID.svelte'
|
|
9
|
+
import { useSettings } from '../../../hooks/useSettings.svelte'
|
|
9
10
|
|
|
10
11
|
interface Resolution {
|
|
11
12
|
width: number
|
|
@@ -115,7 +116,7 @@
|
|
|
115
116
|
</script>
|
|
116
117
|
|
|
117
118
|
<div
|
|
118
|
-
class="bg-extralight border-medium absolute top-0 left-0 z-4 m-2 flex resize-x flex-col overflow-hidden border text-xs"
|
|
119
|
+
class="bg-extralight border-medium absolute top-0 left-0 z-4 m-2 flex resize-x flex-col overflow-hidden border text-xs dark:text-black"
|
|
119
120
|
style:width="320px"
|
|
120
121
|
style:height="auto !important"
|
|
121
122
|
use:draggable={{
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { T, useTask } from '@threlte/core'
|
|
3
3
|
import { useController, useXR, type XRController } from '@threlte/xr'
|
|
4
|
-
import { Vector3, Quaternion } from 'three'
|
|
5
|
-
import { createResourceClient } from '@viamrobotics/svelte-sdk'
|
|
6
4
|
import { ArmClient, GripperClient } from '@viamrobotics/sdk'
|
|
7
5
|
import * as VIAM from '@viamrobotics/sdk'
|
|
8
|
-
import {
|
|
6
|
+
import { createResourceClient } from '@viamrobotics/svelte-sdk'
|
|
7
|
+
import { Quaternion, Vector3 } from 'three'
|
|
8
|
+
|
|
9
9
|
import {
|
|
10
|
-
getFrameTransformationQuaternion,
|
|
11
10
|
calculatePositionTarget,
|
|
11
|
+
getFrameTransformationQuaternion,
|
|
12
12
|
} from './math'
|
|
13
|
-
import { OrientationVector } from '../../three/OrientationVector'
|
|
14
13
|
import { xrToast } from './toasts.svelte'
|
|
14
|
+
import { usePartID } from '../../hooks/usePartID.svelte'
|
|
15
|
+
import { OrientationVector } from '../../three/OrientationVector'
|
|
15
16
|
|
|
16
17
|
interface Props {
|
|
17
18
|
armName: string
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { Vector2, PlaneGeometry } from 'three'
|
|
3
|
-
import { T } from '@threlte/core'
|
|
4
2
|
import type { BufferAttribute } from 'three'
|
|
5
3
|
|
|
4
|
+
import { T } from '@threlte/core'
|
|
5
|
+
import { PlaneGeometry, Vector2 } from 'three'
|
|
6
|
+
|
|
6
7
|
export let args: [
|
|
7
8
|
radius: number,
|
|
8
9
|
width?: number | undefined,
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
import { T, useTask } from '@threlte/core'
|
|
3
3
|
import { createStreamClient } from '@viamrobotics/svelte-sdk'
|
|
4
4
|
import { VideoTexture } from 'three'
|
|
5
|
+
|
|
5
6
|
import { usePartID } from '../../hooks/usePartID.svelte'
|
|
7
|
+
|
|
6
8
|
import BentPlaneGeometry from './BentPlaneGeometry.svelte'
|
|
7
9
|
|
|
8
10
|
interface CameraFeedProps {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { Controller } from '@threlte/xr'
|
|
3
2
|
import { RigidBody } from '@threlte/rapier'
|
|
4
|
-
import
|
|
5
|
-
|
|
3
|
+
import { Controller } from '@threlte/xr'
|
|
4
|
+
|
|
6
5
|
import { useSettings } from '../../hooks/useSettings.svelte'
|
|
7
6
|
|
|
7
|
+
import ArmTeleop from './ArmTeleop.svelte'
|
|
8
|
+
import HandCollider from './HandCollider.svelte'
|
|
9
|
+
|
|
8
10
|
const settings = useSettings()
|
|
9
11
|
|
|
10
12
|
// Get controller config from settings
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
|
|
4
|
+
import { RigidBody as RigidBodyType } from '@dimforge/rapier3d-compat'
|
|
2
5
|
import { T, useTask } from '@threlte/core'
|
|
3
6
|
import { useGamepad } from '@threlte/extras'
|
|
7
|
+
import { AutoColliders, RigidBody } from '@threlte/rapier'
|
|
4
8
|
import { useController } from '@threlte/xr'
|
|
5
|
-
import { RigidBody as RigidBodyType } from '@dimforge/rapier3d-compat'
|
|
6
|
-
import type { Snippet } from 'svelte'
|
|
7
9
|
import { Group, Vector3 } from 'three'
|
|
8
|
-
import { AutoColliders, RigidBody } from '@threlte/rapier'
|
|
9
10
|
|
|
10
11
|
interface Props {
|
|
11
12
|
children: Snippet
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { Group } from 'three'
|
|
3
|
+
|
|
2
4
|
import { useParent, useTask } from '@threlte/core'
|
|
3
5
|
import { Collider, useRigidBody } from '@threlte/rapier'
|
|
4
|
-
import type { Group } from 'three'
|
|
5
6
|
|
|
6
7
|
const parent = useParent()
|
|
7
8
|
const rb = useRigidBody()
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { RigidBody as RigidBodyType } from '@dimforge/rapier3d-compat'
|
|
2
3
|
import { T, useTask } from '@threlte/core'
|
|
3
4
|
import { Grid, useGamepad } from '@threlte/extras'
|
|
4
5
|
import { Collider, RigidBody } from '@threlte/rapier'
|
|
5
|
-
import { RigidBody as RigidBodyType } from '@dimforge/rapier3d-compat'
|
|
6
6
|
import { useController } from '@threlte/xr'
|
|
7
7
|
import { Euler, Group, Quaternion, Vector3 } from 'three'
|
|
8
|
+
|
|
8
9
|
import { useOrigin } from './useOrigin.svelte'
|
|
9
10
|
|
|
10
11
|
const origin = useOrigin()
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { T, useTask } from '@threlte/core'
|
|
3
|
-
import
|
|
3
|
+
import { Billboard, Text } from '@threlte/extras'
|
|
4
4
|
import { Mesh, Vector3 } from 'three'
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
import Draggable from './Draggable.svelte'
|
|
6
7
|
|
|
7
8
|
const mesh1 = new Mesh()
|
|
8
9
|
const mesh2 = new Mesh()
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { T } from '@threlte/core'
|
|
3
|
-
import { useXR, XR, XRButton } from '@threlte/xr'
|
|
4
3
|
import { World } from '@threlte/rapier'
|
|
5
|
-
import
|
|
4
|
+
import { useXR, XR, XRButton } from '@threlte/xr'
|
|
5
|
+
import { SvelteMap } from 'svelte/reactivity'
|
|
6
|
+
|
|
7
|
+
import { usePartID } from '../../hooks/usePartID.svelte'
|
|
6
8
|
import { useSettings } from '../../hooks/useSettings.svelte'
|
|
7
|
-
|
|
9
|
+
|
|
8
10
|
import CameraFeed from './CameraFeed.svelte'
|
|
11
|
+
import Controllers from './Controllers.svelte'
|
|
9
12
|
import JointLimitsWidget from './JointLimitsWidget.svelte'
|
|
10
|
-
import
|
|
11
|
-
import XRToast from './XRToast.svelte'
|
|
13
|
+
import OriginMarker from './OriginMarker.svelte'
|
|
12
14
|
import { useOrigin } from './useOrigin.svelte'
|
|
13
|
-
import
|
|
15
|
+
import XRToast from './XRToast.svelte'
|
|
14
16
|
|
|
15
17
|
const { ...rest } = $props()
|
|
16
18
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { T, useTask } from '@threlte/core'
|
|
3
|
-
import {
|
|
3
|
+
import { useController, type XRController } from '@threlte/xr'
|
|
4
|
+
import { useResourceNames } from '@viamrobotics/svelte-sdk'
|
|
5
|
+
import { CanvasTexture, Mesh, PlaneGeometry, Raycaster } from 'three'
|
|
6
|
+
|
|
4
7
|
import { useArmClient } from '../../hooks/useArmClient.svelte'
|
|
5
8
|
import { usePartID } from '../../hooks/usePartID.svelte'
|
|
6
|
-
import { useResourceNames } from '@viamrobotics/svelte-sdk'
|
|
7
9
|
import { useSettings } from '../../hooks/useSettings.svelte'
|
|
8
|
-
import { useController, type XRController } from '@threlte/xr'
|
|
9
10
|
|
|
10
11
|
interface XRConfigPanelProps {
|
|
11
12
|
offset?: { x?: number; y?: number; z?: number }
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Select, Switch } from '@viamrobotics/prime-core'
|
|
3
|
+
import { useResourceNames } from '@viamrobotics/svelte-sdk'
|
|
4
|
+
|
|
3
5
|
import { useArmClient } from '../../hooks/useArmClient.svelte'
|
|
4
6
|
import { usePartID } from '../../hooks/usePartID.svelte'
|
|
5
|
-
import { useResourceNames } from '@viamrobotics/svelte-sdk'
|
|
6
7
|
import { useSettings } from '../../hooks/useSettings.svelte'
|
|
7
8
|
|
|
8
9
|
const settings = useSettings()
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { untrack } from 'svelte'
|
|
3
2
|
import { T } from '@threlte/core'
|
|
4
|
-
import { CanvasTexture, PlaneGeometry } from 'three'
|
|
5
|
-
import { xrToast, type XRToastItem, type ToastVariant } from './toasts.svelte'
|
|
6
3
|
import { Headset } from '@threlte/xr'
|
|
4
|
+
import { untrack } from 'svelte'
|
|
5
|
+
import { CanvasTexture, PlaneGeometry } from 'three'
|
|
6
|
+
|
|
7
|
+
import { type ToastVariant, xrToast, type XRToastItem } from './toasts.svelte'
|
|
7
8
|
|
|
8
9
|
const CANVAS_WIDTH = 700
|
|
9
10
|
const TOAST_HEIGHT = 80
|
package/dist/ecs/traits.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { GLTF as ThreeGltf } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
2
|
-
import { BufferGeometry as ThreeBufferGeometry } from 'three';
|
|
3
2
|
import { Geometry as ViamGeometry } from '@viamrobotics/sdk';
|
|
3
|
+
import { type Entity } from 'koota';
|
|
4
|
+
import { BufferGeometry as ThreeBufferGeometry } from 'three';
|
|
4
5
|
export declare const Name: import("koota").Trait<() => string>;
|
|
5
6
|
export declare const Parent: import("koota").Trait<() => string>;
|
|
6
7
|
export declare const Pose: import("koota").Trait<{
|
|
@@ -178,22 +179,4 @@ export declare const Geometry: (geometry: ViamGeometry) => import("koota").Trait
|
|
|
178
179
|
}>, Partial<{
|
|
179
180
|
r: number;
|
|
180
181
|
}>] | [import("koota").Trait<() => ThreeBufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>>, ThreeBufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>];
|
|
181
|
-
export declare const
|
|
182
|
-
x: number;
|
|
183
|
-
y: number;
|
|
184
|
-
z: number;
|
|
185
|
-
} | import("koota").Trait<{
|
|
186
|
-
x: number;
|
|
187
|
-
y: number;
|
|
188
|
-
z: number;
|
|
189
|
-
}>)[] | ({
|
|
190
|
-
r: number;
|
|
191
|
-
l: number;
|
|
192
|
-
} | import("koota").Trait<{
|
|
193
|
-
l: number;
|
|
194
|
-
r: number;
|
|
195
|
-
}>)[] | ({
|
|
196
|
-
r: number;
|
|
197
|
-
} | import("koota").Trait<{
|
|
198
|
-
r: number;
|
|
199
|
-
}>)[];
|
|
182
|
+
export declare const updateGeometryTrait: (entity: Entity, geometry?: ViamGeometry) => void;
|
package/dist/ecs/traits.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Geometry as ViamGeometry } from '@viamrobotics/sdk';
|
|
1
2
|
import { trait } from 'koota';
|
|
2
3
|
import { BufferGeometry as ThreeBufferGeometry } from 'three';
|
|
3
|
-
import { Geometry as ViamGeometry } from '@viamrobotics/sdk';
|
|
4
4
|
import { createBox, createCapsule, createSphere } from '../geometry';
|
|
5
5
|
import { parsePlyInput } from '../ply';
|
|
6
6
|
export const Name = trait(() => '');
|
|
@@ -126,18 +126,45 @@ export const Geometry = (geometry) => {
|
|
|
126
126
|
}
|
|
127
127
|
return ReferenceFrame;
|
|
128
128
|
};
|
|
129
|
-
export const
|
|
129
|
+
export const updateGeometryTrait = (entity, geometry) => {
|
|
130
|
+
if (!geometry) {
|
|
131
|
+
entity.remove(Box, Capsule, Sphere, BufferGeometry);
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
130
134
|
if (geometry.geometryType.case === 'box') {
|
|
131
|
-
|
|
135
|
+
if (entity.has(Box)) {
|
|
136
|
+
entity.set(Box, createBox(geometry.geometryType.value));
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
entity.remove(Capsule, Sphere, BufferGeometry);
|
|
140
|
+
entity.add(Box(createBox(geometry.geometryType.value)));
|
|
141
|
+
}
|
|
132
142
|
}
|
|
133
143
|
else if (geometry.geometryType.case === 'capsule') {
|
|
134
|
-
|
|
144
|
+
if (entity.has(Capsule)) {
|
|
145
|
+
entity.set(Capsule, createCapsule(geometry.geometryType.value));
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
entity.remove(Box, Sphere, BufferGeometry);
|
|
149
|
+
entity.add(Capsule(createCapsule(geometry.geometryType.value)));
|
|
150
|
+
}
|
|
135
151
|
}
|
|
136
152
|
else if (geometry.geometryType.case === 'sphere') {
|
|
137
|
-
|
|
153
|
+
if (entity.has(Sphere)) {
|
|
154
|
+
entity.set(Sphere, createSphere(geometry.geometryType.value));
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
entity.remove(Box, Capsule, BufferGeometry);
|
|
158
|
+
entity.add(Sphere(createSphere(geometry.geometryType.value)));
|
|
159
|
+
}
|
|
138
160
|
}
|
|
139
161
|
else if (geometry.geometryType.case === 'mesh') {
|
|
140
|
-
|
|
162
|
+
if (entity.has(BufferGeometry)) {
|
|
163
|
+
entity.set(BufferGeometry, parsePlyInput(geometry.geometryType.value.mesh));
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
entity.remove(Box, Sphere, Capsule);
|
|
167
|
+
entity.add(BufferGeometry(parsePlyInput(geometry.geometryType.value.mesh)));
|
|
168
|
+
}
|
|
141
169
|
}
|
|
142
|
-
return [];
|
|
143
170
|
};
|