@viamrobotics/motion-tools 1.31.0 → 1.33.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/components/App.svelte +64 -53
- package/dist/components/App.svelte.d.ts +14 -7
- package/dist/components/Entities/Arrows/Arrows.svelte +4 -7
- package/dist/components/Entities/hooks/useEntityEvents.svelte.d.ts +0 -1
- package/dist/components/Entities/hooks/useEntityEvents.svelte.js +30 -16
- package/dist/components/InputBindings.svelte +0 -43
- package/dist/components/KeyboardBindings.svelte +38 -0
- package/dist/components/KeyboardBindings.svelte.d.ts +18 -0
- package/dist/components/PointerMissBox.svelte +6 -3
- package/dist/components/Scene.svelte +43 -61
- package/dist/components/SceneProviders.svelte +2 -7
- package/dist/components/SceneProviders.svelte.d.ts +1 -3
- package/dist/components/Selected.svelte +20 -27
- package/dist/components/SelectedTransformControls.svelte +8 -7
- package/dist/components/StaticGeometries.svelte +3 -5
- package/dist/components/hover/HoveredEntities.svelte +15 -14
- package/dist/components/hover/HoveredEntities.svelte.d.ts +17 -2
- package/dist/components/hover/HoveredEntity.svelte +8 -5
- package/dist/components/hover/HoveredEntity.svelte.d.ts +5 -1
- package/dist/components/hover/LinkedHoveredEntity.svelte +7 -11
- package/dist/components/hover/LinkedHoveredEntity.svelte.d.ts +1 -0
- package/dist/components/overlay/Details.svelte +22 -37
- package/dist/components/overlay/Details.svelte.d.ts +3 -1
- package/dist/components/overlay/controls/Controls.svelte +0 -2
- package/dist/components/overlay/dashboard/Button.svelte +5 -3
- package/dist/components/overlay/dashboard/Button.svelte.d.ts +1 -1
- package/dist/components/overlay/left-pane/Tree.svelte +13 -10
- package/dist/components/overlay/left-pane/TreeContainer.svelte +9 -4
- package/dist/components/overlay/left-pane/TreeNode.svelte +6 -4
- package/dist/components/overlay/settings/ConnectionSettings.svelte +42 -0
- package/dist/components/overlay/settings/ConnectionSettings.svelte.d.ts +18 -0
- package/dist/components/overlay/settings/DebugSettings.svelte +13 -0
- package/dist/components/{xr/frame-configure/Controllers.svelte.d.ts → overlay/settings/DebugSettings.svelte.d.ts} +3 -3
- package/dist/components/overlay/settings/PointcloudSettings.svelte +61 -0
- package/dist/components/overlay/settings/PointcloudSettings.svelte.d.ts +3 -0
- package/dist/components/overlay/settings/SceneSettings.svelte +110 -0
- package/dist/components/overlay/settings/SceneSettings.svelte.d.ts +18 -0
- package/dist/components/overlay/settings/Settings.svelte +27 -312
- package/dist/components/overlay/settings/Settings.svelte.d.ts +8 -1
- package/dist/components/overlay/settings/Tabs.svelte +5 -3
- package/dist/components/overlay/settings/Tabs.svelte.d.ts +3 -3
- package/dist/components/overlay/settings/VisionSettings.svelte +31 -0
- package/dist/components/overlay/settings/VisionSettings.svelte.d.ts +3 -0
- package/dist/components/overlay/settings/WeblabSettings.svelte +27 -0
- package/dist/components/overlay/settings/WeblabSettings.svelte.d.ts +18 -0
- package/dist/components/overlay/settings/WidgetSettings.svelte +49 -0
- package/dist/components/overlay/settings/WidgetSettings.svelte.d.ts +3 -0
- package/dist/components/overlay/widgets/FramePov.svelte +1 -12
- package/dist/draw.d.ts +1 -0
- package/dist/draw.js +1 -1
- package/dist/ecs/index.d.ts +1 -0
- package/dist/ecs/index.js +1 -0
- package/dist/ecs/traits.d.ts +22 -5
- package/dist/ecs/traits.js +33 -4
- package/dist/ecs/useTag.svelte.d.ts +5 -0
- package/dist/ecs/useTag.svelte.js +43 -0
- package/dist/hooks/useEnvironment.svelte.d.ts +1 -1
- package/dist/hooks/useLinked.svelte.js +7 -8
- package/dist/hooks/useMouseRaycaster.svelte.d.ts +4 -3
- package/dist/hooks/useMouseRaycaster.svelte.js +1 -0
- package/dist/hooks/useSettings.svelte.d.ts +1 -1
- package/dist/plugins/Focus/Focus.svelte +45 -0
- package/dist/plugins/Focus/Focus.svelte.d.ts +3 -0
- package/dist/plugins/Focus/FocusBox.svelte +75 -0
- package/dist/plugins/Focus/FocusBox.svelte.d.ts +3 -0
- package/dist/plugins/Focus/provideFocus.svelte.d.ts +1 -0
- package/dist/plugins/Focus/provideFocus.svelte.js +61 -0
- package/dist/{components → plugins}/MeasureTool/MeasureTool.svelte +6 -8
- package/dist/plugins/Selection/SelectionTool.svelte +10 -3
- package/dist/{components/xr → plugins/XR}/ArmTeleop.svelte +3 -5
- package/dist/plugins/XR/DebugPanel.svelte +29 -0
- package/dist/plugins/XR/DebugPanel.svelte.d.ts +3 -0
- package/dist/plugins/XR/OriginMarker.svelte +341 -0
- package/dist/plugins/XR/PendingEditsPanel.svelte +60 -0
- package/dist/plugins/XR/PendingEditsPanel.svelte.d.ts +18 -0
- package/dist/plugins/XR/WristDisplay.svelte +60 -0
- package/dist/plugins/XR/WristDisplay.svelte.d.ts +19 -0
- package/dist/{components/xr → plugins/XR}/XR.svelte +69 -23
- package/dist/plugins/XR/XRPlugins.svelte +9 -0
- package/dist/plugins/XR/XRPlugins.svelte.d.ts +26 -0
- package/dist/plugins/XR/XRSettings.svelte +240 -0
- package/dist/plugins/XR/XRSettings.svelte.d.ts +3 -0
- package/dist/{components/xr → plugins/XR}/XRToast.svelte +6 -9
- package/dist/plugins/XR/debug.svelte.d.ts +7 -0
- package/dist/plugins/XR/debug.svelte.js +13 -0
- package/dist/plugins/XR/frame-configure/Controllers.svelte +413 -0
- package/dist/plugins/XR/teleop/Controllers.svelte.d.ts +3 -0
- package/dist/{components/xr → plugins/XR}/useAnchors.svelte.d.ts +4 -0
- package/dist/{components/xr → plugins/XR}/useAnchors.svelte.js +22 -0
- package/dist/plugins/XR/useOrigin.svelte.d.ts +24 -0
- package/dist/plugins/XR/useOrigin.svelte.js +50 -0
- package/dist/plugins/index.d.ts +4 -0
- package/dist/plugins/index.js +4 -0
- package/dist/three/OBBHelper.js +1 -0
- package/dist/three/arrow.d.ts +2 -0
- package/dist/three/arrow.js +3 -1
- package/package.json +16 -4
- package/dist/components/Focus.svelte +0 -46
- package/dist/components/Focus.svelte.d.ts +0 -7
- package/dist/components/xr/OriginMarker.svelte +0 -151
- package/dist/components/xr/XRControllerSettings.svelte +0 -242
- package/dist/components/xr/XRControllerSettings.svelte.d.ts +0 -3
- package/dist/components/xr/frame-configure/Controllers.svelte +0 -6
- package/dist/components/xr/useOrigin.svelte.d.ts +0 -9
- package/dist/components/xr/useOrigin.svelte.js +0 -27
- package/dist/hooks/useSelection.svelte.d.ts +0 -33
- package/dist/hooks/useSelection.svelte.js +0 -94
- /package/dist/{components → plugins}/MeasureTool/MeasurePoint.svelte +0 -0
- /package/dist/{components → plugins}/MeasureTool/MeasurePoint.svelte.d.ts +0 -0
- /package/dist/{components → plugins}/MeasureTool/MeasureTool.svelte.d.ts +0 -0
- /package/dist/{components/xr → plugins/XR}/ArmTeleop.svelte.d.ts +0 -0
- /package/dist/{components/xr → plugins/XR}/BentPlaneGeometry.svelte +0 -0
- /package/dist/{components/xr → plugins/XR}/BentPlaneGeometry.svelte.d.ts +0 -0
- /package/dist/{components/xr → plugins/XR}/CameraFeed.svelte +0 -0
- /package/dist/{components/xr → plugins/XR}/CameraFeed.svelte.d.ts +0 -0
- /package/dist/{components/xr → plugins/XR}/JointLimitsWidget.svelte +0 -0
- /package/dist/{components/xr → plugins/XR}/JointLimitsWidget.svelte.d.ts +0 -0
- /package/dist/{components/xr → plugins/XR}/OriginMarker.svelte.d.ts +0 -0
- /package/dist/{components/xr → plugins/XR}/PointDistance.svelte +0 -0
- /package/dist/{components/xr → plugins/XR}/PointDistance.svelte.d.ts +0 -0
- /package/dist/{components/xr → plugins/XR}/XR.svelte.d.ts +0 -0
- /package/dist/{components/xr → plugins/XR}/XRConfigPanel.svelte +0 -0
- /package/dist/{components/xr → plugins/XR}/XRConfigPanel.svelte.d.ts +0 -0
- /package/dist/{components/xr → plugins/XR}/XRToast.svelte.d.ts +0 -0
- /package/dist/{components/xr/teleop → plugins/XR/frame-configure}/Controllers.svelte.d.ts +0 -0
- /package/dist/{components/xr → plugins/XR}/math.d.ts +0 -0
- /package/dist/{components/xr → plugins/XR}/math.js +0 -0
- /package/dist/{components/xr → plugins/XR}/teleop/Controllers.svelte +0 -0
- /package/dist/{components/xr → plugins/XR}/toasts.svelte.d.ts +0 -0
- /package/dist/{components/xr → plugins/XR}/toasts.svelte.js +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
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 ConnectionSettings: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type ConnectionSettings = InstanceType<typeof ConnectionSettings>;
|
|
18
|
+
export default ConnectionSettings;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Switch } from '@viamrobotics/prime-core'
|
|
3
|
+
|
|
4
|
+
import { useSettings } from '../../../hooks/useSettings.svelte'
|
|
5
|
+
|
|
6
|
+
const settings = useSettings()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<div class="flex w-full flex-col gap-2.5 text-xs">
|
|
10
|
+
<label class="flex items-center justify-between gap-2">
|
|
11
|
+
Render stats <Switch bind:on={settings.current.renderStats} />
|
|
12
|
+
</label>
|
|
13
|
+
</div>
|
|
@@ -11,8 +11,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
11
11
|
};
|
|
12
12
|
z_$$bindings?: Bindings;
|
|
13
13
|
}
|
|
14
|
-
declare const
|
|
14
|
+
declare const DebugSettings: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
15
|
[evt: string]: CustomEvent<any>;
|
|
16
16
|
}, {}, {}, string>;
|
|
17
|
-
type
|
|
18
|
-
export default
|
|
17
|
+
type DebugSettings = InstanceType<typeof DebugSettings>;
|
|
18
|
+
export default DebugSettings;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Input, Switch } from '@viamrobotics/prime-core'
|
|
3
|
+
import { useResourceNames } from '@viamrobotics/svelte-sdk'
|
|
4
|
+
import { Color } from 'three'
|
|
5
|
+
|
|
6
|
+
import { usePartID } from '../../../hooks/usePartID.svelte'
|
|
7
|
+
import { useSettings } from '../../../hooks/useSettings.svelte'
|
|
8
|
+
|
|
9
|
+
const partID = usePartID()
|
|
10
|
+
const cameras = useResourceNames(() => partID.current, 'camera')
|
|
11
|
+
const settings = useSettings()
|
|
12
|
+
|
|
13
|
+
const { disabledCameras } = $derived(settings.current)
|
|
14
|
+
|
|
15
|
+
const colorHex = $derived(`#${new Color(settings.current.pointColor).getHexString()}`)
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<div class="flex flex-col gap-1 text-xs">
|
|
19
|
+
<label class="flex items-center justify-between gap-2">
|
|
20
|
+
Default point size
|
|
21
|
+
|
|
22
|
+
<div class="w-20">
|
|
23
|
+
<Input
|
|
24
|
+
bind:value={settings.current.pointSize}
|
|
25
|
+
on:keydown={(event) => event.stopImmediatePropagation()}
|
|
26
|
+
/>
|
|
27
|
+
</div>
|
|
28
|
+
</label>
|
|
29
|
+
|
|
30
|
+
<label class="flex items-center justify-between gap-2">
|
|
31
|
+
Default point color
|
|
32
|
+
|
|
33
|
+
<div class="w-20">
|
|
34
|
+
<Input
|
|
35
|
+
type="color"
|
|
36
|
+
value={colorHex}
|
|
37
|
+
on:change={(event) => {
|
|
38
|
+
const value = (event.target as HTMLInputElement).value
|
|
39
|
+
settings.current.pointColor = value
|
|
40
|
+
}}
|
|
41
|
+
on:keydown={(event) => event.stopImmediatePropagation()}
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
</label>
|
|
45
|
+
|
|
46
|
+
<h3 class="border-gray-3 border-b py-1 text-sm"><strong>Enabled cameras</strong></h3>
|
|
47
|
+
|
|
48
|
+
{#each cameras.current as camera (camera)}
|
|
49
|
+
<div class="flex items-center justify-between py-0.5 text-xs">
|
|
50
|
+
{camera.name}
|
|
51
|
+
<Switch
|
|
52
|
+
on={disabledCameras[camera.name] !== true}
|
|
53
|
+
on:change={(event) => {
|
|
54
|
+
disabledCameras[camera.name] = !event.detail
|
|
55
|
+
}}
|
|
56
|
+
/>
|
|
57
|
+
</div>
|
|
58
|
+
{:else}
|
|
59
|
+
No cameras detected
|
|
60
|
+
{/each}
|
|
61
|
+
</div>
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Input, Switch } from '@viamrobotics/prime-core'
|
|
3
|
+
|
|
4
|
+
import { useSettings } from '../../../hooks/useSettings.svelte'
|
|
5
|
+
|
|
6
|
+
import ToggleGroup from '../ToggleGroup.svelte'
|
|
7
|
+
|
|
8
|
+
const settings = useSettings()
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<div class="text-gray-9 flex flex-col gap-1 text-xs">
|
|
12
|
+
<label class="flex items-center justify-between gap-2 py-1">
|
|
13
|
+
Arm Models
|
|
14
|
+
|
|
15
|
+
<ToggleGroup
|
|
16
|
+
multiple
|
|
17
|
+
options={[
|
|
18
|
+
{
|
|
19
|
+
label: 'Colliders',
|
|
20
|
+
value: 'colliders',
|
|
21
|
+
selected: settings.current.renderArmModels.includes('colliders'),
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
label: 'Model',
|
|
25
|
+
value: 'model',
|
|
26
|
+
selected: settings.current.renderArmModels.includes('model'),
|
|
27
|
+
},
|
|
28
|
+
]}
|
|
29
|
+
onSelect={(value) => {
|
|
30
|
+
settings.current.renderArmModels = (value.join('+') || 'colliders') as
|
|
31
|
+
| 'colliders'
|
|
32
|
+
| 'model'
|
|
33
|
+
| 'colliders+model'
|
|
34
|
+
|
|
35
|
+
console.log(settings.current.renderArmModels)
|
|
36
|
+
}}
|
|
37
|
+
/>
|
|
38
|
+
</label>
|
|
39
|
+
|
|
40
|
+
<label class="flex items-center justify-between gap-2">
|
|
41
|
+
Single item hover details <Switch bind:on={settings.current.renderSubEntityHoverDetail} />
|
|
42
|
+
</label>
|
|
43
|
+
|
|
44
|
+
<label class="flex items-center justify-between gap-2">
|
|
45
|
+
Object labels <Switch bind:on={settings.current.enableLabels} />
|
|
46
|
+
</label>
|
|
47
|
+
|
|
48
|
+
<h3 class="border-gray-3 border-b py-1 text-sm"><strong>Grid</strong></h3>
|
|
49
|
+
|
|
50
|
+
<label class="flex items-center justify-between gap-2 py-1">
|
|
51
|
+
Visible <Switch bind:on={settings.current.grid} />
|
|
52
|
+
</label>
|
|
53
|
+
|
|
54
|
+
<label class="flex items-center justify-between gap-2">
|
|
55
|
+
Cell size (m)
|
|
56
|
+
|
|
57
|
+
<div class="w-20">
|
|
58
|
+
<Input
|
|
59
|
+
bind:value={settings.current.gridCellSize}
|
|
60
|
+
on:keydown={(event) => event.stopImmediatePropagation()}
|
|
61
|
+
/>
|
|
62
|
+
</div>
|
|
63
|
+
</label>
|
|
64
|
+
|
|
65
|
+
<label class="flex items-center justify-between gap-2">
|
|
66
|
+
Section size (m)
|
|
67
|
+
|
|
68
|
+
<div class="w-20">
|
|
69
|
+
<Input
|
|
70
|
+
bind:value={settings.current.gridSectionSize}
|
|
71
|
+
on:keydown={(event) => event.stopImmediatePropagation()}
|
|
72
|
+
/>
|
|
73
|
+
</div>
|
|
74
|
+
</label>
|
|
75
|
+
|
|
76
|
+
<label class="flex items-center justify-between gap-2">
|
|
77
|
+
Fade distance (m)
|
|
78
|
+
|
|
79
|
+
<div class="w-20">
|
|
80
|
+
<Input
|
|
81
|
+
bind:value={settings.current.gridFadeDistance}
|
|
82
|
+
on:keydown={(event) => event.stopImmediatePropagation()}
|
|
83
|
+
/>
|
|
84
|
+
</div>
|
|
85
|
+
</label>
|
|
86
|
+
|
|
87
|
+
<h3 class="border-gray-3 border-b py-1 text-sm"><strong>Lines</strong></h3>
|
|
88
|
+
|
|
89
|
+
<label class="flex items-center justify-between gap-2">
|
|
90
|
+
Thickness
|
|
91
|
+
|
|
92
|
+
<div class="w-20">
|
|
93
|
+
<Input
|
|
94
|
+
bind:value={settings.current.lineWidth}
|
|
95
|
+
on:keydown={(event) => event.stopImmediatePropagation()}
|
|
96
|
+
/>
|
|
97
|
+
</div>
|
|
98
|
+
</label>
|
|
99
|
+
|
|
100
|
+
<label class="flex items-center justify-between gap-2">
|
|
101
|
+
Dot size
|
|
102
|
+
|
|
103
|
+
<div class="w-20">
|
|
104
|
+
<Input
|
|
105
|
+
bind:value={settings.current.lineDotSize}
|
|
106
|
+
on:keydown={(event) => event.stopImmediatePropagation()}
|
|
107
|
+
/>
|
|
108
|
+
</div>
|
|
109
|
+
</label>
|
|
110
|
+
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
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 SceneSettings: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type SceneSettings = InstanceType<typeof SceneSettings>;
|
|
18
|
+
export default SceneSettings;
|
|
@@ -1,43 +1,34 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { Component } from 'svelte'
|
|
3
|
+
|
|
2
4
|
import { useThrelte } from '@threlte/core'
|
|
3
5
|
import { Portal } from '@threlte/extras'
|
|
4
|
-
import { Input, Switch } from '@viamrobotics/prime-core'
|
|
5
|
-
import { useResourceNames } from '@viamrobotics/svelte-sdk'
|
|
6
6
|
import { PersistedState } from 'runed'
|
|
7
|
-
import { onMount } from 'svelte'
|
|
8
|
-
import { Color } from 'three'
|
|
9
7
|
|
|
10
8
|
import DashboardButton from '../dashboard/Button.svelte'
|
|
11
|
-
import
|
|
12
|
-
import { useGeometries } from '../../../hooks/useGeometries.svelte'
|
|
13
|
-
import { usePartID } from '../../../hooks/usePartID.svelte'
|
|
14
|
-
import { usePointcloudObjects } from '../../../hooks/usePointcloudObjects.svelte'
|
|
15
|
-
import { usePointClouds } from '../../../hooks/usePointclouds.svelte'
|
|
16
|
-
import { useRefetchPoses } from '../../../hooks/useRefetchPoses'
|
|
17
|
-
import { RefreshRates, useSettings } from '../../../hooks/useSettings.svelte'
|
|
18
|
-
import { useWeblabs, WEBLABS_EXPERIMENTS } from '../../../hooks/useWeblabs.svelte'
|
|
9
|
+
import { useSettings } from '../../../hooks/useSettings.svelte'
|
|
19
10
|
|
|
20
11
|
import FloatingPanel from '../FloatingPanel.svelte'
|
|
21
|
-
import
|
|
22
|
-
import
|
|
12
|
+
import ConnectionSettings from './ConnectionSettings.svelte'
|
|
13
|
+
import DebugSettings from './DebugSettings.svelte'
|
|
14
|
+
import PointcloudSettings from './PointcloudSettings.svelte'
|
|
15
|
+
import SceneSettings from './SceneSettings.svelte'
|
|
23
16
|
import Tabs from './Tabs.svelte'
|
|
17
|
+
import VisionSettings from './VisionSettings.svelte'
|
|
18
|
+
import WeblabSettings from './WeblabSettings.svelte'
|
|
19
|
+
import WidgetSettings from './WidgetSettings.svelte'
|
|
20
|
+
|
|
21
|
+
interface Props {
|
|
22
|
+
settingsTabs?: {
|
|
23
|
+
label: string
|
|
24
|
+
component: Component
|
|
25
|
+
}[]
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let { settingsTabs = [] }: Props = $props()
|
|
24
29
|
|
|
25
30
|
const { invalidate } = useThrelte()
|
|
26
|
-
const partID = usePartID()
|
|
27
|
-
const cameras = useResourceNames(() => partID.current, 'camera')
|
|
28
|
-
const visionServices = useResourceNames(() => partID.current, 'vision')
|
|
29
31
|
const settings = useSettings()
|
|
30
|
-
const { disabledCameras, disabledVisionServices } = $derived(settings.current)
|
|
31
|
-
const geometries = useGeometries()
|
|
32
|
-
const pointclouds = usePointClouds()
|
|
33
|
-
const pointcloudObjects = usePointcloudObjects()
|
|
34
|
-
const { refetchPoses } = useRefetchPoses()
|
|
35
|
-
const weblabs = useWeblabs()
|
|
36
|
-
const knownWeblabs = Object.keys(WEBLABS_EXPERIMENTS)
|
|
37
|
-
|
|
38
|
-
onMount(() => {
|
|
39
|
-
weblabs.load(knownWeblabs)
|
|
40
|
-
})
|
|
41
32
|
|
|
42
33
|
// Invalidate the renderer for any settings change
|
|
43
34
|
$effect(() => {
|
|
@@ -49,14 +40,8 @@
|
|
|
49
40
|
invalidate()
|
|
50
41
|
})
|
|
51
42
|
|
|
52
|
-
const currentRobotCameraWidgets = $derived(
|
|
53
|
-
settings.current.openCameraWidgets[partID.current] || []
|
|
54
|
-
)
|
|
55
|
-
|
|
56
43
|
const isOpen = new PersistedState('settings-is-open', false)
|
|
57
44
|
const activeTab = new PersistedState('settings-active-tab', 'Connection')
|
|
58
|
-
|
|
59
|
-
const colorHex = $derived(`#${new Color(settings.current.pointColor).getHexString()}`)
|
|
60
45
|
</script>
|
|
61
46
|
|
|
62
47
|
<Portal id="dashboard">
|
|
@@ -72,276 +57,6 @@
|
|
|
72
57
|
</fieldset>
|
|
73
58
|
</Portal>
|
|
74
59
|
|
|
75
|
-
{#snippet SectionTitle(title: string)}
|
|
76
|
-
<h3 class="border-gray-3 border-b py-1 text-sm"><strong>{title}</strong></h3>
|
|
77
|
-
{/snippet}
|
|
78
|
-
|
|
79
|
-
{#snippet Connection()}
|
|
80
|
-
<div class="flex flex-col gap-2.5 text-xs">
|
|
81
|
-
{@render SectionTitle('Polling rates')}
|
|
82
|
-
|
|
83
|
-
<RefreshRate
|
|
84
|
-
id={RefreshRates.poses}
|
|
85
|
-
label="Poses"
|
|
86
|
-
allowLive
|
|
87
|
-
onManualRefetch={() => {
|
|
88
|
-
refetchPoses()
|
|
89
|
-
geometries.refetch()
|
|
90
|
-
}}
|
|
91
|
-
/>
|
|
92
|
-
<RefreshRate
|
|
93
|
-
id={RefreshRates.pointclouds}
|
|
94
|
-
label="Pointclouds from cameras"
|
|
95
|
-
onManualRefetch={() => {
|
|
96
|
-
pointclouds.refetch()
|
|
97
|
-
}}
|
|
98
|
-
/>
|
|
99
|
-
<RefreshRate
|
|
100
|
-
id={RefreshRates.vision}
|
|
101
|
-
label="Vision service pointcloud segments and objects"
|
|
102
|
-
onManualRefetch={() => {
|
|
103
|
-
pointcloudObjects.refetch()
|
|
104
|
-
}}
|
|
105
|
-
/>
|
|
106
|
-
</div>
|
|
107
|
-
{/snippet}
|
|
108
|
-
|
|
109
|
-
{#snippet Pointclouds()}
|
|
110
|
-
<div class="flex flex-col gap-1 text-xs">
|
|
111
|
-
<label class="flex items-center justify-between gap-2">
|
|
112
|
-
Default point size
|
|
113
|
-
|
|
114
|
-
<div class="w-20">
|
|
115
|
-
<Input
|
|
116
|
-
bind:value={settings.current.pointSize}
|
|
117
|
-
on:keydown={(event) => event.stopImmediatePropagation()}
|
|
118
|
-
/>
|
|
119
|
-
</div>
|
|
120
|
-
</label>
|
|
121
|
-
|
|
122
|
-
<label class="flex items-center justify-between gap-2">
|
|
123
|
-
Default point color
|
|
124
|
-
|
|
125
|
-
<div class="w-20">
|
|
126
|
-
<Input
|
|
127
|
-
type="color"
|
|
128
|
-
value={colorHex}
|
|
129
|
-
on:change={(event) => {
|
|
130
|
-
const value = (event.target as HTMLInputElement).value
|
|
131
|
-
settings.current.pointColor = value
|
|
132
|
-
}}
|
|
133
|
-
on:keydown={(event) => event.stopImmediatePropagation()}
|
|
134
|
-
/>
|
|
135
|
-
</div>
|
|
136
|
-
</label>
|
|
137
|
-
|
|
138
|
-
{@render SectionTitle('Enabled cameras')}
|
|
139
|
-
|
|
140
|
-
{#each cameras.current as camera (camera)}
|
|
141
|
-
<div class="flex items-center justify-between py-0.5 text-xs">
|
|
142
|
-
{camera.name}
|
|
143
|
-
<Switch
|
|
144
|
-
on={disabledCameras[camera.name] !== true}
|
|
145
|
-
on:change={(event) => {
|
|
146
|
-
disabledCameras[camera.name] = !event.detail
|
|
147
|
-
}}
|
|
148
|
-
/>
|
|
149
|
-
</div>
|
|
150
|
-
{:else}
|
|
151
|
-
No cameras detected
|
|
152
|
-
{/each}
|
|
153
|
-
</div>
|
|
154
|
-
{/snippet}
|
|
155
|
-
|
|
156
|
-
{#snippet Vision()}
|
|
157
|
-
<div class="text-gray-9 flex flex-col gap-1 text-xs">
|
|
158
|
-
{@render SectionTitle('Enabled vision services')}
|
|
159
|
-
|
|
160
|
-
{#each visionServices.current as visionService (visionService)}
|
|
161
|
-
<div class="flex items-center justify-between py-0.5">
|
|
162
|
-
{visionService.name}
|
|
163
|
-
<Switch
|
|
164
|
-
on={disabledVisionServices[visionService.name] !== true}
|
|
165
|
-
on:change={(event) => {
|
|
166
|
-
disabledVisionServices[visionService.name] = !event.detail
|
|
167
|
-
}}
|
|
168
|
-
/>
|
|
169
|
-
</div>
|
|
170
|
-
{:else}
|
|
171
|
-
No vision services detected
|
|
172
|
-
{/each}
|
|
173
|
-
</div>
|
|
174
|
-
{/snippet}
|
|
175
|
-
|
|
176
|
-
{#snippet Scene()}
|
|
177
|
-
<div class="text-gray-9 flex flex-col gap-1 text-xs">
|
|
178
|
-
<label class="flex items-center justify-between gap-2 py-1">
|
|
179
|
-
Arm Models
|
|
180
|
-
|
|
181
|
-
<ToggleGroup
|
|
182
|
-
multiple
|
|
183
|
-
options={[
|
|
184
|
-
{
|
|
185
|
-
label: 'Colliders',
|
|
186
|
-
value: 'colliders',
|
|
187
|
-
selected: settings.current.renderArmModels.includes('colliders'),
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
label: 'Model',
|
|
191
|
-
value: 'model',
|
|
192
|
-
selected: settings.current.renderArmModels.includes('model'),
|
|
193
|
-
},
|
|
194
|
-
]}
|
|
195
|
-
onSelect={(value) => {
|
|
196
|
-
settings.current.renderArmModels = (value.join('+') || 'colliders') as
|
|
197
|
-
| 'colliders'
|
|
198
|
-
| 'model'
|
|
199
|
-
| 'colliders+model'
|
|
200
|
-
|
|
201
|
-
console.log(settings.current.renderArmModels)
|
|
202
|
-
}}
|
|
203
|
-
/>
|
|
204
|
-
</label>
|
|
205
|
-
|
|
206
|
-
<label class="flex items-center justify-between gap-2">
|
|
207
|
-
Single item hover details <Switch bind:on={settings.current.renderSubEntityHoverDetail} />
|
|
208
|
-
</label>
|
|
209
|
-
|
|
210
|
-
<label class="flex items-center justify-between gap-2">
|
|
211
|
-
Object labels <Switch bind:on={settings.current.enableLabels} />
|
|
212
|
-
</label>
|
|
213
|
-
|
|
214
|
-
{@render SectionTitle('Grid')}
|
|
215
|
-
|
|
216
|
-
<label class="flex items-center justify-between gap-2 py-1">
|
|
217
|
-
Visible <Switch bind:on={settings.current.grid} />
|
|
218
|
-
</label>
|
|
219
|
-
|
|
220
|
-
<label class="flex items-center justify-between gap-2">
|
|
221
|
-
Cell size (m)
|
|
222
|
-
|
|
223
|
-
<div class="w-20">
|
|
224
|
-
<Input
|
|
225
|
-
bind:value={settings.current.gridCellSize}
|
|
226
|
-
on:keydown={(event) => event.stopImmediatePropagation()}
|
|
227
|
-
/>
|
|
228
|
-
</div>
|
|
229
|
-
</label>
|
|
230
|
-
|
|
231
|
-
<label class="flex items-center justify-between gap-2">
|
|
232
|
-
Section size (m)
|
|
233
|
-
|
|
234
|
-
<div class="w-20">
|
|
235
|
-
<Input
|
|
236
|
-
bind:value={settings.current.gridSectionSize}
|
|
237
|
-
on:keydown={(event) => event.stopImmediatePropagation()}
|
|
238
|
-
/>
|
|
239
|
-
</div>
|
|
240
|
-
</label>
|
|
241
|
-
|
|
242
|
-
<label class="flex items-center justify-between gap-2">
|
|
243
|
-
Fade distance (m)
|
|
244
|
-
|
|
245
|
-
<div class="w-20">
|
|
246
|
-
<Input
|
|
247
|
-
bind:value={settings.current.gridFadeDistance}
|
|
248
|
-
on:keydown={(event) => event.stopImmediatePropagation()}
|
|
249
|
-
/>
|
|
250
|
-
</div>
|
|
251
|
-
</label>
|
|
252
|
-
|
|
253
|
-
{@render SectionTitle('Lines')}
|
|
254
|
-
|
|
255
|
-
<label class="flex items-center justify-between gap-2">
|
|
256
|
-
Thickness
|
|
257
|
-
|
|
258
|
-
<div class="w-20">
|
|
259
|
-
<Input
|
|
260
|
-
bind:value={settings.current.lineWidth}
|
|
261
|
-
on:keydown={(event) => event.stopImmediatePropagation()}
|
|
262
|
-
/>
|
|
263
|
-
</div>
|
|
264
|
-
</label>
|
|
265
|
-
|
|
266
|
-
<label class="flex items-center justify-between gap-2">
|
|
267
|
-
Dot size
|
|
268
|
-
|
|
269
|
-
<div class="w-20">
|
|
270
|
-
<Input
|
|
271
|
-
bind:value={settings.current.lineDotSize}
|
|
272
|
-
on:keydown={(event) => event.stopImmediatePropagation()}
|
|
273
|
-
/>
|
|
274
|
-
</div>
|
|
275
|
-
</label>
|
|
276
|
-
</div>
|
|
277
|
-
{/snippet}
|
|
278
|
-
|
|
279
|
-
{#snippet Stats()}
|
|
280
|
-
<div class="flex w-full flex-col gap-2.5 text-xs">
|
|
281
|
-
<label class="flex items-center justify-between gap-2">
|
|
282
|
-
Render stats <Switch bind:on={settings.current.renderStats} />
|
|
283
|
-
</label>
|
|
284
|
-
</div>
|
|
285
|
-
{/snippet}
|
|
286
|
-
|
|
287
|
-
{#snippet XR()}
|
|
288
|
-
<div class="flex flex-col gap-2.5 text-xs">
|
|
289
|
-
<XRControllerSettings />
|
|
290
|
-
</div>
|
|
291
|
-
{/snippet}
|
|
292
|
-
|
|
293
|
-
{#snippet Weblabs()}
|
|
294
|
-
<div class="flex flex-col gap-1 text-xs">
|
|
295
|
-
{#each knownWeblabs as experiment (experiment)}
|
|
296
|
-
<label class="flex items-center justify-between gap-2 py-0.5">
|
|
297
|
-
{experiment}
|
|
298
|
-
<Switch
|
|
299
|
-
on={weblabs.isActive(experiment)}
|
|
300
|
-
on:change={() => weblabs.toggle(experiment)}
|
|
301
|
-
/>
|
|
302
|
-
</label>
|
|
303
|
-
{:else}
|
|
304
|
-
No weblabs defined
|
|
305
|
-
{/each}
|
|
306
|
-
</div>
|
|
307
|
-
{/snippet}
|
|
308
|
-
|
|
309
|
-
{#snippet Widgets()}
|
|
310
|
-
<div class="text-gray-9 flex flex-col gap-1 text-xs">
|
|
311
|
-
<label class="flex items-center justify-between gap-2 py-1">
|
|
312
|
-
Arm positions
|
|
313
|
-
<Switch bind:on={settings.current.enableArmPositionsWidget} />
|
|
314
|
-
</label>
|
|
315
|
-
|
|
316
|
-
{@render SectionTitle('Camera widgets')}
|
|
317
|
-
|
|
318
|
-
{#each cameras.current as camera (camera)}
|
|
319
|
-
{@const isWidgetOpen = currentRobotCameraWidgets.includes(camera.name)}
|
|
320
|
-
<div class="flex items-center justify-between gap-2 py-0.5">
|
|
321
|
-
<span class="min-w-0 truncate">{camera.name}</span>
|
|
322
|
-
<Switch
|
|
323
|
-
on={isWidgetOpen}
|
|
324
|
-
on:change={(event) => {
|
|
325
|
-
settings.current.openCameraWidgets = event.detail
|
|
326
|
-
? {
|
|
327
|
-
...settings.current.openCameraWidgets,
|
|
328
|
-
[partID.current]: [...currentRobotCameraWidgets, camera.name],
|
|
329
|
-
}
|
|
330
|
-
: {
|
|
331
|
-
...settings.current.openCameraWidgets,
|
|
332
|
-
[partID.current]: currentRobotCameraWidgets.filter(
|
|
333
|
-
(widget) => widget !== camera.name
|
|
334
|
-
),
|
|
335
|
-
}
|
|
336
|
-
}}
|
|
337
|
-
/>
|
|
338
|
-
</div>
|
|
339
|
-
{:else}
|
|
340
|
-
No cameras detected
|
|
341
|
-
{/each}
|
|
342
|
-
</div>
|
|
343
|
-
{/snippet}
|
|
344
|
-
|
|
345
60
|
<FloatingPanel
|
|
346
61
|
title="Settings"
|
|
347
62
|
bind:isOpen={isOpen.current}
|
|
@@ -350,14 +65,14 @@
|
|
|
350
65
|
<Tabs
|
|
351
66
|
defaultTab={activeTab.current}
|
|
352
67
|
items={[
|
|
353
|
-
{ label: 'Connection',
|
|
354
|
-
{ label: 'Scene',
|
|
355
|
-
{ label: 'Pointclouds',
|
|
356
|
-
{ label: 'Vision',
|
|
357
|
-
{ label: 'Widgets',
|
|
358
|
-
{ label: '
|
|
359
|
-
{ label: 'Weblabs',
|
|
360
|
-
...
|
|
68
|
+
{ label: 'Connection', component: ConnectionSettings },
|
|
69
|
+
{ label: 'Scene', component: SceneSettings },
|
|
70
|
+
{ label: 'Pointclouds', component: PointcloudSettings },
|
|
71
|
+
{ label: 'Vision', component: VisionSettings },
|
|
72
|
+
{ label: 'Widgets', component: WidgetSettings },
|
|
73
|
+
{ label: 'Debug', component: DebugSettings },
|
|
74
|
+
{ label: 'Weblabs', component: WeblabSettings },
|
|
75
|
+
...settingsTabs,
|
|
361
76
|
]}
|
|
362
77
|
onValueChange={(value) => {
|
|
363
78
|
activeTab.current = value
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Component } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
settingsTabs?: {
|
|
4
|
+
label: string;
|
|
5
|
+
component: Component;
|
|
6
|
+
}[];
|
|
7
|
+
}
|
|
8
|
+
declare const Settings: Component<Props, {}, "">;
|
|
2
9
|
type Settings = ReturnType<typeof Settings>;
|
|
3
10
|
export default Settings;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type { Component } from 'svelte'
|
|
3
3
|
|
|
4
4
|
import { normalizeProps, useMachine } from '@zag-js/svelte'
|
|
5
5
|
import * as tabs from '@zag-js/tabs'
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
onValueChange: (value: string) => void
|
|
10
10
|
items: {
|
|
11
11
|
label: string
|
|
12
|
-
|
|
12
|
+
component: Component
|
|
13
13
|
}[]
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -45,11 +45,13 @@
|
|
|
45
45
|
</div>
|
|
46
46
|
|
|
47
47
|
{#each items as item (item.label)}
|
|
48
|
+
{@const Component = item.component}
|
|
49
|
+
|
|
48
50
|
<div
|
|
49
51
|
{...api.getContentProps({ value: item.label })}
|
|
50
52
|
class="h-full w-full overflow-y-auto p-4"
|
|
51
53
|
>
|
|
52
|
-
|
|
54
|
+
<Component />
|
|
53
55
|
</div>
|
|
54
56
|
{/each}
|
|
55
57
|
</div>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Component } from 'svelte';
|
|
2
2
|
interface Props {
|
|
3
3
|
defaultTab?: string;
|
|
4
4
|
onValueChange: (value: string) => void;
|
|
5
5
|
items: {
|
|
6
6
|
label: string;
|
|
7
|
-
|
|
7
|
+
component: Component;
|
|
8
8
|
}[];
|
|
9
9
|
}
|
|
10
|
-
declare const Tabs:
|
|
10
|
+
declare const Tabs: Component<Props, {}, "">;
|
|
11
11
|
type Tabs = ReturnType<typeof Tabs>;
|
|
12
12
|
export default Tabs;
|