@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
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import ApiSection from '../../api-section.svelte'
|
|
6
6
|
import Properties from '../../audio-properties.svelte'
|
|
7
|
-
import
|
|
7
|
+
import { Section } from '../../section'
|
|
8
|
+
import { ResourceTriplets } from '../../../resource-triplet'
|
|
8
9
|
|
|
9
10
|
interface Props {
|
|
10
11
|
partID: string
|
|
@@ -23,20 +24,19 @@
|
|
|
23
24
|
</script>
|
|
24
25
|
|
|
25
26
|
<ApiSection
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
method="GetProperties"
|
|
28
|
+
api={ResourceTriplets.AudioInput}
|
|
29
|
+
queries={[query]}
|
|
30
|
+
class="grow flex-col gap-4"
|
|
29
31
|
>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
{/if}
|
|
41
|
-
</Query>
|
|
32
|
+
{#snippet subheading()}
|
|
33
|
+
<Section.Text>Audio input properties</Section.Text>
|
|
34
|
+
{/snippet}
|
|
35
|
+
{#if query.data !== undefined}
|
|
36
|
+
<Properties
|
|
37
|
+
supportedCodecs={query.data.supportedCodecs}
|
|
38
|
+
sampleRateHz={query.data.sampleRateHz}
|
|
39
|
+
numChannels={query.data.numChannels}
|
|
40
|
+
/>
|
|
41
|
+
{/if}
|
|
42
42
|
</ApiSection>
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
import ApiSection from '../../api-section.svelte'
|
|
7
7
|
import Properties from '../../audio-properties.svelte'
|
|
8
8
|
import ConnectionStatus from '../../connection-status.svelte'
|
|
9
|
-
import MutationSection from '../../mutation-section.svelte'
|
|
10
|
-
import Query from '../../query.svelte'
|
|
11
9
|
import RefetchController from '../../refetch-controller.svelte'
|
|
12
10
|
import { createRefetchIntervalStore } from '../../refetch-interval-store.svelte'
|
|
11
|
+
import { Section } from '../../section'
|
|
13
12
|
import { numberValueFromEvent } from '../../../event-handlers'
|
|
13
|
+
import { ResourceTriplets } from '../../../resource-triplet'
|
|
14
14
|
|
|
15
15
|
import { ExtToCodec, MimeToCodec } from './codec.js'
|
|
16
16
|
import { createAudioPlayer } from './create-audio-player.svelte.js'
|
|
@@ -106,96 +106,99 @@
|
|
|
106
106
|
<div class="@container">
|
|
107
107
|
<div class="flex flex-col divide-y @2xl:flex-row @2xl:divide-x @2xl:divide-y-0">
|
|
108
108
|
<div class="flex w-full flex-col divide-y">
|
|
109
|
-
<
|
|
110
|
-
|
|
111
|
-
api=
|
|
112
|
-
|
|
113
|
-
|
|
109
|
+
<ApiSection
|
|
110
|
+
method="Play"
|
|
111
|
+
api={ResourceTriplets.AudioOutput}
|
|
112
|
+
mutations={[playContext]}
|
|
113
|
+
class="flex-row flex-wrap gap-2"
|
|
114
114
|
>
|
|
115
|
-
|
|
116
|
-
<
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
115
|
+
{#snippet subheading()}
|
|
116
|
+
<Section.Text>Send audio data to the device</Section.Text>
|
|
117
|
+
{/snippet}
|
|
118
|
+
<div class="flex grow flex-wrap justify-between gap-2">
|
|
119
|
+
<div class="flex flex-col gap-2">
|
|
120
|
+
<Label cx="gap-1 text-xs">
|
|
121
|
+
Audio file
|
|
122
|
+
<input
|
|
123
|
+
slot="input"
|
|
124
|
+
type="file"
|
|
125
|
+
accept={availableCodecs.map((c) => `.${c}`).join(',')}
|
|
126
|
+
class="text-xs"
|
|
127
|
+
onchange={handleFileChange}
|
|
128
|
+
/>
|
|
129
|
+
</Label>
|
|
130
|
+
{#if fileInputError}
|
|
131
|
+
<p class="text-xs text-red-500">{fileInputError}</p>
|
|
132
|
+
{/if}
|
|
133
|
+
{#if selectedFile}
|
|
134
|
+
<p class="font-roboto-mono text-subtle-1 text-xs">{selectedFile.name}</p>
|
|
135
|
+
{/if}
|
|
136
|
+
<Label cx="gap-1 text-xs">
|
|
137
|
+
Codec
|
|
138
|
+
<Select
|
|
139
|
+
slot="input"
|
|
140
|
+
value={selectedCodec}
|
|
141
|
+
on:change={(e) => {
|
|
142
|
+
playCodec = (e.target as HTMLSelectElement).value
|
|
143
|
+
}}
|
|
144
|
+
>
|
|
145
|
+
{#each availableCodecs as codec (codec)}
|
|
146
|
+
<option value={codec}>{codec}</option>
|
|
147
|
+
{/each}
|
|
148
|
+
</Select>
|
|
149
|
+
</Label>
|
|
150
|
+
<Label cx="gap-1 text-xs">
|
|
151
|
+
Sample rate (Hz)
|
|
152
|
+
<NumericInput
|
|
153
|
+
slot="input"
|
|
154
|
+
value={selectedSampleRateHz}
|
|
155
|
+
on:change={(e) => {
|
|
156
|
+
playSampleRateHz = numberValueFromEvent(e) ?? null
|
|
157
|
+
}}
|
|
158
|
+
/>
|
|
159
|
+
</Label>
|
|
160
|
+
<Label cx="gap-1 text-xs">
|
|
161
|
+
Channels
|
|
162
|
+
<NumericInput
|
|
163
|
+
slot="input"
|
|
164
|
+
value={selectedNumChannels}
|
|
165
|
+
on:change={(e) => {
|
|
166
|
+
playNumChannels = numberValueFromEvent(e) ?? null
|
|
167
|
+
}}
|
|
168
|
+
/>
|
|
169
|
+
</Label>
|
|
170
|
+
</div>
|
|
171
|
+
|
|
172
|
+
<div class="mt-auto">
|
|
173
|
+
<Button
|
|
174
|
+
icon="play-circle-outline"
|
|
175
|
+
onclick={play}
|
|
176
|
+
disabled={!client.current || playContext.status === 'playing'}
|
|
140
177
|
>
|
|
141
|
-
{
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
</Select>
|
|
145
|
-
</Label>
|
|
146
|
-
<Label cx="gap-1 text-xs">
|
|
147
|
-
Sample rate (Hz)
|
|
148
|
-
<NumericInput
|
|
149
|
-
slot="input"
|
|
150
|
-
value={selectedSampleRateHz}
|
|
151
|
-
on:change={(e) => {
|
|
152
|
-
playSampleRateHz = numberValueFromEvent(e) ?? null
|
|
153
|
-
}}
|
|
154
|
-
/>
|
|
155
|
-
</Label>
|
|
156
|
-
<Label cx="gap-1 text-xs">
|
|
157
|
-
Channels
|
|
158
|
-
<NumericInput
|
|
159
|
-
slot="input"
|
|
160
|
-
value={selectedNumChannels}
|
|
161
|
-
on:change={(e) => {
|
|
162
|
-
playNumChannels = numberValueFromEvent(e) ?? null
|
|
163
|
-
}}
|
|
164
|
-
/>
|
|
165
|
-
</Label>
|
|
166
|
-
</div>
|
|
167
|
-
|
|
168
|
-
<div class="mt-auto">
|
|
169
|
-
<Button
|
|
170
|
-
icon="play-circle-outline"
|
|
171
|
-
onclick={play}
|
|
172
|
-
disabled={!client.current || playContext.status === 'playing'}
|
|
173
|
-
>
|
|
174
|
-
{playButtonLabel}
|
|
175
|
-
</Button>
|
|
178
|
+
{playButtonLabel}
|
|
179
|
+
</Button>
|
|
180
|
+
</div>
|
|
176
181
|
</div>
|
|
177
|
-
</
|
|
182
|
+
</ApiSection>
|
|
178
183
|
</div>
|
|
179
184
|
|
|
180
185
|
<div class="flex w-full flex-col divide-y @2xl:ml-auto @2xl:max-w-1/2 @4xl:max-w-1/3">
|
|
181
186
|
<ApiSection
|
|
182
|
-
|
|
183
|
-
api=
|
|
184
|
-
|
|
185
|
-
class="relative"
|
|
187
|
+
method="GetProperties"
|
|
188
|
+
api={ResourceTriplets.AudioOutput}
|
|
189
|
+
queries={[propertiesQuery]}
|
|
190
|
+
class="relative grow flex-col gap-4"
|
|
186
191
|
>
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
{/if}
|
|
198
|
-
</Query>
|
|
192
|
+
{#snippet subheading()}
|
|
193
|
+
<Section.Text>Audio output properties</Section.Text>
|
|
194
|
+
{/snippet}
|
|
195
|
+
{#if propertiesQuery.data !== undefined}
|
|
196
|
+
<Properties
|
|
197
|
+
supportedCodecs={propertiesQuery.data.supportedCodecs}
|
|
198
|
+
sampleRateHz={propertiesQuery.data.sampleRateHz}
|
|
199
|
+
numChannels={propertiesQuery.data.numChannels}
|
|
200
|
+
/>
|
|
201
|
+
{/if}
|
|
199
202
|
</ApiSection>
|
|
200
203
|
</div>
|
|
201
204
|
</div>
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import ApiSection from '../../api-section.svelte'
|
|
6
6
|
import Properties from '../../audio-properties.svelte'
|
|
7
|
-
import
|
|
7
|
+
import { Section } from '../../section'
|
|
8
|
+
import { ResourceTriplets } from '../../../resource-triplet'
|
|
8
9
|
|
|
9
10
|
interface Props {
|
|
10
11
|
partID: string
|
|
@@ -23,20 +24,19 @@
|
|
|
23
24
|
</script>
|
|
24
25
|
|
|
25
26
|
<ApiSection
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
method="GetProperties"
|
|
28
|
+
api={ResourceTriplets.AudioOutput}
|
|
29
|
+
queries={[query]}
|
|
30
|
+
class="grow flex-col gap-4"
|
|
29
31
|
>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
{/if}
|
|
41
|
-
</Query>
|
|
32
|
+
{#snippet subheading()}
|
|
33
|
+
<Section.Text>Audio output properties</Section.Text>
|
|
34
|
+
{/snippet}
|
|
35
|
+
{#if query.data !== undefined}
|
|
36
|
+
<Properties
|
|
37
|
+
supportedCodecs={query.data.supportedCodecs}
|
|
38
|
+
sampleRateHz={query.data.sampleRateHz}
|
|
39
|
+
numChannels={query.data.numChannels}
|
|
40
|
+
/>
|
|
41
|
+
{/if}
|
|
42
42
|
</ApiSection>
|
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
import ApiSection from '../../api-section.svelte'
|
|
7
7
|
import ConnectionStatus from '../../connection-status.svelte'
|
|
8
8
|
import IsMoving from '../../is-moving.svelte'
|
|
9
|
-
import
|
|
9
|
+
import { Section } from '../../section'
|
|
10
|
+
import { useSectionErrors } from '../../section/use-section-errors.svelte'
|
|
10
11
|
import StopButton from '../../stop-button.svelte'
|
|
12
|
+
import { ResourceTriplets } from '../../../resource-triplet'
|
|
11
13
|
|
|
12
14
|
import MoveStraight from './move-straight.svelte'
|
|
13
15
|
import QuickMove from './quick-move.svelte'
|
|
@@ -55,6 +57,8 @@
|
|
|
55
57
|
moveStraightMutation.mutate([distanceMm, mmPerSec], {})
|
|
56
58
|
}
|
|
57
59
|
|
|
60
|
+
const quickMoveErrors = useSectionErrors(() => ({ mutations: [quickSetPowerMutation] }))
|
|
61
|
+
|
|
58
62
|
let quickMoveKeyboardControl = $state(false)
|
|
59
63
|
</script>
|
|
60
64
|
|
|
@@ -62,11 +66,17 @@
|
|
|
62
66
|
{#snippet connected()}
|
|
63
67
|
<div class="@container">
|
|
64
68
|
<div class="flex flex-col divide-y @4xl:flex-row @4xl:divide-x @4xl:divide-y-0">
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
69
|
+
<Section
|
|
70
|
+
errorReporter={quickMoveErrors}
|
|
71
|
+
class="flex-row flex-wrap gap-2"
|
|
68
72
|
>
|
|
69
|
-
|
|
73
|
+
<div class="flex flex-col gap-0.5">
|
|
74
|
+
<Section.Heading>
|
|
75
|
+
Quick move
|
|
76
|
+
{#snippet aside()}
|
|
77
|
+
<Section.Errors errors={quickMoveErrors.errors} />
|
|
78
|
+
{/snippet}
|
|
79
|
+
</Section.Heading>
|
|
70
80
|
<Label>
|
|
71
81
|
Keyboard control
|
|
72
82
|
|
|
@@ -76,20 +86,25 @@
|
|
|
76
86
|
on:change={() => (quickMoveKeyboardControl = !quickMoveKeyboardControl)}
|
|
77
87
|
/>
|
|
78
88
|
</Label>
|
|
79
|
-
|
|
89
|
+
</div>
|
|
80
90
|
|
|
81
|
-
<
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
91
|
+
<Section.Body>
|
|
92
|
+
<div class="flex grow flex-wrap justify-between gap-2">
|
|
93
|
+
<QuickMove
|
|
94
|
+
isKeyboardEnabled={quickMoveKeyboardControl}
|
|
95
|
+
setPower={quickSetPower}
|
|
96
|
+
/>
|
|
97
|
+
</div>
|
|
98
|
+
</Section.Body>
|
|
99
|
+
</Section>
|
|
86
100
|
<div class="flex grow flex-col divide-y @4xl:ml-auto @4xl:w-full @4xl:max-w-40">
|
|
87
101
|
<ApiSection
|
|
88
|
-
|
|
89
|
-
|
|
102
|
+
class="grow flex-col gap-4"
|
|
103
|
+
method="Stop"
|
|
104
|
+
api={ResourceTriplets.Base}
|
|
105
|
+
mutations={[stopMutation]}
|
|
90
106
|
>
|
|
91
107
|
<StopButton
|
|
92
|
-
error={stopMutation.error}
|
|
93
108
|
onStop={() => {
|
|
94
109
|
stopMutation.mutate([])
|
|
95
110
|
}}
|
|
@@ -97,44 +112,64 @@
|
|
|
97
112
|
</ApiSection>
|
|
98
113
|
<IsMoving
|
|
99
114
|
client={BaseClient}
|
|
100
|
-
api=
|
|
115
|
+
api={ResourceTriplets.Base}
|
|
101
116
|
{partID}
|
|
102
117
|
{resourceName}
|
|
103
118
|
/>
|
|
104
119
|
</div>
|
|
105
120
|
</div>
|
|
106
121
|
</div>
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
122
|
+
<ApiSection
|
|
123
|
+
class="flex-row flex-wrap gap-2"
|
|
124
|
+
method="MoveStraight"
|
|
125
|
+
api={ResourceTriplets.Base}
|
|
126
|
+
mutations={[moveStraightMutation]}
|
|
112
127
|
>
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
128
|
+
{#snippet subheading()}
|
|
129
|
+
<Section.Text>Move across a given distance at a given velocity</Section.Text>
|
|
130
|
+
{/snippet}
|
|
131
|
+
<div class="flex grow flex-wrap justify-between gap-2">
|
|
132
|
+
<MoveStraight {moveStraight} />
|
|
133
|
+
</div>
|
|
134
|
+
</ApiSection>
|
|
135
|
+
<ApiSection
|
|
136
|
+
class="flex-row flex-wrap gap-2"
|
|
137
|
+
method="Spin"
|
|
138
|
+
api={ResourceTriplets.Base}
|
|
139
|
+
mutations={[spinMutation]}
|
|
120
140
|
>
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
141
|
+
{#snippet subheading()}
|
|
142
|
+
<Section.Text>Turn to a given angle at a given velocity</Section.Text>
|
|
143
|
+
{/snippet}
|
|
144
|
+
<div class="flex grow flex-wrap justify-between gap-2">
|
|
145
|
+
<Spin {spin} />
|
|
146
|
+
</div>
|
|
147
|
+
</ApiSection>
|
|
148
|
+
<ApiSection
|
|
149
|
+
class="flex-row flex-wrap gap-2"
|
|
150
|
+
method="SetPower"
|
|
151
|
+
api={ResourceTriplets.Base}
|
|
152
|
+
mutations={[setPowerMutation]}
|
|
128
153
|
>
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
154
|
+
{#snippet subheading()}
|
|
155
|
+
<Section.Text>Move continuously at a given amount of power</Section.Text>
|
|
156
|
+
{/snippet}
|
|
157
|
+
<div class="flex grow flex-wrap justify-between gap-2">
|
|
158
|
+
<SetPower {setPower} />
|
|
159
|
+
</div>
|
|
160
|
+
</ApiSection>
|
|
161
|
+
<ApiSection
|
|
162
|
+
class="flex-row flex-wrap gap-2"
|
|
163
|
+
method="SetVelocity"
|
|
164
|
+
api={ResourceTriplets.Base}
|
|
165
|
+
mutations={[setVelocityMutation]}
|
|
136
166
|
>
|
|
137
|
-
|
|
138
|
-
|
|
167
|
+
{#snippet subheading()}
|
|
168
|
+
<Section.Text>Move continually at a given velocity</Section.Text>
|
|
169
|
+
{/snippet}
|
|
170
|
+
<div class="flex grow flex-wrap justify-between gap-2">
|
|
171
|
+
<SetVelocity {setVelocity} />
|
|
172
|
+
</div>
|
|
173
|
+
</ApiSection>
|
|
139
174
|
{/snippet}
|
|
140
175
|
</ConnectionStatus>
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
import { BaseClient } from '@viamrobotics/sdk'
|
|
3
3
|
import { createResourceClient, createResourceMutation } from '@viamrobotics/svelte-sdk'
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import ApiSection from '../../api-section.svelte'
|
|
6
|
+
import { Section } from '../../section'
|
|
7
|
+
import { ResourceTriplets } from '../../../resource-triplet'
|
|
6
8
|
|
|
7
9
|
import MoveStraight from './move-straight.svelte'
|
|
8
10
|
|
|
@@ -26,6 +28,16 @@
|
|
|
26
28
|
}
|
|
27
29
|
</script>
|
|
28
30
|
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
<ApiSection
|
|
32
|
+
class="flex-row flex-wrap gap-2"
|
|
33
|
+
method="MoveStraight"
|
|
34
|
+
api={ResourceTriplets.Base}
|
|
35
|
+
mutations={[moveStraightMutation]}
|
|
36
|
+
>
|
|
37
|
+
{#snippet subheading()}
|
|
38
|
+
<Section.Text>Move across a given distance at a given velocity</Section.Text>
|
|
39
|
+
{/snippet}
|
|
40
|
+
<div class="flex grow flex-wrap justify-between gap-2">
|
|
41
|
+
<MoveStraight {moveStraight} />
|
|
42
|
+
</div>
|
|
43
|
+
</ApiSection>
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
import { BaseClient, type Vector3 } from '@viamrobotics/sdk'
|
|
4
4
|
import { createResourceClient, createResourceMutation } from '@viamrobotics/svelte-sdk'
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import { Section } from '../../section'
|
|
7
|
+
import { useSectionErrors } from '../../section/use-section-errors.svelte'
|
|
7
8
|
|
|
8
9
|
import QuickMove from './quick-move.svelte'
|
|
9
10
|
|
|
@@ -26,11 +27,22 @@
|
|
|
26
27
|
quickSetPowerMutation.mutate([linear, angular], {})
|
|
27
28
|
}
|
|
28
29
|
|
|
30
|
+
const sectionErrors = useSectionErrors(() => ({ mutations: [quickSetPowerMutation] }))
|
|
31
|
+
|
|
29
32
|
let isKeyboardEnabled = $state(false)
|
|
30
33
|
</script>
|
|
31
34
|
|
|
32
|
-
<
|
|
33
|
-
{
|
|
35
|
+
<Section
|
|
36
|
+
errorReporter={sectionErrors}
|
|
37
|
+
class="flex-row flex-wrap gap-2"
|
|
38
|
+
>
|
|
39
|
+
<div class="flex flex-col gap-0.5">
|
|
40
|
+
<Section.Heading>
|
|
41
|
+
Quick move
|
|
42
|
+
{#snippet aside()}
|
|
43
|
+
<Section.Errors errors={sectionErrors.errors} />
|
|
44
|
+
{/snippet}
|
|
45
|
+
</Section.Heading>
|
|
34
46
|
<Label cx="w-fit!">
|
|
35
47
|
Keyboard control
|
|
36
48
|
|
|
@@ -40,10 +52,14 @@
|
|
|
40
52
|
on:change={() => (isKeyboardEnabled = !isKeyboardEnabled)}
|
|
41
53
|
/>
|
|
42
54
|
</Label>
|
|
43
|
-
|
|
55
|
+
</div>
|
|
44
56
|
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
57
|
+
<Section.Body>
|
|
58
|
+
<div class="flex grow flex-wrap justify-between gap-2">
|
|
59
|
+
<QuickMove
|
|
60
|
+
setPower={quickSetPower}
|
|
61
|
+
{isKeyboardEnabled}
|
|
62
|
+
/>
|
|
63
|
+
</div>
|
|
64
|
+
</Section.Body>
|
|
65
|
+
</Section>
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
import { Icon, Label, RangeInput } from '@viamrobotics/prime-core'
|
|
5
5
|
import { onMount } from 'svelte'
|
|
6
|
-
import { twMerge } from 'tailwind-merge'
|
|
7
6
|
|
|
8
7
|
import { numberValueFromEvent } from '../../../event-handlers'
|
|
9
8
|
|
|
@@ -51,7 +50,7 @@
|
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
const buttonCx =
|
|
54
|
-
'flex gap-2 justify-center items-center w-[60px] border border-light
|
|
53
|
+
'flex gap-2 justify-center items-center w-[60px] border border-light px-2.5 py-3 hover:border-medium hover:bg-medium active:bg-gray-2 h-fit'
|
|
55
54
|
|
|
56
55
|
const keys = {
|
|
57
56
|
W_KEY: 'w',
|
|
@@ -154,7 +153,7 @@
|
|
|
154
153
|
aria-label="left"
|
|
155
154
|
onmouseup={mouseEnd}
|
|
156
155
|
onmouseleave={mouseEnd}
|
|
157
|
-
class={
|
|
156
|
+
class={[buttonCx, pressedKeys.a ? 'bg-gray-2' : 'bg-light']}
|
|
158
157
|
>
|
|
159
158
|
<Icon
|
|
160
159
|
name="undo"
|
|
@@ -171,7 +170,7 @@
|
|
|
171
170
|
aria-label="forwards"
|
|
172
171
|
onmouseup={mouseEnd}
|
|
173
172
|
onmouseleave={mouseEnd}
|
|
174
|
-
class={
|
|
173
|
+
class={[buttonCx, 'flex-col', pressedKeys.w ? 'bg-gray-2' : 'bg-light']}
|
|
175
174
|
>
|
|
176
175
|
<Icon
|
|
177
176
|
name="arrow-up"
|
|
@@ -187,7 +186,7 @@
|
|
|
187
186
|
aria-label="backwards"
|
|
188
187
|
onmouseup={mouseEnd}
|
|
189
188
|
onmouseleave={mouseEnd}
|
|
190
|
-
class={
|
|
189
|
+
class={[buttonCx, 'flex-col', pressedKeys.s ? 'bg-gray-2' : 'bg-light']}
|
|
191
190
|
>
|
|
192
191
|
{#if isKeyboardEnabled}
|
|
193
192
|
<div class="text-gray-6 text-sm font-semibold">S</div>
|
|
@@ -205,7 +204,7 @@
|
|
|
205
204
|
aria-label="right"
|
|
206
205
|
onmouseup={mouseEnd}
|
|
207
206
|
onmouseleave={mouseEnd}
|
|
208
|
-
class={
|
|
207
|
+
class={[buttonCx, pressedKeys.d ? 'bg-gray-2' : 'bg-light']}
|
|
209
208
|
>
|
|
210
209
|
{#if isKeyboardEnabled}
|
|
211
210
|
<div class="text-gray-6 text-sm font-semibold">D</div>
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
import { BaseClient, type Vector3 } from '@viamrobotics/sdk'
|
|
3
3
|
import { createResourceClient, createResourceMutation } from '@viamrobotics/svelte-sdk'
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import ApiSection from '../../api-section.svelte'
|
|
6
|
+
import { Section } from '../../section'
|
|
7
|
+
import { ResourceTriplets } from '../../../resource-triplet'
|
|
6
8
|
|
|
7
9
|
import SetPower from './set-power.svelte'
|
|
8
10
|
|
|
@@ -22,10 +24,20 @@
|
|
|
22
24
|
const setPowerMutation = createResourceMutation(client, 'setPower')
|
|
23
25
|
</script>
|
|
24
26
|
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
<ApiSection
|
|
28
|
+
class="flex-row flex-wrap gap-2"
|
|
29
|
+
method="SetPower"
|
|
30
|
+
api={ResourceTriplets.Base}
|
|
31
|
+
mutations={[setPowerMutation]}
|
|
32
|
+
>
|
|
33
|
+
{#snippet subheading()}
|
|
34
|
+
<Section.Text>Move continuously at a given amount of power</Section.Text>
|
|
35
|
+
{/snippet}
|
|
36
|
+
<div class="flex grow flex-wrap justify-between gap-2">
|
|
37
|
+
<SetPower
|
|
38
|
+
setPower={(linear: Vector3, angular: Vector3) => {
|
|
39
|
+
setPowerMutation.mutate([linear, angular], {})
|
|
40
|
+
}}
|
|
41
|
+
/>
|
|
42
|
+
</div>
|
|
43
|
+
</ApiSection>
|
|
@@ -17,19 +17,21 @@
|
|
|
17
17
|
|
|
18
18
|
<div class="flex flex-wrap gap-4">
|
|
19
19
|
<Vec3Builder
|
|
20
|
-
title="Linear power"
|
|
21
20
|
titleTooltip="The percentage of max power of the base’s linear propulsion. In the range of –1.0 to 1.0, with 1.0 meaning 100% power."
|
|
22
21
|
xTooltip="+X is right, –X is left"
|
|
23
22
|
yTooltip="+Y is forward, –Y is backward"
|
|
24
23
|
zTooltip="+Z is up, –Z is down"
|
|
25
24
|
bind:vector={linearPower}
|
|
26
|
-
|
|
25
|
+
>
|
|
26
|
+
{#snippet title()}Linear power{/snippet}
|
|
27
|
+
</Vec3Builder>
|
|
27
28
|
<Vec3Builder
|
|
28
|
-
title="Angular power"
|
|
29
29
|
titleTooltip="The percentage of max power of the base’s angular propulsion. In the range of -1.0 to 1.0, with 1.0 meaning 100% power."
|
|
30
30
|
zTooltip="+Z is left, –Z is right"
|
|
31
31
|
bind:vector={angularPower}
|
|
32
|
-
|
|
32
|
+
>
|
|
33
|
+
{#snippet title()}Angular power{/snippet}
|
|
34
|
+
</Vec3Builder>
|
|
33
35
|
</div>
|
|
34
36
|
|
|
35
37
|
<Button
|