@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
|
@@ -9,9 +9,11 @@
|
|
|
9
9
|
import ApiSection from '../../api-section.svelte'
|
|
10
10
|
import ConnectionStatus from '../../connection-status.svelte'
|
|
11
11
|
import IsMoving from '../../is-moving.svelte'
|
|
12
|
-
import
|
|
12
|
+
import { Section } from '../../section'
|
|
13
|
+
import { useSectionErrors } from '../../section/use-section-errors.svelte'
|
|
13
14
|
import StopButton from '../../stop-button.svelte'
|
|
14
15
|
import { formatNumeric } from '../../../format'
|
|
16
|
+
import { ResourceTriplets } from '../../../resource-triplet'
|
|
15
17
|
|
|
16
18
|
import Move from './move.svelte'
|
|
17
19
|
import QuickMove from './quick-move.svelte'
|
|
@@ -37,6 +39,11 @@
|
|
|
37
39
|
const quickMoveMutation = createResourceMutation(client, 'move')
|
|
38
40
|
const stopMutation = createResourceMutation(client, 'stop')
|
|
39
41
|
|
|
42
|
+
const quickMoveErrors = useSectionErrors(() => ({
|
|
43
|
+
queries: [positionQuery],
|
|
44
|
+
mutations: [quickMoveMutation],
|
|
45
|
+
}))
|
|
46
|
+
|
|
40
47
|
const moveTo = (angle: number) => {
|
|
41
48
|
moveMutation.mutate([angle], {})
|
|
42
49
|
}
|
|
@@ -53,59 +60,68 @@
|
|
|
53
60
|
<div class="@container grow">
|
|
54
61
|
<div class="grid grid-cols-1 divide-y @2xl:grid-cols-3 @2xl:divide-x @2xl:divide-y-0">
|
|
55
62
|
<ApiSection
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
63
|
+
class="grow flex-col gap-4"
|
|
64
|
+
method="GetPosition"
|
|
65
|
+
api={ResourceTriplets.Servo}
|
|
66
|
+
queries={[positionQuery]}
|
|
59
67
|
>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
<span class="
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
</Query>
|
|
68
|
+
{#if positionQuery.data !== undefined}
|
|
69
|
+
<!-- span required to get unit closer to position reading -->
|
|
70
|
+
<span class="flex flex-row gap-1">
|
|
71
|
+
<span class="font-roboto-mono font-normal"
|
|
72
|
+
>{formatNumeric(positionQuery.data)}</span
|
|
73
|
+
>
|
|
74
|
+
<abbr class="text-subtle-2">º</abbr>
|
|
75
|
+
</span>
|
|
76
|
+
{/if}
|
|
77
|
+
<Section.Text class="mt-auto">Updates automatically</Section.Text>
|
|
71
78
|
</ApiSection>
|
|
72
79
|
<ApiSection
|
|
73
|
-
|
|
74
|
-
|
|
80
|
+
class="grow flex-col gap-4"
|
|
81
|
+
method="Move"
|
|
82
|
+
api={ResourceTriplets.Servo}
|
|
83
|
+
queries={[positionQuery]}
|
|
84
|
+
mutations={[moveMutation]}
|
|
75
85
|
>
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
/>
|
|
83
|
-
{/if}
|
|
84
|
-
</Query>
|
|
86
|
+
{#if positionQuery.data !== undefined}
|
|
87
|
+
<Move
|
|
88
|
+
currentPosition={positionQuery.data}
|
|
89
|
+
{moveTo}
|
|
90
|
+
/>
|
|
91
|
+
{/if}
|
|
85
92
|
</ApiSection>
|
|
86
|
-
<
|
|
87
|
-
|
|
88
|
-
|
|
93
|
+
<Section
|
|
94
|
+
errorReporter={quickMoveErrors}
|
|
95
|
+
class="grow flex-col gap-4"
|
|
89
96
|
>
|
|
90
|
-
<
|
|
97
|
+
<div class="flex flex-col gap-0.5">
|
|
98
|
+
<Section.Heading>
|
|
99
|
+
Quick move
|
|
100
|
+
{#snippet aside()}
|
|
101
|
+
<Section.Errors errors={quickMoveErrors.errors} />
|
|
102
|
+
{/snippet}
|
|
103
|
+
</Section.Heading>
|
|
104
|
+
</div>
|
|
105
|
+
<Section.Body isLoading={quickMoveErrors.isLoading}>
|
|
91
106
|
{#if positionQuery.data !== undefined}
|
|
92
107
|
<QuickMove
|
|
93
108
|
currentPosition={positionQuery.data}
|
|
94
109
|
moveTo={quickMoveTo}
|
|
95
|
-
lastError={quickMoveMutation.error}
|
|
96
110
|
/>
|
|
97
111
|
{/if}
|
|
98
|
-
|
|
99
|
-
|
|
112
|
+
<Section.Text class="mt-auto">Press a button to execute</Section.Text>
|
|
113
|
+
</Section.Body>
|
|
114
|
+
</Section>
|
|
100
115
|
</div>
|
|
101
116
|
</div>
|
|
102
117
|
<div class="flex flex-col divide-y @4xl:ml-auto @4xl:w-full @4xl:max-w-40">
|
|
103
118
|
<ApiSection
|
|
104
|
-
|
|
105
|
-
|
|
119
|
+
class="grow flex-col gap-4"
|
|
120
|
+
method="Stop"
|
|
121
|
+
api={ResourceTriplets.Servo}
|
|
122
|
+
mutations={[stopMutation]}
|
|
106
123
|
>
|
|
107
124
|
<StopButton
|
|
108
|
-
error={stopMutation.error}
|
|
109
125
|
onStop={() => {
|
|
110
126
|
stopMutation.mutate([])
|
|
111
127
|
}}
|
|
@@ -113,7 +129,7 @@
|
|
|
113
129
|
</ApiSection>
|
|
114
130
|
<IsMoving
|
|
115
131
|
client={ServoClient}
|
|
116
|
-
api=
|
|
132
|
+
api={ResourceTriplets.Servo}
|
|
117
133
|
{partID}
|
|
118
134
|
{resourceName}
|
|
119
135
|
/>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { createResourceClient, createResourceQuery } from '@viamrobotics/svelte-sdk'
|
|
4
4
|
|
|
5
5
|
import ApiSection from '../../api-section.svelte'
|
|
6
|
-
import
|
|
6
|
+
import { ResourceTriplets } from '../../../resource-triplet'
|
|
7
7
|
|
|
8
8
|
import Position from './position.svelte'
|
|
9
9
|
|
|
@@ -24,15 +24,12 @@
|
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
26
|
<ApiSection
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
method="GetPosition"
|
|
28
|
+
api={ResourceTriplets.Slam}
|
|
29
|
+
queries={[query]}
|
|
30
|
+
class="grow flex-col gap-4"
|
|
29
31
|
>
|
|
30
|
-
|
|
31
|
-
{query}
|
|
32
|
-
|
|
33
|
-
>
|
|
34
|
-
{#if query.data !== undefined}
|
|
35
|
-
<Position position={query.data} />
|
|
36
|
-
{/if}
|
|
37
|
-
</Query>
|
|
32
|
+
{#if query.data !== undefined}
|
|
33
|
+
<Position position={query.data} />
|
|
34
|
+
{/if}
|
|
38
35
|
</ApiSection>
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Button, Label, NumericInput } from '@viamrobotics/prime-core'
|
|
3
3
|
|
|
4
|
+
import type { SectionMutation } from '../../section/use-section-errors.svelte'
|
|
5
|
+
|
|
4
6
|
import ApiSection from '../../api-section.svelte'
|
|
5
|
-
import ErrorDisplay from '../../error.svelte'
|
|
6
7
|
import { numberValueFromEvent } from '../../../event-handlers'
|
|
8
|
+
import { ResourceTriplets } from '../../../resource-triplet'
|
|
7
9
|
|
|
8
10
|
import type { PosePosition } from './pose'
|
|
9
11
|
|
|
@@ -12,10 +14,10 @@
|
|
|
12
14
|
updateDestination: (_: Partial<PosePosition>) => void
|
|
13
15
|
moveOnMap: (planDeviationM: number | undefined) => void
|
|
14
16
|
stopPlan: () => void
|
|
15
|
-
|
|
17
|
+
mutations: SectionMutation[]
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
const { destination, updateDestination, moveOnMap, stopPlan,
|
|
20
|
+
const { destination, updateDestination, moveOnMap, stopPlan, mutations }: Props = $props()
|
|
19
21
|
|
|
20
22
|
const destinationID = $props.id()
|
|
21
23
|
|
|
@@ -23,8 +25,10 @@
|
|
|
23
25
|
</script>
|
|
24
26
|
|
|
25
27
|
<ApiSection
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
class="grow flex-col gap-4"
|
|
29
|
+
method="MoveOnMap"
|
|
30
|
+
api={ResourceTriplets.Motion}
|
|
31
|
+
{mutations}
|
|
28
32
|
>
|
|
29
33
|
<Label>
|
|
30
34
|
Plan deviation <abbr>(m)</abbr>
|
|
@@ -100,5 +104,4 @@
|
|
|
100
104
|
Stop
|
|
101
105
|
</Button>
|
|
102
106
|
</div>
|
|
103
|
-
<ErrorDisplay {lastError} />
|
|
104
107
|
</ApiSection>
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type { SectionMutation } from '../../section/use-section-errors.svelte';
|
|
1
2
|
import type { PosePosition } from './pose';
|
|
2
3
|
interface Props {
|
|
3
4
|
destination: PosePosition | undefined;
|
|
4
5
|
updateDestination: (_: Partial<PosePosition>) => void;
|
|
5
6
|
moveOnMap: (planDeviationM: number | undefined) => void;
|
|
6
7
|
stopPlan: () => void;
|
|
7
|
-
|
|
8
|
+
mutations: SectionMutation[];
|
|
8
9
|
}
|
|
9
10
|
declare const MoveOnMap: import("svelte").Component<Props, {}, "">;
|
|
10
11
|
type MoveOnMap = ReturnType<typeof MoveOnMap>;
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
|
|
17
17
|
import ApiSection from '../../api-section.svelte'
|
|
18
18
|
import ConnectionStatus from '../../connection-status.svelte'
|
|
19
|
-
import Queries from '../../queries.svelte'
|
|
20
|
-
import Query from '../../query.svelte'
|
|
21
19
|
import RefetchController from '../../refetch-controller.svelte'
|
|
22
20
|
import {
|
|
23
21
|
createRefetchIntervalStore,
|
|
24
22
|
RefetchIntervals,
|
|
25
23
|
} from '../../refetch-interval-store.svelte'
|
|
24
|
+
import { Section } from '../../section'
|
|
26
25
|
import SlamMap2D from '../../slam/map2d/index.svelte'
|
|
26
|
+
import { ResourceTriplets } from '../../../resource-triplet'
|
|
27
27
|
|
|
28
28
|
import type { PosePosition } from './pose'
|
|
29
29
|
|
|
@@ -178,44 +178,41 @@
|
|
|
178
178
|
|
|
179
179
|
<ConnectionStatus {partID}>
|
|
180
180
|
{#snippet connected()}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
{refetchInterval}
|
|
200
|
-
queries={[positionQuery, pointCloudMapQuery]}
|
|
201
|
-
/>
|
|
202
|
-
</div>
|
|
181
|
+
{#if propertiesQuery.data?.cloudSlam}
|
|
182
|
+
<div class="p-4 text-sm">
|
|
183
|
+
This resource is using Cloud SLAM. <a
|
|
184
|
+
href="https://docs.viam.com/operate/reference/services/slam/cloudslam/"
|
|
185
|
+
target="_blank"
|
|
186
|
+
class="text-link">Learn more</a
|
|
187
|
+
>.
|
|
188
|
+
</div>
|
|
189
|
+
{:else}
|
|
190
|
+
<div class="@container">
|
|
191
|
+
<div class="flex flex-col @2xl:flex-row @2xl:divide-x">
|
|
192
|
+
<div class="divide-y">
|
|
193
|
+
<div class="m-4">
|
|
194
|
+
<RefetchController
|
|
195
|
+
{refetchInterval}
|
|
196
|
+
queries={[positionQuery, pointCloudMapQuery]}
|
|
197
|
+
/>
|
|
198
|
+
</div>
|
|
203
199
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
{/if}
|
|
215
|
-
</Queries>
|
|
216
|
-
</ApiSection>
|
|
200
|
+
<ApiSection
|
|
201
|
+
class="grow flex-col gap-4"
|
|
202
|
+
method="GetPosition"
|
|
203
|
+
api={ResourceTriplets.Slam}
|
|
204
|
+
queries={[propertiesQuery, positionQuery, pointCloudMapQuery]}
|
|
205
|
+
>
|
|
206
|
+
{#if positionQuery.data !== undefined}
|
|
207
|
+
<Position position={positionQuery.data} />
|
|
208
|
+
{/if}
|
|
209
|
+
</ApiSection>
|
|
217
210
|
|
|
218
|
-
|
|
211
|
+
<Section class="grow flex-col gap-4">
|
|
212
|
+
<div class="flex flex-col gap-0.5">
|
|
213
|
+
<Section.Heading>Motion</Section.Heading>
|
|
214
|
+
</div>
|
|
215
|
+
<Section.Body>
|
|
219
216
|
<Label>
|
|
220
217
|
Base name
|
|
221
218
|
|
|
@@ -233,46 +230,39 @@
|
|
|
233
230
|
bind:value={motionName}
|
|
234
231
|
/>
|
|
235
232
|
</Label>
|
|
236
|
-
</
|
|
233
|
+
</Section.Body>
|
|
234
|
+
</Section>
|
|
237
235
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
236
|
+
<MoveOnMap
|
|
237
|
+
{destination}
|
|
238
|
+
{updateDestination}
|
|
239
|
+
{moveOnMap}
|
|
240
|
+
{stopPlan}
|
|
241
|
+
mutations={[moveOnMapMutation, stopPlanMutation]}
|
|
242
|
+
/>
|
|
243
|
+
</div>
|
|
246
244
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
: undefined}
|
|
266
|
-
helpers={true}
|
|
267
|
-
onClick={handleClick}
|
|
268
|
-
/>
|
|
269
|
-
</div>
|
|
270
|
-
{/if}
|
|
271
|
-
</Queries>
|
|
272
|
-
</div>
|
|
245
|
+
<div class="flex w-full p-4">
|
|
246
|
+
{#if positionQuery.data?.pose !== undefined && pointCloudMapQuery.data !== undefined}
|
|
247
|
+
<div class="h-80 w-full @2xl:h-full">
|
|
248
|
+
<SlamMap2D
|
|
249
|
+
pointcloud={pointCloudMapQuery.data}
|
|
250
|
+
basePose={{
|
|
251
|
+
// Position is returned in millimeters, but the map uses meters
|
|
252
|
+
x: positionQuery.data.pose.x / 1000,
|
|
253
|
+
y: positionQuery.data.pose.y / 1000,
|
|
254
|
+
theta: positionQuery.data.pose.theta,
|
|
255
|
+
}}
|
|
256
|
+
{motionPath}
|
|
257
|
+
destination={destination ? new Vector2(destination.x, destination.y) : undefined}
|
|
258
|
+
helpers={true}
|
|
259
|
+
onClick={handleClick}
|
|
260
|
+
/>
|
|
261
|
+
</div>
|
|
262
|
+
{/if}
|
|
273
263
|
</div>
|
|
274
264
|
</div>
|
|
275
|
-
|
|
276
|
-
|
|
265
|
+
</div>
|
|
266
|
+
{/if}
|
|
277
267
|
{/snippet}
|
|
278
268
|
</ConnectionStatus>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { ToggleButtons } from '@viamrobotics/prime-core'
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import { Section } from '../../section'
|
|
5
5
|
|
|
6
6
|
interface Props {
|
|
7
7
|
numPositions: number
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
cx={[{ '[&>div>button]:w-12!': !hasLabels }, 'font-roboto-mono [&>div]:flex-wrap!']}
|
|
40
40
|
on:input={handleInput}
|
|
41
41
|
/>
|
|
42
|
-
<
|
|
42
|
+
<Section.Error error={lastError} />
|
|
43
43
|
</div>
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
|
|
2
4
|
import type { Detection } from './context.svelte.js'
|
|
3
5
|
|
|
4
6
|
import { useDetections } from './context.svelte.js'
|
|
5
7
|
|
|
6
8
|
interface Props {
|
|
7
9
|
detection: Detection
|
|
8
|
-
label:
|
|
10
|
+
label: Snippet
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
let { detection, label }: Props = $props()
|
|
@@ -33,6 +35,6 @@
|
|
|
33
35
|
context.selected = context.selected === detection.id ? null : detection.id
|
|
34
36
|
}}
|
|
35
37
|
>
|
|
36
|
-
{label}
|
|
38
|
+
{@render label()}
|
|
37
39
|
<span class="text-subtle-2 pl-1">{detection.confidence}%</span>
|
|
38
40
|
</button>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
1
2
|
import type { Detection } from './context.svelte.ts';
|
|
2
3
|
interface Props {
|
|
3
4
|
detection: Detection;
|
|
4
|
-
label:
|
|
5
|
+
label: Snippet;
|
|
5
6
|
}
|
|
6
7
|
declare const DetectionRow: import("svelte").Component<Props, {}, "">;
|
|
7
8
|
type DetectionRow = ReturnType<typeof DetectionRow>;
|