@viamrobotics/motion-tools 1.32.0 → 1.33.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 +17 -11
- package/dist/components/App.svelte.d.ts +14 -7
- package/dist/components/Entities/Entities.svelte +18 -25
- package/dist/components/Entities/Entities.svelte.d.ts +2 -17
- package/dist/components/Entities/Label.svelte +79 -13
- package/dist/components/Entities/Label.svelte.d.ts +2 -1
- package/dist/components/Entities/Labels.svelte +36 -0
- package/dist/components/Entities/Labels.svelte.d.ts +3 -0
- package/dist/components/Entities/LineDots.svelte +8 -3
- package/dist/components/Entities/labelLayout/applyTeleports.d.ts +9 -0
- package/dist/components/Entities/labelLayout/applyTeleports.js +39 -0
- package/dist/components/Entities/labelLayout/buildNeighborhood.d.ts +8 -0
- package/dist/components/Entities/labelLayout/buildNeighborhood.js +26 -0
- package/dist/components/Entities/labelLayout/cameraHash.d.ts +8 -0
- package/dist/components/Entities/labelLayout/cameraHash.js +25 -0
- package/dist/components/Entities/labelLayout/cost.d.ts +44 -0
- package/dist/components/Entities/labelLayout/cost.js +126 -0
- package/dist/components/Entities/labelLayout/createLabelLayout.d.ts +27 -0
- package/dist/components/Entities/labelLayout/createLabelLayout.js +194 -0
- package/dist/components/Entities/labelLayout/geometry.d.ts +20 -0
- package/dist/components/Entities/labelLayout/geometry.js +151 -0
- package/dist/components/Entities/labelLayout/labelStore.svelte.d.ts +17 -0
- package/dist/components/Entities/labelLayout/labelStore.svelte.js +28 -0
- package/dist/components/Entities/labelLayout/measure.d.ts +13 -0
- package/dist/components/Entities/labelLayout/measure.js +42 -0
- package/dist/components/Entities/labelLayout/slots.d.ts +11 -0
- package/dist/components/Entities/labelLayout/slots.js +47 -0
- package/dist/components/Entities/labelLayout/solve.d.ts +11 -0
- package/dist/components/Entities/labelLayout/solve.js +93 -0
- package/dist/components/Entities/labelLayout/spatialHash.d.ts +15 -0
- package/dist/components/Entities/labelLayout/spatialHash.js +53 -0
- package/dist/components/Entities/labelLayout/types.d.ts +105 -0
- package/dist/components/Entities/labelLayout/types.js +19 -0
- package/dist/components/Entities/labelLayout/writeBack.d.ts +20 -0
- package/dist/components/Entities/labelLayout/writeBack.js +51 -0
- package/dist/components/Scene.svelte +42 -48
- package/dist/components/SceneProviders.svelte +0 -3
- package/dist/components/SelectedTransformControls.svelte +65 -47
- package/dist/components/overlay/Details.svelte +198 -224
- package/dist/components/overlay/Details.svelte.d.ts +1 -1
- package/dist/components/overlay/Popover.svelte +6 -4
- package/dist/components/overlay/Popover.svelte.d.ts +6 -2
- package/dist/components/overlay/dashboard/Button.svelte +7 -2
- package/dist/components/overlay/dashboard/Button.svelte.d.ts +2 -1
- package/dist/components/overlay/details/AxesHelperDetails.svelte +32 -0
- package/dist/components/overlay/details/AxesHelperDetails.svelte.d.ts +7 -0
- package/dist/components/overlay/details/ColorDetails.svelte +35 -0
- package/dist/components/overlay/details/ColorDetails.svelte.d.ts +7 -0
- package/dist/components/overlay/details/GeometryDetails.svelte +104 -0
- package/dist/components/overlay/details/GeometryDetails.svelte.d.ts +7 -0
- package/dist/components/overlay/details/LineDetails/LineDetails.svelte +196 -0
- package/dist/components/overlay/details/LineDetails/LineDetails.svelte.d.ts +7 -0
- package/dist/components/overlay/details/LineDetails/linePositions.d.ts +3 -0
- package/dist/components/overlay/details/LineDetails/linePositions.js +30 -0
- package/dist/components/overlay/details/OpacityDetails.svelte +44 -0
- package/dist/components/overlay/details/OpacityDetails.svelte.d.ts +7 -0
- package/dist/components/overlay/details/PoseDetails.svelte +189 -0
- package/dist/components/overlay/details/PoseDetails.svelte.d.ts +14 -0
- 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/ecs/traits.d.ts +1 -1
- package/dist/ecs/traits.js +1 -1
- package/dist/hooks/useWorldState.svelte.js +39 -50
- 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 +2 -0
- package/dist/plugins/index.js +2 -0
- package/dist/three/OBBHelper.js +1 -0
- package/package.json +3 -1
- 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/{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
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { useTask, useThrelte } from '@threlte/core'
|
|
3
|
-
import { Grid, useGamepad } from '@threlte/extras'
|
|
4
|
-
import { Hand, useHand, useXR } from '@threlte/xr'
|
|
5
|
-
import { Group, Quaternion, Vector2, Vector3 } from 'three'
|
|
6
|
-
|
|
7
|
-
import { useAnchors } from './useAnchors.svelte'
|
|
8
|
-
import { useOrigin } from './useOrigin.svelte'
|
|
9
|
-
|
|
10
|
-
const origin = useOrigin()
|
|
11
|
-
const anchors = useAnchors()
|
|
12
|
-
|
|
13
|
-
const anchorObject = new Group()
|
|
14
|
-
|
|
15
|
-
const leftPad = useGamepad({ xr: true, hand: 'left' })
|
|
16
|
-
const rightPad = useGamepad({ xr: true, hand: 'right' })
|
|
17
|
-
|
|
18
|
-
let speed = $state(0.05)
|
|
19
|
-
|
|
20
|
-
const vec2 = new Vector2()
|
|
21
|
-
const target = new Vector2()
|
|
22
|
-
|
|
23
|
-
leftPad.squeeze.on('change', () => {
|
|
24
|
-
speed = leftPad.squeeze.pressed ? 0.005 : 0.05
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
leftPad.thumbstick.on('change', ({ value }) => {
|
|
28
|
-
if (typeof value === 'number') {
|
|
29
|
-
return
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const { x: vx, y: vy } = value
|
|
33
|
-
const [x, y, z] = origin.position
|
|
34
|
-
const r = origin.rotation
|
|
35
|
-
|
|
36
|
-
vec2.set(z, r).lerp(target.set(z + vy * speed, r + vx * speed), 0.5)
|
|
37
|
-
|
|
38
|
-
origin.set([x, y, z + vy * speed], r + vx * speed)
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
rightPad.thumbstick.on('change', ({ value }) => {
|
|
42
|
-
if (typeof value === 'number') {
|
|
43
|
-
return
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const { x: vx, y: vy } = value
|
|
47
|
-
const [x, y, z] = origin.position
|
|
48
|
-
const r = origin.rotation
|
|
49
|
-
|
|
50
|
-
vec2.set(x, y).lerp(target.set(x + vx * speed, y + vy * speed), 0.5)
|
|
51
|
-
|
|
52
|
-
origin.set([vec2.x, vec2.y, z], r)
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
const vec3 = new Vector3()
|
|
56
|
-
const quaternion = new Quaternion()
|
|
57
|
-
|
|
58
|
-
$effect(() => {
|
|
59
|
-
vec3.fromArray(origin.position)
|
|
60
|
-
|
|
61
|
-
anchors.createAnchor(vec3, quaternion)?.then((anchor) => {
|
|
62
|
-
anchors.bindAnchorObject(anchor, anchorObject)
|
|
63
|
-
})
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
let startLeftPinchTranslation = new Vector3()
|
|
67
|
-
let leftPinchTranslation = new Vector3()
|
|
68
|
-
let startRightPinchTranslation = new Vector3()
|
|
69
|
-
let rightPinchTranslation = new Vector3()
|
|
70
|
-
|
|
71
|
-
const leftHand = useHand('left')
|
|
72
|
-
const rightHand = useHand('right')
|
|
73
|
-
|
|
74
|
-
let translating = $state(false)
|
|
75
|
-
let rotating = $state(false)
|
|
76
|
-
|
|
77
|
-
const { renderer } = useThrelte()
|
|
78
|
-
const { isPresenting } = useXR()
|
|
79
|
-
|
|
80
|
-
$effect(() => {
|
|
81
|
-
if (!$isPresenting) {
|
|
82
|
-
return
|
|
83
|
-
}
|
|
84
|
-
renderer.xr.getHand(0).addEventListener('pinchstart', () => {
|
|
85
|
-
if (leftHand.current?.targetRay.position) {
|
|
86
|
-
translating = true
|
|
87
|
-
startLeftPinchTranslation.copy(leftHand.current.targetRay.position)
|
|
88
|
-
}
|
|
89
|
-
})
|
|
90
|
-
})
|
|
91
|
-
|
|
92
|
-
useTask(
|
|
93
|
-
() => {
|
|
94
|
-
if (leftHand.current?.targetRay && translating) {
|
|
95
|
-
leftPinchTranslation
|
|
96
|
-
.copy(leftHand.current.targetRay.position)
|
|
97
|
-
.sub(startLeftPinchTranslation)
|
|
98
|
-
origin.set(leftPinchTranslation.toArray(), origin.rotation)
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
running: () => translating,
|
|
103
|
-
}
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
useTask(
|
|
107
|
-
() => {
|
|
108
|
-
if (rightHand.current?.targetRay && rotating) {
|
|
109
|
-
rightPinchTranslation.copy(rightHand.current.targetRay.position)
|
|
110
|
-
const rotation =
|
|
111
|
-
origin.rotation + rightPinchTranslation.distanceTo(startRightPinchTranslation)
|
|
112
|
-
origin.set(leftPinchTranslation.toArray(), rotation)
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
running: () => rotating,
|
|
117
|
-
}
|
|
118
|
-
)
|
|
119
|
-
</script>
|
|
120
|
-
|
|
121
|
-
<Grid
|
|
122
|
-
plane="xy"
|
|
123
|
-
fadeDistance={5}
|
|
124
|
-
fadeOrigin={new Vector3()}
|
|
125
|
-
cellSize={0.1}
|
|
126
|
-
cellColor="#fff"
|
|
127
|
-
sectionColor="#fff"
|
|
128
|
-
/>
|
|
129
|
-
|
|
130
|
-
<Hand
|
|
131
|
-
left
|
|
132
|
-
onpinchstart={() => {
|
|
133
|
-
console.log('pinchstart')
|
|
134
|
-
if (leftHand.current?.targetRay.position) {
|
|
135
|
-
translating = true
|
|
136
|
-
startLeftPinchTranslation.copy(leftHand.current.targetRay.position)
|
|
137
|
-
}
|
|
138
|
-
}}
|
|
139
|
-
onpinchend={() => (translating = false)}
|
|
140
|
-
/>
|
|
141
|
-
|
|
142
|
-
<Hand
|
|
143
|
-
right
|
|
144
|
-
onpinchstart={() => {
|
|
145
|
-
if (rightHand.current?.targetRay.position) {
|
|
146
|
-
rotating = true
|
|
147
|
-
startRightPinchTranslation.copy(rightHand.current.targetRay.position)
|
|
148
|
-
}
|
|
149
|
-
}}
|
|
150
|
-
onpinchend={() => (rotating = false)}
|
|
151
|
-
/>
|
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Select, Switch } from '@viamrobotics/prime-core'
|
|
3
|
-
import { useResourceNames } from '@viamrobotics/svelte-sdk'
|
|
4
|
-
|
|
5
|
-
import { useArmClient } from '../../hooks/useArmClient.svelte'
|
|
6
|
-
import { usePartID } from '../../hooks/usePartID.svelte'
|
|
7
|
-
import { useSettings } from '../../hooks/useSettings.svelte'
|
|
8
|
-
|
|
9
|
-
const settings = useSettings()
|
|
10
|
-
const armClient = useArmClient()
|
|
11
|
-
const partID = usePartID()
|
|
12
|
-
const resources = useResourceNames(() => partID.current, 'gripper')
|
|
13
|
-
|
|
14
|
-
const armNames = $derived(armClient.names || [])
|
|
15
|
-
const gripperNames = $derived(
|
|
16
|
-
resources.current
|
|
17
|
-
.filter((r) => r.subtype === 'gripper' && r.type === 'component')
|
|
18
|
-
.map((r) => r.name)
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
const config = $derived(settings.current.xrController)
|
|
22
|
-
|
|
23
|
-
// Filter available arms/grippers - exclude what the other controller has selected
|
|
24
|
-
const leftAvailableArms = $derived(
|
|
25
|
-
armNames.filter((name) => name === config.left.armName || name !== config.right.armName)
|
|
26
|
-
)
|
|
27
|
-
const rightAvailableArms = $derived(
|
|
28
|
-
armNames.filter((name) => name === config.right.armName || name !== config.left.armName)
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
const leftAvailableGrippers = $derived(
|
|
32
|
-
gripperNames.filter(
|
|
33
|
-
(name) => name === config.left.gripperName || name !== config.right.gripperName
|
|
34
|
-
)
|
|
35
|
-
)
|
|
36
|
-
const rightAvailableGrippers = $derived(
|
|
37
|
-
gripperNames.filter(
|
|
38
|
-
(name) => name === config.right.gripperName || name !== config.left.gripperName
|
|
39
|
-
)
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
function updateConfig(
|
|
43
|
-
hand: 'left' | 'right',
|
|
44
|
-
key: string,
|
|
45
|
-
value: string | number | boolean | undefined
|
|
46
|
-
) {
|
|
47
|
-
settings.current.xrController[hand] = {
|
|
48
|
-
...settings.current.xrController[hand],
|
|
49
|
-
[key]: value,
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
</script>
|
|
53
|
-
|
|
54
|
-
{#snippet SectionTitle(title: string)}
|
|
55
|
-
<h3 class="border-gray-3 border-b py-1 text-sm"><strong>{title}</strong></h3>
|
|
56
|
-
{/snippet}
|
|
57
|
-
|
|
58
|
-
<div class="flex flex-col gap-2.5">
|
|
59
|
-
<label class="flex items-center justify-between gap-2">
|
|
60
|
-
Enable VR / AR mode <Switch bind:on={settings.current.enableXR} />
|
|
61
|
-
</label>
|
|
62
|
-
|
|
63
|
-
<!-- Left Controller -->
|
|
64
|
-
{@render SectionTitle('Left Controller')}
|
|
65
|
-
|
|
66
|
-
<label class="flex items-center justify-between gap-2">
|
|
67
|
-
Arm
|
|
68
|
-
<Select
|
|
69
|
-
value={config.left.armName || ''}
|
|
70
|
-
onchange={(event: Event) => {
|
|
71
|
-
if (event.target instanceof HTMLSelectElement) {
|
|
72
|
-
updateConfig('left', 'armName', event.target.value || undefined)
|
|
73
|
-
}
|
|
74
|
-
}}
|
|
75
|
-
>
|
|
76
|
-
<option value="">None</option>
|
|
77
|
-
{#each leftAvailableArms as armName (armName)}
|
|
78
|
-
<option value={armName}>{armName}</option>
|
|
79
|
-
{/each}
|
|
80
|
-
</Select>
|
|
81
|
-
</label>
|
|
82
|
-
|
|
83
|
-
<label class="flex items-center justify-between gap-2">
|
|
84
|
-
Gripper
|
|
85
|
-
<Select
|
|
86
|
-
value={config.left.gripperName || ''}
|
|
87
|
-
onchange={(event: Event) => {
|
|
88
|
-
if (event.target instanceof HTMLSelectElement) {
|
|
89
|
-
updateConfig('left', 'gripperName', event.target.value || undefined)
|
|
90
|
-
}
|
|
91
|
-
}}
|
|
92
|
-
>
|
|
93
|
-
<option value="">None</option>
|
|
94
|
-
{#each leftAvailableGrippers as gripperName (gripperName)}
|
|
95
|
-
<option value={gripperName}>{gripperName}</option>
|
|
96
|
-
{/each}
|
|
97
|
-
</Select>
|
|
98
|
-
</label>
|
|
99
|
-
|
|
100
|
-
<label class="flex items-center justify-between gap-2">
|
|
101
|
-
Scale: {config.left.scaleFactor.toFixed(1)}
|
|
102
|
-
<input
|
|
103
|
-
class="w-20"
|
|
104
|
-
type="range"
|
|
105
|
-
min="0.1"
|
|
106
|
-
max="3.0"
|
|
107
|
-
step="0.1"
|
|
108
|
-
value={config.left.scaleFactor}
|
|
109
|
-
style="--value: {((config.left.scaleFactor - 0.1) / (3 - 0.1)) * 100}%"
|
|
110
|
-
oninput={(e) => updateConfig('left', 'scaleFactor', Number.parseFloat(e.currentTarget.value))}
|
|
111
|
-
/>
|
|
112
|
-
</label>
|
|
113
|
-
|
|
114
|
-
<label class="flex items-center justify-between gap-2">
|
|
115
|
-
Rotation
|
|
116
|
-
<Switch
|
|
117
|
-
on={config.left.rotationEnabled}
|
|
118
|
-
on:change={(event) => {
|
|
119
|
-
updateConfig('left', 'rotationEnabled', event.detail)
|
|
120
|
-
}}
|
|
121
|
-
/>
|
|
122
|
-
</label>
|
|
123
|
-
|
|
124
|
-
<!-- Right Controller -->
|
|
125
|
-
{@render SectionTitle('Right Controller')}
|
|
126
|
-
|
|
127
|
-
<label class="flex items-center justify-between gap-2">
|
|
128
|
-
Arm
|
|
129
|
-
<Select
|
|
130
|
-
value={config.right.armName || ''}
|
|
131
|
-
onchange={(event: Event) => {
|
|
132
|
-
if (event.target instanceof HTMLSelectElement) {
|
|
133
|
-
updateConfig('right', 'armName', event.target.value || undefined)
|
|
134
|
-
}
|
|
135
|
-
}}
|
|
136
|
-
>
|
|
137
|
-
<option value="">None</option>
|
|
138
|
-
{#each rightAvailableArms as armName (armName)}
|
|
139
|
-
<option value={armName}>{armName}</option>
|
|
140
|
-
{/each}
|
|
141
|
-
</Select>
|
|
142
|
-
</label>
|
|
143
|
-
|
|
144
|
-
<label class="flex items-center justify-between gap-2">
|
|
145
|
-
Gripper
|
|
146
|
-
<Select
|
|
147
|
-
value={config.right.gripperName || ''}
|
|
148
|
-
onchange={(event: Event) => {
|
|
149
|
-
if (event.target instanceof HTMLSelectElement) {
|
|
150
|
-
updateConfig('right', 'gripperName', event.target.value || undefined)
|
|
151
|
-
}
|
|
152
|
-
}}
|
|
153
|
-
>
|
|
154
|
-
<option value="">None</option>
|
|
155
|
-
{#each rightAvailableGrippers as gripperName (gripperName)}
|
|
156
|
-
<option value={gripperName}>{gripperName}</option>
|
|
157
|
-
{/each}
|
|
158
|
-
</Select>
|
|
159
|
-
</label>
|
|
160
|
-
|
|
161
|
-
<label class="flex items-center justify-between gap-2">
|
|
162
|
-
Scale: {config.right.scaleFactor.toFixed(1)}
|
|
163
|
-
<input
|
|
164
|
-
class="w-20"
|
|
165
|
-
type="range"
|
|
166
|
-
min="0.1"
|
|
167
|
-
max="3.0"
|
|
168
|
-
step="0.1"
|
|
169
|
-
value={config.right.scaleFactor}
|
|
170
|
-
style="--value: {((config.right.scaleFactor - 0.1) / (3 - 0.1)) * 100}%"
|
|
171
|
-
oninput={(e) =>
|
|
172
|
-
updateConfig('right', 'scaleFactor', Number.parseFloat(e.currentTarget.value))}
|
|
173
|
-
/>
|
|
174
|
-
</label>
|
|
175
|
-
|
|
176
|
-
<label class="flex items-center justify-between gap-2">
|
|
177
|
-
Rotation
|
|
178
|
-
<Switch
|
|
179
|
-
on={config.right.rotationEnabled}
|
|
180
|
-
on:change={(event) => {
|
|
181
|
-
updateConfig('right', 'rotationEnabled', event.detail)
|
|
182
|
-
}}
|
|
183
|
-
/>
|
|
184
|
-
</label>
|
|
185
|
-
</div>
|
|
186
|
-
|
|
187
|
-
<style>
|
|
188
|
-
input[type='range'] {
|
|
189
|
-
-webkit-appearance: none;
|
|
190
|
-
appearance: none;
|
|
191
|
-
width: 100%;
|
|
192
|
-
background: linear-gradient(
|
|
193
|
-
to right,
|
|
194
|
-
#3d7d3f 0%,
|
|
195
|
-
#3d7d3f var(--value),
|
|
196
|
-
#d1d5db var(--value),
|
|
197
|
-
#d1d5db 100%
|
|
198
|
-
);
|
|
199
|
-
border-radius: 0.25rem;
|
|
200
|
-
height: 0.5rem;
|
|
201
|
-
cursor: pointer;
|
|
202
|
-
outline: none;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
/* Webkit browsers (Chrome, Safari, Edge) */
|
|
206
|
-
input[type='range']::-webkit-slider-track {
|
|
207
|
-
background: transparent;
|
|
208
|
-
height: 0.5rem;
|
|
209
|
-
border-radius: 0.25rem;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
input[type='range']::-webkit-slider-thumb {
|
|
213
|
-
-webkit-appearance: none;
|
|
214
|
-
appearance: none;
|
|
215
|
-
background: #3d7d3f;
|
|
216
|
-
height: 1.25rem;
|
|
217
|
-
width: 1.25rem;
|
|
218
|
-
border-radius: 50%;
|
|
219
|
-
border: 2px solid white;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/* Firefox */
|
|
223
|
-
input[type='range']::-moz-range-track {
|
|
224
|
-
background: transparent;
|
|
225
|
-
height: 0.5rem;
|
|
226
|
-
border-radius: 0.25rem;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
input[type='range']::-moz-range-thumb {
|
|
230
|
-
background: #3d7d3f;
|
|
231
|
-
height: 1.25rem;
|
|
232
|
-
width: 1.25rem;
|
|
233
|
-
border-radius: 50%;
|
|
234
|
-
border: 2px solid white;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
input[type='range']::-moz-range-progress {
|
|
238
|
-
background: #3d7d3f;
|
|
239
|
-
height: 0.5rem;
|
|
240
|
-
border-radius: 0.25rem;
|
|
241
|
-
}
|
|
242
|
-
</style>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Vector3Tuple } from 'three';
|
|
2
|
-
interface Context {
|
|
3
|
-
position: Vector3Tuple;
|
|
4
|
-
rotation: number;
|
|
5
|
-
set: (pos?: Vector3Tuple, rot?: number) => void;
|
|
6
|
-
}
|
|
7
|
-
export declare const provideOrigin: () => void;
|
|
8
|
-
export declare const useOrigin: () => Context;
|
|
9
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { getContext, setContext } from 'svelte';
|
|
2
|
-
const key = Symbol('origin-context');
|
|
3
|
-
export const provideOrigin = () => {
|
|
4
|
-
const position = $state([0, 0, 0]);
|
|
5
|
-
let rotation = $state(0);
|
|
6
|
-
setContext(key, {
|
|
7
|
-
get position() {
|
|
8
|
-
return position;
|
|
9
|
-
},
|
|
10
|
-
get rotation() {
|
|
11
|
-
return rotation;
|
|
12
|
-
},
|
|
13
|
-
set(pos, rot) {
|
|
14
|
-
if (pos) {
|
|
15
|
-
position[0] = pos[0];
|
|
16
|
-
position[1] = pos[1];
|
|
17
|
-
position[2] = pos[2];
|
|
18
|
-
}
|
|
19
|
-
if (rot !== undefined) {
|
|
20
|
-
rotation = rot;
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
export const useOrigin = () => {
|
|
26
|
-
return getContext(key);
|
|
27
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|