@viamrobotics/test-widgets 0.15.1 → 0.17.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/README.md +15 -1
- package/dist/api-docs-href.d.ts +2 -2
- package/dist/api-docs-href.js +0 -1
- package/dist/components/api-section.svelte +58 -49
- package/dist/components/api-section.svelte.d.ts +24 -10
- package/dist/components/boundary.svelte +51 -0
- package/dist/components/boundary.svelte.d.ts +5 -0
- package/dist/components/connection-status.svelte +57 -61
- package/dist/components/connection-status.svelte.d.ts +5 -5
- package/dist/components/content-rect.svelte +10 -5
- package/dist/components/content-rect.svelte.d.ts +3 -1
- package/dist/components/error.svelte +15 -5
- package/dist/components/error.svelte.d.ts +8 -1
- package/dist/components/index.d.ts +4 -3
- package/dist/components/index.js +4 -3
- package/dist/components/is-moving.svelte +29 -35
- package/dist/components/is-moving.svelte.d.ts +6 -6
- package/dist/components/maplibre/index.svelte +5 -6
- package/dist/components/maplibre/index.svelte.d.ts +3 -1
- package/dist/components/pose-editor.svelte +83 -15
- package/dist/components/pose-editor.svelte.d.ts +11 -4
- package/dist/components/progress.svelte +1 -0
- package/dist/components/queries.svelte +14 -4
- package/dist/components/queries.svelte.d.ts +6 -1
- package/dist/components/query.svelte +11 -3
- package/dist/components/query.svelte.d.ts +6 -1
- package/dist/components/section/error-key.d.ts +2 -0
- package/dist/components/section/error-key.js +2 -0
- package/dist/components/section/index.d.ts +21 -0
- package/dist/components/section/index.js +21 -0
- package/dist/components/section/section-body.svelte +36 -0
- package/dist/components/section/section-body.svelte.d.ts +13 -0
- package/dist/components/section/section-error-reporter.d.ts +8 -0
- package/dist/components/section/section-error-reporter.js +7 -0
- package/dist/components/section/section-error.svelte +36 -0
- package/dist/components/section/section-error.svelte.d.ts +9 -0
- package/dist/components/section/section-errors.svelte +145 -0
- package/dist/components/section/section-errors.svelte.d.ts +6 -0
- package/dist/components/section/section-heading.svelte +21 -0
- package/dist/components/section/section-heading.svelte.d.ts +9 -0
- package/dist/components/section/section-loading.d.ts +4 -0
- package/dist/components/section/section-loading.js +10 -0
- package/dist/components/section/section-method.svelte +29 -0
- package/dist/components/section/section-method.svelte.d.ts +9 -0
- package/dist/components/section/section-placeholder.svelte +29 -0
- package/dist/components/section/section-placeholder.svelte.d.ts +7 -0
- package/dist/components/section/section-text.svelte +17 -0
- package/dist/components/section/section-text.svelte.d.ts +8 -0
- package/dist/components/section/section-tooltip.svelte +25 -0
- package/dist/components/section/section-tooltip.svelte.d.ts +7 -0
- package/dist/components/section/section.svelte +23 -0
- package/dist/components/section/section.svelte.d.ts +11 -0
- package/dist/components/section/use-section-errors.svelte.d.ts +19 -0
- package/dist/components/section/use-section-errors.svelte.js +49 -0
- package/dist/components/stop-button.svelte +1 -5
- package/dist/components/stop-button.svelte.d.ts +0 -1
- package/dist/components/stop.svelte +31 -14
- package/dist/components/stop.svelte.d.ts +6 -1
- package/dist/components/widgets/arm/arm.svelte +43 -40
- package/dist/components/widgets/arm/get-joint-positions-widget.svelte +10 -9
- package/dist/components/widgets/arm/joint-position-editor.svelte +105 -27
- package/dist/components/widgets/arm/joint-position-editor.svelte.d.ts +4 -3
- package/dist/components/widgets/arm/joint-position-slider.svelte +6 -2
- package/dist/components/widgets/arm/joint-position-slider.svelte.d.ts +2 -1
- package/dist/components/widgets/arm/manual-mode-widget.svelte +16 -6
- package/dist/components/widgets/arm/manual-mode.svelte +1 -5
- package/dist/components/widgets/arm/manual-mode.svelte.d.ts +0 -1
- package/dist/components/widgets/arm/move-to-joint-positions-widget.svelte +22 -8
- package/dist/components/widgets/arm/move-to-joint-positions.svelte +15 -17
- package/dist/components/widgets/arm/move-to-joint-positions.svelte.d.ts +0 -1
- package/dist/components/widgets/arm/move-to-position-control.svelte +45 -33
- package/dist/components/widgets/arm/move-to-position.svelte +97 -34
- package/dist/components/widgets/arm/move-to-position.svelte.d.ts +3 -2
- package/dist/components/widgets/arm/quick-move-widget.svelte +10 -4
- package/dist/components/widgets/arm/quick-move.svelte +1 -4
- package/dist/components/widgets/arm/quick-move.svelte.d.ts +0 -1
- package/dist/components/widgets/arm/use-arm-motion-tracking.svelte.d.ts +16 -0
- package/dist/components/widgets/arm/use-arm-motion-tracking.svelte.js +37 -0
- package/dist/components/widgets/arm/use-edited-targets.svelte.d.ts +9 -0
- package/dist/components/widgets/arm/use-edited-targets.svelte.js +24 -0
- package/dist/components/widgets/audio-input/audio-input.svelte +80 -77
- package/dist/components/widgets/audio-input/get-properties-widget.svelte +16 -16
- package/dist/components/widgets/audio-output/audio-output.svelte +87 -84
- package/dist/components/widgets/audio-output/get-properties-widget.svelte +16 -16
- package/dist/components/widgets/base/base.svelte +78 -43
- package/dist/components/widgets/base/move-straight-widget.svelte +16 -4
- package/dist/components/widgets/base/quick-move-widget.svelte +25 -9
- package/dist/components/widgets/base/quick-move.svelte +5 -6
- package/dist/components/widgets/base/set-power-widget.svelte +20 -8
- package/dist/components/widgets/base/set-power.svelte +6 -4
- package/dist/components/widgets/base/set-velocity-widget.svelte +20 -8
- package/dist/components/widgets/base/set-velocity.svelte +6 -4
- package/dist/components/widgets/base/spin-widget.svelte +20 -8
- package/dist/components/widgets/base/vec3-builder.svelte +3 -2
- package/dist/components/widgets/base/vec3-builder.svelte.d.ts +2 -1
- package/dist/components/widgets/board/analog-read.svelte +2 -4
- package/dist/components/widgets/board/analog-write.svelte +2 -4
- package/dist/components/widgets/board/gpio-read.svelte +2 -1
- package/dist/components/widgets/board/gpio-write.svelte +2 -1
- package/dist/components/widgets/board/pin-section.svelte +5 -6
- package/dist/components/widgets/board/pin-section.svelte.d.ts +3 -2
- package/dist/components/widgets/board/read-write-pins.svelte +2 -2
- package/dist/components/widgets/button/push.svelte +2 -2
- package/dist/components/widgets/camera/camera.svelte +17 -24
- package/dist/components/widgets/camera/live-or-polling-video.svelte +33 -30
- package/dist/components/widgets/custom-control/__tests__/__fixtures__/with-sibling.svelte +10 -0
- package/dist/components/widgets/custom-control/control-frame.svelte +60 -0
- package/dist/components/widgets/custom-control/control-frame.svelte.d.ts +10 -0
- package/dist/components/widgets/custom-control/create-control-host.svelte.d.ts +19 -0
- package/dist/components/widgets/custom-control/create-control-host.svelte.js +26 -0
- package/dist/components/widgets/custom-control/custom-control.d.ts +35 -0
- package/dist/components/widgets/custom-control/custom-control.js +85 -0
- package/dist/components/widgets/custom-control/custom-control.svelte +45 -0
- package/dist/components/widgets/custom-control/custom-control.svelte.d.ts +14 -0
- package/dist/components/widgets/discovery/discovery.svelte +13 -17
- package/dist/components/widgets/encoder/encoder.svelte +25 -21
- package/dist/components/widgets/encoder/get-position-widget.svelte +19 -16
- package/dist/components/widgets/gantry/gantry.svelte +58 -76
- package/dist/components/widgets/gantry/get-position-widget.svelte +15 -14
- package/dist/components/widgets/gantry/home.svelte +21 -10
- package/dist/components/widgets/gantry/move-to-position-widget.svelte +2 -1
- package/dist/components/widgets/gantry/move-to-position.svelte +1 -4
- package/dist/components/widgets/gantry/move-to-position.svelte.d.ts +0 -1
- package/dist/components/widgets/gantry/quick-move-widget.svelte +3 -2
- package/dist/components/widgets/gantry/quick-move.svelte +1 -5
- package/dist/components/widgets/gantry/quick-move.svelte.d.ts +0 -1
- package/dist/components/widgets/generic/generic.svelte +11 -6
- package/dist/components/widgets/gripper/grab-widget.svelte +26 -0
- package/dist/components/widgets/gripper/grab-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/gripper/grab.svelte +3 -19
- package/dist/components/widgets/gripper/grab.svelte.d.ts +1 -2
- package/dist/components/widgets/gripper/gripper.svelte +18 -18
- package/dist/components/widgets/gripper/is-holding-something.svelte +21 -21
- package/dist/components/widgets/gripper/open-widget.svelte +26 -0
- package/dist/components/widgets/gripper/open-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/gripper/open.svelte +3 -19
- package/dist/components/widgets/gripper/open.svelte.d.ts +1 -2
- package/dist/components/widgets/input-controller/input-controller.svelte +10 -16
- package/dist/components/widgets/input-controller/webgamepad.svelte +2 -2
- package/dist/components/widgets/ml-model-service/ml-model-service.svelte +1 -1
- package/dist/components/widgets/motion/frame-select.svelte +4 -2
- package/dist/components/widgets/motion/frame-select.svelte.d.ts +2 -1
- package/dist/components/widgets/motion/motion.svelte +27 -31
- package/dist/components/widgets/motion/move-widget.svelte +32 -12
- package/dist/components/widgets/motion/move-widget.svelte.d.ts +6 -0
- package/dist/components/widgets/motion/move.svelte +6 -16
- package/dist/components/widgets/motion/move.svelte.d.ts +0 -1
- package/dist/components/widgets/motor/go-for-view.svelte +16 -8
- package/dist/components/widgets/motor/go-to-view.svelte +12 -4
- package/dist/components/widgets/motor/motor.svelte +100 -64
- package/dist/components/widgets/motor/quick-move-widget.svelte +16 -8
- package/dist/components/widgets/motor/set-power-widget.svelte +12 -4
- package/dist/components/widgets/motor/set-rpm-widget.svelte +12 -4
- package/dist/components/widgets/movement-sensor/get-accuracy-widget.svelte +8 -11
- package/dist/components/widgets/movement-sensor/get-compass-heading-widget.svelte +8 -11
- package/dist/components/widgets/movement-sensor/get-orientation-widget.svelte +8 -11
- package/dist/components/widgets/movement-sensor/get-position-widget.svelte +8 -11
- package/dist/components/widgets/movement-sensor/movement-sensor.svelte +64 -66
- package/dist/components/widgets/operations-and-sessions/operations-and-sessions.svelte +2 -1
- package/dist/components/widgets/power-sensor/get-current-widget.svelte +8 -11
- package/dist/components/widgets/power-sensor/get-power-widget.svelte +8 -11
- package/dist/components/widgets/power-sensor/get-voltage-widget.svelte +8 -11
- package/dist/components/widgets/power-sensor/power-sensor.svelte +35 -45
- package/dist/components/widgets/sensor/sensor.svelte +8 -12
- package/dist/components/widgets/servo/move-widget.svelte +2 -1
- package/dist/components/widgets/servo/move.svelte +1 -4
- package/dist/components/widgets/servo/move.svelte.d.ts +0 -1
- package/dist/components/widgets/servo/quick-move-widget.svelte +2 -1
- package/dist/components/widgets/servo/quick-move.svelte +1 -5
- package/dist/components/widgets/servo/quick-move.svelte.d.ts +0 -1
- package/dist/components/widgets/servo/servo.svelte +53 -37
- package/dist/components/widgets/slam/get-position-widget.svelte +8 -11
- package/dist/components/widgets/slam/move-on-map.svelte +9 -6
- package/dist/components/widgets/slam/move-on-map.svelte.d.ts +2 -1
- package/dist/components/widgets/slam/slam.svelte +65 -75
- package/dist/components/widgets/switch/position-view.svelte +1 -1
- package/dist/components/widgets/switch/position.svelte +2 -2
- package/dist/components/widgets/switch/switch.svelte +1 -1
- package/dist/components/widgets/vision-service/detection-row.svelte +4 -2
- package/dist/components/widgets/vision-service/detection-row.svelte.d.ts +2 -1
- package/dist/components/widgets/vision-service/fonts/public-sans.json +1 -0
- package/dist/components/widgets/vision-service/fonts/public-sans.png +0 -0
- package/dist/components/widgets/vision-service/image.svelte +4 -4
- package/dist/components/widgets/vision-service/legend.svelte +4 -4
- package/dist/components/widgets/vision-service/public-sans-font.d.ts +5 -0
- package/dist/components/widgets/vision-service/public-sans-font.js +14 -0
- package/dist/components/widgets/vision-service/vision-service.svelte +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +0 -1
- package/package.json +19 -5
- package/dist/components/board/pin-section.svelte +0 -28
- package/dist/components/board/pin-section.svelte.d.ts +0 -9
- package/dist/components/mutation-section.svelte +0 -73
- package/dist/components/mutation-section.svelte.d.ts +0 -16
- package/dist/components/mutation-view.svelte +0 -29
- package/dist/components/mutation-view.svelte.d.ts +0 -10
- package/dist/components/section-group.svelte +0 -64
- package/dist/components/section-group.svelte.d.ts +0 -14
- package/dist/components/section-title.svelte +0 -63
- package/dist/components/section-title.svelte.d.ts +0 -14
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
} from '@viamrobotics/svelte-sdk'
|
|
8
8
|
|
|
9
9
|
import Query from '../../query.svelte'
|
|
10
|
+
import { Section } from '../../section'
|
|
10
11
|
|
|
11
12
|
import QuickMove from './quick-move.svelte'
|
|
12
13
|
|
|
@@ -32,16 +33,16 @@
|
|
|
32
33
|
|
|
33
34
|
<Query
|
|
34
35
|
query={positionQuery}
|
|
35
|
-
|
|
36
|
+
class="h-6"
|
|
36
37
|
>
|
|
37
38
|
{@const positions = positionQuery.data}
|
|
38
39
|
{#if positions !== undefined}
|
|
39
40
|
<QuickMove
|
|
40
41
|
{positions}
|
|
41
|
-
lastError={quickMoveMutation.error}
|
|
42
42
|
moveTo={(newPos: number[], speeds: number[]) => {
|
|
43
43
|
quickMoveMutation.mutate([newPos, speeds], {})
|
|
44
44
|
}}
|
|
45
45
|
/>
|
|
46
46
|
{/if}
|
|
47
47
|
</Query>
|
|
48
|
+
<Section.Error error={quickMoveMutation.error} />
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Button } from '@viamrobotics/prime-core'
|
|
3
3
|
|
|
4
|
-
import ErrorDisplay from '../../error.svelte'
|
|
5
4
|
import Table from '../../table.svelte'
|
|
6
5
|
|
|
7
6
|
interface Props {
|
|
8
7
|
positions: number[]
|
|
9
8
|
moveTo: (newPos: number[], speeds: number[]) => void
|
|
10
|
-
lastError: Error | null
|
|
11
9
|
}
|
|
12
10
|
|
|
13
|
-
const { positions, moveTo
|
|
11
|
+
const { positions, moveTo }: Props = $props()
|
|
14
12
|
|
|
15
13
|
// mm/s
|
|
16
14
|
const quickMoveSpeed = 50
|
|
@@ -65,5 +63,3 @@
|
|
|
65
63
|
{/each}
|
|
66
64
|
</tbody>
|
|
67
65
|
</Table>
|
|
68
|
-
|
|
69
|
-
<ErrorDisplay {lastError} />
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { ResourceName } from '@viamrobotics/sdk'
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import { Section } from '../../section'
|
|
5
|
+
import { ResourceTriplets } from '../../../resource-triplet'
|
|
5
6
|
|
|
6
7
|
import DoCommand from '../do-command/do-command.svelte'
|
|
7
8
|
|
|
@@ -13,7 +14,9 @@
|
|
|
13
14
|
|
|
14
15
|
const { partID, resourceName, isComponent }: Props = $props()
|
|
15
16
|
|
|
16
|
-
const api = $derived(
|
|
17
|
+
const api = $derived(
|
|
18
|
+
isComponent ? ResourceTriplets.GenericComponent : ResourceTriplets.GenericService
|
|
19
|
+
)
|
|
17
20
|
|
|
18
21
|
const genericResourceName = $derived<ResourceName>({
|
|
19
22
|
namespace: 'rdk',
|
|
@@ -24,10 +27,12 @@
|
|
|
24
27
|
</script>
|
|
25
28
|
|
|
26
29
|
<div class="flex flex-col py-2 pl-4">
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
<Section.Heading>
|
|
31
|
+
<Section.Method
|
|
32
|
+
method="DoCommand"
|
|
33
|
+
{api}
|
|
34
|
+
/>
|
|
35
|
+
</Section.Heading>
|
|
31
36
|
</div>
|
|
32
37
|
|
|
33
38
|
{#key genericResourceName}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { GripperClient } from '@viamrobotics/sdk'
|
|
3
|
+
import { createResourceClient, createResourceMutation } from '@viamrobotics/svelte-sdk'
|
|
4
|
+
|
|
5
|
+
import { Section } from '../../section'
|
|
6
|
+
|
|
7
|
+
import Grab from './grab.svelte'
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
partID: string
|
|
11
|
+
resourceName: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const { partID, resourceName }: Props = $props()
|
|
15
|
+
|
|
16
|
+
const client = createResourceClient(
|
|
17
|
+
GripperClient,
|
|
18
|
+
() => partID,
|
|
19
|
+
() => resourceName
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
const grabMutation = createResourceMutation(client, 'grab')
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<Grab onGrab={() => grabMutation.mutate([], {})} />
|
|
26
|
+
<Section.Error error={grabMutation.error} />
|
|
@@ -1,32 +1,17 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Button } from '@viamrobotics/prime-core'
|
|
3
|
-
import { GripperClient } from '@viamrobotics/sdk'
|
|
4
|
-
import { createResourceClient, createResourceMutation } from '@viamrobotics/svelte-sdk'
|
|
5
|
-
|
|
6
|
-
import ErrorDisplay from '../../error.svelte'
|
|
7
3
|
|
|
8
4
|
import ClosedGripperSvg from './closed-gripper-svg.svelte'
|
|
9
5
|
|
|
10
6
|
interface Props {
|
|
11
|
-
|
|
12
|
-
resourceName: string
|
|
7
|
+
onGrab: () => void
|
|
13
8
|
}
|
|
14
9
|
|
|
15
|
-
const {
|
|
16
|
-
|
|
17
|
-
const client = createResourceClient(
|
|
18
|
-
GripperClient,
|
|
19
|
-
() => partID,
|
|
20
|
-
() => resourceName
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
const grabMutation = createResourceMutation(client, 'grab')
|
|
10
|
+
const { onGrab }: Props = $props()
|
|
24
11
|
</script>
|
|
25
12
|
|
|
26
13
|
<Button
|
|
27
|
-
onclick={
|
|
28
|
-
grabMutation.mutate([], {})
|
|
29
|
-
}}
|
|
14
|
+
onclick={onGrab}
|
|
30
15
|
class="w-20 p-3 py-3"
|
|
31
16
|
>
|
|
32
17
|
<div class="flex flex-col gap-2">
|
|
@@ -34,4 +19,3 @@
|
|
|
34
19
|
<p class="font-roboto-mono text-xs uppercase">grab</p>
|
|
35
20
|
</div>
|
|
36
21
|
</Button>
|
|
37
|
-
<ErrorDisplay lastError={grabMutation.error} />
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import ConnectionStatus from '../../connection-status.svelte'
|
|
7
7
|
import IsMoving from '../../is-moving.svelte'
|
|
8
8
|
import StopButton from '../../stop-button.svelte'
|
|
9
|
+
import { ResourceTriplets } from '../../../resource-triplet'
|
|
9
10
|
|
|
10
11
|
import Grab from './grab.svelte'
|
|
11
12
|
import IsHoldingSomething from './is-holding-something.svelte'
|
|
@@ -24,6 +25,8 @@
|
|
|
24
25
|
() => resourceName
|
|
25
26
|
)
|
|
26
27
|
|
|
28
|
+
const openMutation = createResourceMutation(client, 'open')
|
|
29
|
+
const grabMutation = createResourceMutation(client, 'grab')
|
|
27
30
|
const stopMutation = createResourceMutation(client, 'stop')
|
|
28
31
|
</script>
|
|
29
32
|
|
|
@@ -33,33 +36,30 @@
|
|
|
33
36
|
<div class="flex flex-col divide-y @lg:flex-row @lg:divide-x @lg:divide-y-0">
|
|
34
37
|
<span class="flex grow flex-wrap gap-4">
|
|
35
38
|
<ApiSection
|
|
36
|
-
|
|
37
|
-
api=
|
|
38
|
-
|
|
39
|
+
method="Open"
|
|
40
|
+
api={ResourceTriplets.Gripper}
|
|
41
|
+
mutations={[openMutation]}
|
|
42
|
+
class="grow-0 flex-col gap-3 @xs:pr-0"
|
|
39
43
|
>
|
|
40
|
-
<Open
|
|
41
|
-
{partID}
|
|
42
|
-
{resourceName}
|
|
43
|
-
/>
|
|
44
|
+
<Open onOpen={() => openMutation.mutate([], {})} />
|
|
44
45
|
</ApiSection>
|
|
45
46
|
<ApiSection
|
|
46
|
-
|
|
47
|
-
api=
|
|
48
|
-
|
|
47
|
+
method="Grab"
|
|
48
|
+
api={ResourceTriplets.Gripper}
|
|
49
|
+
mutations={[grabMutation]}
|
|
50
|
+
class="grow-0 flex-col gap-3 @xs:pl-0"
|
|
49
51
|
>
|
|
50
|
-
<Grab
|
|
51
|
-
{partID}
|
|
52
|
-
{resourceName}
|
|
53
|
-
/>
|
|
52
|
+
<Grab onGrab={() => grabMutation.mutate([], {})} />
|
|
54
53
|
</ApiSection>
|
|
55
54
|
</span>
|
|
56
55
|
<div class="flex flex-col divide-y">
|
|
57
56
|
<ApiSection
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
class="grow flex-col gap-4"
|
|
58
|
+
method="Stop"
|
|
59
|
+
api={ResourceTriplets.Gripper}
|
|
60
|
+
mutations={[stopMutation]}
|
|
60
61
|
>
|
|
61
62
|
<StopButton
|
|
62
|
-
error={stopMutation.error}
|
|
63
63
|
onStop={() => {
|
|
64
64
|
stopMutation.mutate([])
|
|
65
65
|
}}
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
</ApiSection>
|
|
68
68
|
<IsMoving
|
|
69
69
|
client={GripperClient}
|
|
70
|
-
api=
|
|
70
|
+
api={ResourceTriplets.Gripper}
|
|
71
71
|
{partID}
|
|
72
72
|
{resourceName}
|
|
73
73
|
/>
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
import { createResourceClient, createResourceQuery } from '@viamrobotics/svelte-sdk'
|
|
5
5
|
|
|
6
6
|
import ApiSection from '../../api-section.svelte'
|
|
7
|
-
import
|
|
7
|
+
import { Section } from '../../section'
|
|
8
8
|
import StatusPill from '../../status-pill.svelte'
|
|
9
|
+
import { ResourceTriplets } from '../../../resource-triplet'
|
|
9
10
|
|
|
10
11
|
import ClosedGripperSvg from './closed-gripper-svg.svelte'
|
|
11
12
|
import OpenGripperSvg from './open-gripper-svg.svelte'
|
|
@@ -29,27 +30,26 @@
|
|
|
29
30
|
</script>
|
|
30
31
|
|
|
31
32
|
<ApiSection
|
|
32
|
-
|
|
33
|
-
api=
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
method="IsHoldingSomething"
|
|
34
|
+
api={ResourceTriplets.Gripper}
|
|
35
|
+
class="grow flex-col gap-4"
|
|
36
|
+
queries={[query]}
|
|
36
37
|
>
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
{#if query.data
|
|
40
|
-
|
|
41
|
-
<ClosedGripperSvg />
|
|
42
|
-
{:else}
|
|
43
|
-
<OpenGripperSvg />
|
|
44
|
-
{/if}
|
|
45
|
-
<StatusPill
|
|
46
|
-
isActive={query.data}
|
|
47
|
-
activeText="Holding"
|
|
48
|
-
inactiveText="Empty"
|
|
49
|
-
/>
|
|
38
|
+
<div class="flex items-center gap-2">
|
|
39
|
+
{#if query.data !== undefined}
|
|
40
|
+
{#if query.data}
|
|
41
|
+
<ClosedGripperSvg />
|
|
50
42
|
{:else}
|
|
51
|
-
<
|
|
43
|
+
<OpenGripperSvg />
|
|
52
44
|
{/if}
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
<StatusPill
|
|
46
|
+
isActive={query.data}
|
|
47
|
+
activeText="Holding"
|
|
48
|
+
inactiveText="Empty"
|
|
49
|
+
/>
|
|
50
|
+
{:else}
|
|
51
|
+
<Pill value="Loading" />
|
|
52
|
+
{/if}
|
|
53
|
+
</div>
|
|
54
|
+
<Section.Text class="mt-auto">Updates automatically</Section.Text>
|
|
55
55
|
</ApiSection>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { GripperClient } from '@viamrobotics/sdk'
|
|
3
|
+
import { createResourceClient, createResourceMutation } from '@viamrobotics/svelte-sdk'
|
|
4
|
+
|
|
5
|
+
import { Section } from '../../section'
|
|
6
|
+
|
|
7
|
+
import Open from './open.svelte'
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
partID: string
|
|
11
|
+
resourceName: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const { partID, resourceName }: Props = $props()
|
|
15
|
+
|
|
16
|
+
const client = createResourceClient(
|
|
17
|
+
GripperClient,
|
|
18
|
+
() => partID,
|
|
19
|
+
() => resourceName
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
const openMutation = createResourceMutation(client, 'open')
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<Open onOpen={() => openMutation.mutate([], {})} />
|
|
26
|
+
<Section.Error error={openMutation.error} />
|
|
@@ -1,32 +1,17 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Button } from '@viamrobotics/prime-core'
|
|
3
|
-
import { GripperClient } from '@viamrobotics/sdk'
|
|
4
|
-
import { createResourceClient, createResourceMutation } from '@viamrobotics/svelte-sdk'
|
|
5
|
-
|
|
6
|
-
import ErrorDisplay from '../../error.svelte'
|
|
7
3
|
|
|
8
4
|
import OpenGripperSvg from './open-gripper-svg.svelte'
|
|
9
5
|
|
|
10
6
|
interface Props {
|
|
11
|
-
|
|
12
|
-
resourceName: string
|
|
7
|
+
onOpen: () => void
|
|
13
8
|
}
|
|
14
9
|
|
|
15
|
-
const {
|
|
16
|
-
|
|
17
|
-
const client = createResourceClient(
|
|
18
|
-
GripperClient,
|
|
19
|
-
() => partID,
|
|
20
|
-
() => resourceName
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
const openMutation = createResourceMutation(client, 'open')
|
|
10
|
+
const { onOpen }: Props = $props()
|
|
24
11
|
</script>
|
|
25
12
|
|
|
26
13
|
<Button
|
|
27
|
-
onclick={
|
|
28
|
-
openMutation.mutate([], {})
|
|
29
|
-
}}
|
|
14
|
+
onclick={onOpen}
|
|
30
15
|
class="w-20 p-3 py-3"
|
|
31
16
|
>
|
|
32
17
|
<div class="flex flex-col gap-2">
|
|
@@ -34,4 +19,3 @@
|
|
|
34
19
|
<p class="font-roboto-mono text-xs uppercase">open</p>
|
|
35
20
|
</div>
|
|
36
21
|
</Button>
|
|
37
|
-
<ErrorDisplay lastError={openMutation.error} />
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import ApiSection from '../../api-section.svelte'
|
|
6
6
|
import ConnectionStatus from '../../connection-status.svelte'
|
|
7
|
-
import Query from '../../query.svelte'
|
|
8
7
|
import ReadingsList from '../../readings-list.svelte'
|
|
9
8
|
import RefetchController from '../../refetch-controller.svelte'
|
|
10
9
|
import { createRefetchIntervalStore } from '../../refetch-interval-store.svelte'
|
|
10
|
+
import { ResourceTriplets } from '../../../resource-triplet'
|
|
11
11
|
|
|
12
12
|
import Webgamepad from './webgamepad.svelte'
|
|
13
13
|
|
|
@@ -54,22 +54,16 @@
|
|
|
54
54
|
</div>
|
|
55
55
|
|
|
56
56
|
<ApiSection
|
|
57
|
-
|
|
58
|
-
api=
|
|
59
|
-
|
|
57
|
+
method="GetEvents"
|
|
58
|
+
api={ResourceTriplets.InputController}
|
|
59
|
+
queries={[eventsQuery]}
|
|
60
|
+
class="relative grow flex-col gap-4"
|
|
60
61
|
>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
<ReadingsList
|
|
67
|
-
data={Object.fromEntries(
|
|
68
|
-
eventsQuery.data.map(({ control, value }) => [control, value])
|
|
69
|
-
)}
|
|
70
|
-
/>
|
|
71
|
-
{/if}
|
|
72
|
-
</Query>
|
|
62
|
+
{#if eventsQuery.data !== undefined}
|
|
63
|
+
<ReadingsList
|
|
64
|
+
data={Object.fromEntries(eventsQuery.data.map(({ control, value }) => [control, value]))}
|
|
65
|
+
/>
|
|
66
|
+
{/if}
|
|
73
67
|
</ApiSection>
|
|
74
68
|
{/snippet}
|
|
75
69
|
</ConnectionStatus>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { InputControllerClient, type InputControllerEvent } from '@viamrobotics/sdk'
|
|
4
4
|
import { createResourceClient, createResourceMutation } from '@viamrobotics/svelte-sdk'
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import { Section } from '../../section'
|
|
7
7
|
import StatusPill from '../../status-pill.svelte'
|
|
8
8
|
|
|
9
9
|
import type { StandardGamepadEvent } from './standard-gamepad-event'
|
|
@@ -139,4 +139,4 @@
|
|
|
139
139
|
activeText="Connected"
|
|
140
140
|
inactiveText="Disconnected"
|
|
141
141
|
/>
|
|
142
|
-
<
|
|
142
|
+
<Section.Error error={triggerEventMutation.error} />
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
|
|
2
4
|
import { Label, Select } from '@viamrobotics/prime-core'
|
|
3
5
|
|
|
4
6
|
interface Props {
|
|
5
7
|
value: string
|
|
6
8
|
options: string[]
|
|
7
|
-
label:
|
|
9
|
+
label: Snippet
|
|
8
10
|
onChange: (value: string) => void
|
|
9
11
|
}
|
|
10
12
|
|
|
@@ -12,7 +14,7 @@
|
|
|
12
14
|
</script>
|
|
13
15
|
|
|
14
16
|
<Label>
|
|
15
|
-
{label}
|
|
17
|
+
{@render label()}
|
|
16
18
|
|
|
17
19
|
<Select
|
|
18
20
|
slot="input"
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { createRobotQuery, useRobotClient } from '@viamrobotics/svelte-sdk'
|
|
3
3
|
|
|
4
|
-
import ApiSection from '../../api-section.svelte'
|
|
5
4
|
import ConnectionStatus from '../../connection-status.svelte'
|
|
6
5
|
|
|
7
6
|
import FrameSelect from './frame-select.svelte'
|
|
@@ -32,36 +31,33 @@
|
|
|
32
31
|
|
|
33
32
|
<ConnectionStatus {partID}>
|
|
34
33
|
{#snippet connected()}
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
<MoveWidget
|
|
35
|
+
{partID}
|
|
36
|
+
{resourceName}
|
|
37
|
+
{frameName}
|
|
38
|
+
{destination}
|
|
39
|
+
queries={[frameSystem]}
|
|
38
40
|
>
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
{resourceName}
|
|
61
|
-
{frameName}
|
|
62
|
-
{destination}
|
|
63
|
-
/>
|
|
64
|
-
</div>
|
|
65
|
-
</ApiSection>
|
|
41
|
+
<FrameSelect
|
|
42
|
+
value={frameName}
|
|
43
|
+
options={frameNames}
|
|
44
|
+
onChange={(value) => {
|
|
45
|
+
selectedFrame = value
|
|
46
|
+
// reset the destination to the newly selected frame's parent
|
|
47
|
+
selectedDestination = undefined
|
|
48
|
+
}}
|
|
49
|
+
>
|
|
50
|
+
{#snippet label()}Component{/snippet}
|
|
51
|
+
</FrameSelect>
|
|
52
|
+
<FrameSelect
|
|
53
|
+
value={destination}
|
|
54
|
+
options={destinationOptions}
|
|
55
|
+
onChange={(value) => {
|
|
56
|
+
selectedDestination = value
|
|
57
|
+
}}
|
|
58
|
+
>
|
|
59
|
+
{#snippet label()}Destination frame{/snippet}
|
|
60
|
+
</FrameSelect>
|
|
61
|
+
</MoveWidget>
|
|
66
62
|
{/snippet}
|
|
67
63
|
</ConnectionStatus>
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
|
|
2
4
|
import { MotionClient, type RobotClient } from '@viamrobotics/sdk'
|
|
3
5
|
import {
|
|
4
6
|
createResourceClient,
|
|
@@ -7,6 +9,10 @@
|
|
|
7
9
|
useRobotClient,
|
|
8
10
|
} from '@viamrobotics/svelte-sdk'
|
|
9
11
|
|
|
12
|
+
import ApiSection from '../../api-section.svelte'
|
|
13
|
+
import { type SectionQuery } from '../../section/use-section-errors.svelte'
|
|
14
|
+
import { ResourceTriplets } from '../../../resource-triplet'
|
|
15
|
+
|
|
10
16
|
import Move from './move.svelte'
|
|
11
17
|
import { type MoveInput, parseMoveArgs } from './parse-move-args'
|
|
12
18
|
|
|
@@ -17,9 +23,13 @@
|
|
|
17
23
|
frameName: string
|
|
18
24
|
/** The reference frame the destination pose is expressed in. */
|
|
19
25
|
destination: string
|
|
26
|
+
/** Queries the surrounding controls read, so their errors reach the section's indicator. */
|
|
27
|
+
queries?: SectionQuery[]
|
|
28
|
+
/** Controls rendered above the move form, inside the section. */
|
|
29
|
+
children?: Snippet
|
|
20
30
|
}
|
|
21
31
|
|
|
22
|
-
const { partID, resourceName, frameName, destination }: Props = $props()
|
|
32
|
+
const { partID, resourceName, frameName, destination, queries = [], children }: Props = $props()
|
|
23
33
|
|
|
24
34
|
const robotClient = useRobotClient(() => partID)
|
|
25
35
|
const client = createResourceClient(
|
|
@@ -40,9 +50,9 @@
|
|
|
40
50
|
)
|
|
41
51
|
|
|
42
52
|
const currentPose = $derived(poseQuery.data?.pose)
|
|
43
|
-
const poseError = $derived(poseQuery.error instanceof Error ? poseQuery.error : null)
|
|
44
|
-
|
|
45
53
|
let parseError = $state<Error>()
|
|
54
|
+
// A mutation-shaped source, so a pose that fails to parse shows in the section's indicator.
|
|
55
|
+
const parseFailure = $derived({ error: parseError ?? null })
|
|
46
56
|
|
|
47
57
|
const executeMove = (input: MoveInput) => {
|
|
48
58
|
try {
|
|
@@ -54,12 +64,22 @@
|
|
|
54
64
|
}
|
|
55
65
|
</script>
|
|
56
66
|
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
{
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
<ApiSection
|
|
68
|
+
class="grow flex-col gap-4"
|
|
69
|
+
method="Move"
|
|
70
|
+
api={ResourceTriplets.Motion}
|
|
71
|
+
queries={[...queries, poseQuery]}
|
|
72
|
+
mutations={[move, parseFailure]}
|
|
73
|
+
>
|
|
74
|
+
<div class="flex min-w-0 flex-col gap-4">
|
|
75
|
+
{@render children?.()}
|
|
76
|
+
<Move
|
|
77
|
+
{frameName}
|
|
78
|
+
{destination}
|
|
79
|
+
{currentPose}
|
|
80
|
+
isPending={move.isPending}
|
|
81
|
+
storageKey={`${partID}/${resourceName}/motion-move`}
|
|
82
|
+
onExecute={executeMove}
|
|
83
|
+
/>
|
|
84
|
+
</div>
|
|
85
|
+
</ApiSection>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import { type SectionQuery } from '../../section/use-section-errors.svelte';
|
|
1
3
|
interface Props {
|
|
2
4
|
partID: string;
|
|
3
5
|
resourceName: string;
|
|
@@ -5,6 +7,10 @@ interface Props {
|
|
|
5
7
|
frameName: string;
|
|
6
8
|
/** The reference frame the destination pose is expressed in. */
|
|
7
9
|
destination: string;
|
|
10
|
+
/** Queries the surrounding controls read, so their errors reach the section's indicator. */
|
|
11
|
+
queries?: SectionQuery[];
|
|
12
|
+
/** Controls rendered above the move form, inside the section. */
|
|
13
|
+
children?: Snippet;
|
|
8
14
|
}
|
|
9
15
|
declare const MoveWidget: import("svelte").Component<Props, {}, "">;
|
|
10
16
|
type MoveWidget = ReturnType<typeof MoveWidget>;
|