@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
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
import { CodeEditor } from '@viamrobotics/prime-core/code-editor'
|
|
6
6
|
import { PersistedState } from 'runed'
|
|
7
7
|
|
|
8
|
-
import ErrorDisplay from '../../error.svelte'
|
|
9
8
|
import PoseEditor from '../../pose-editor.svelte'
|
|
10
9
|
|
|
11
10
|
import type { MoveInput } from './parse-move-args'
|
|
@@ -17,20 +16,11 @@
|
|
|
17
16
|
destination: string
|
|
18
17
|
currentPose?: Pose
|
|
19
18
|
isPending: boolean
|
|
20
|
-
lastError: Error | null
|
|
21
19
|
storageKey: string
|
|
22
20
|
onExecute: (input: MoveInput) => void
|
|
23
21
|
}
|
|
24
22
|
|
|
25
|
-
const {
|
|
26
|
-
frameName,
|
|
27
|
-
destination,
|
|
28
|
-
currentPose,
|
|
29
|
-
isPending,
|
|
30
|
-
lastError,
|
|
31
|
-
storageKey,
|
|
32
|
-
onExecute,
|
|
33
|
-
}: Props = $props()
|
|
23
|
+
const { frameName, destination, currentPose, isPending, storageKey, onExecute }: Props = $props()
|
|
34
24
|
|
|
35
25
|
const zeroPose: Pose = { x: 0, y: 0, z: 0, oX: 0, oY: 0, oZ: 1, theta: 0 }
|
|
36
26
|
|
|
@@ -60,9 +50,11 @@
|
|
|
60
50
|
onPoseChange={(next) => {
|
|
61
51
|
edit = { key: editKey, pose: next }
|
|
62
52
|
}}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
53
|
+
>
|
|
54
|
+
{#snippet heading()}Destination pose{/snippet}
|
|
55
|
+
{#snippet description()}The target pose expressed in the selected reference frame. Translations
|
|
56
|
+
are in millimeters.{/snippet}
|
|
57
|
+
</PoseEditor>
|
|
66
58
|
|
|
67
59
|
<div class="flex flex-col gap-2">
|
|
68
60
|
<span class="flex flex-row gap-2">
|
|
@@ -137,6 +129,4 @@
|
|
|
137
129
|
<p class="text-subtle-2 text-xs">
|
|
138
130
|
Move blocks until the motion completes. Stop the component itself to interrupt.
|
|
139
131
|
</p>
|
|
140
|
-
|
|
141
|
-
<ErrorDisplay {lastError} />
|
|
142
132
|
</div>
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { MotorClient } 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 { ResourceTriplets } from '../../../resource-triplet'
|
|
6
7
|
|
|
7
8
|
import GoFor from './go-for.svelte'
|
|
8
9
|
|
|
@@ -22,10 +23,17 @@
|
|
|
22
23
|
const goForMutation = createResourceMutation(client, 'goFor')
|
|
23
24
|
</script>
|
|
24
25
|
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
<ApiSection
|
|
27
|
+
class="flex-row flex-wrap gap-2"
|
|
28
|
+
method="GoFor"
|
|
29
|
+
api={ResourceTriplets.Motor}
|
|
30
|
+
mutations={[goForMutation]}
|
|
31
|
+
>
|
|
32
|
+
<div class="flex grow flex-wrap justify-between gap-2">
|
|
33
|
+
<GoFor
|
|
34
|
+
goFor={(rpm: number, revolutions: number) => {
|
|
35
|
+
goForMutation.mutate([rpm, revolutions], {})
|
|
36
|
+
}}
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
</ApiSection>
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { MotorClient } 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 { ResourceTriplets } from '../../../resource-triplet'
|
|
6
7
|
|
|
7
8
|
import GoTo from './go-to.svelte'
|
|
8
9
|
|
|
@@ -26,6 +27,13 @@
|
|
|
26
27
|
}
|
|
27
28
|
</script>
|
|
28
29
|
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
<ApiSection
|
|
31
|
+
class="flex-row flex-wrap gap-2"
|
|
32
|
+
method="GoTo"
|
|
33
|
+
api={ResourceTriplets.Motor}
|
|
34
|
+
mutations={[goToMutation]}
|
|
35
|
+
>
|
|
36
|
+
<div class="flex grow flex-wrap justify-between gap-2">
|
|
37
|
+
<GoTo {goTo} />
|
|
38
|
+
</div>
|
|
39
|
+
</ApiSection>
|
|
@@ -9,10 +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
|
|
13
|
-
import
|
|
12
|
+
import { Section } from '../../section'
|
|
13
|
+
import { useSectionErrors } from '../../section/use-section-errors.svelte'
|
|
14
14
|
import StopButton from '../../stop-button.svelte'
|
|
15
15
|
import { formatNumeric } from '../../../format'
|
|
16
|
+
import { ResourceTriplets } from '../../../resource-triplet'
|
|
16
17
|
|
|
17
18
|
import GoFor from './go-for.svelte'
|
|
18
19
|
import GoTo from './go-to.svelte'
|
|
@@ -53,6 +54,8 @@
|
|
|
53
54
|
const goToMutation = createResourceMutation(client, 'goTo')
|
|
54
55
|
const stopMutation = createResourceMutation(client, 'stop')
|
|
55
56
|
|
|
57
|
+
const quickMoveErrors = useSectionErrors(() => ({ mutations: [quickSetPowerMutation] }))
|
|
58
|
+
|
|
56
59
|
const setPower = (val: number) => {
|
|
57
60
|
setPowerMutation.mutate([val], {})
|
|
58
61
|
}
|
|
@@ -79,55 +82,85 @@
|
|
|
79
82
|
<div class="@container">
|
|
80
83
|
<div class="flex flex-col divide-y @2xl:flex-row @2xl:divide-x @2xl:divide-y-0">
|
|
81
84
|
<div class="flex w-full flex-col divide-y">
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
+
<Section
|
|
86
|
+
errorReporter={quickMoveErrors}
|
|
87
|
+
class="flex-row flex-wrap gap-2"
|
|
85
88
|
>
|
|
86
|
-
<
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
<div class="flex flex-col gap-0.5">
|
|
90
|
+
<Section.Heading>
|
|
91
|
+
Quick move
|
|
92
|
+
{#snippet aside()}
|
|
93
|
+
<Section.Errors errors={quickMoveErrors.errors} />
|
|
94
|
+
{/snippet}
|
|
95
|
+
</Section.Heading>
|
|
96
|
+
</div>
|
|
97
|
+
<Section.Body>
|
|
98
|
+
<div class="flex grow flex-wrap justify-between gap-2">
|
|
99
|
+
<QuickMove setPower={quickSetPower} />
|
|
100
|
+
</div>
|
|
101
|
+
</Section.Body>
|
|
102
|
+
</Section>
|
|
103
|
+
<ApiSection
|
|
104
|
+
class="flex-row flex-wrap gap-2"
|
|
105
|
+
method="SetPower"
|
|
106
|
+
api={ResourceTriplets.Motor}
|
|
107
|
+
mutations={[setPowerMutation]}
|
|
93
108
|
>
|
|
94
|
-
<
|
|
95
|
-
|
|
109
|
+
{#snippet subheading()}<Section.Text>Move continuously</Section.Text>{/snippet}
|
|
110
|
+
<div class="flex grow flex-wrap justify-between gap-2">
|
|
111
|
+
<SetPower {setPower} />
|
|
112
|
+
</div>
|
|
113
|
+
</ApiSection>
|
|
96
114
|
{#if propertiesQuery.data?.positionReporting}
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
115
|
+
<ApiSection
|
|
116
|
+
class="flex-row flex-wrap gap-2"
|
|
117
|
+
method="SetRPM"
|
|
118
|
+
api={ResourceTriplets.Motor}
|
|
119
|
+
mutations={[setRPMMutation]}
|
|
102
120
|
>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
121
|
+
{#snippet subheading()}<Section.Text
|
|
122
|
+
>Move indefinitely at a specified speed.</Section.Text
|
|
123
|
+
>{/snippet}
|
|
124
|
+
<div class="flex grow flex-wrap justify-between gap-2">
|
|
125
|
+
<SetRPM {setRPM} />
|
|
126
|
+
</div>
|
|
127
|
+
</ApiSection>
|
|
128
|
+
<ApiSection
|
|
129
|
+
class="flex-row flex-wrap gap-2"
|
|
130
|
+
method="GoFor"
|
|
131
|
+
api={ResourceTriplets.Motor}
|
|
132
|
+
mutations={[goForMutation]}
|
|
110
133
|
>
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
134
|
+
{#snippet subheading()}<Section.Text
|
|
135
|
+
>Move a specified number of revolutions</Section.Text
|
|
136
|
+
>{/snippet}
|
|
137
|
+
<div class="flex grow flex-wrap justify-between gap-2">
|
|
138
|
+
<GoFor {goFor} />
|
|
139
|
+
</div>
|
|
140
|
+
</ApiSection>
|
|
141
|
+
<ApiSection
|
|
142
|
+
class="flex-row flex-wrap gap-2"
|
|
143
|
+
method="GoTo"
|
|
144
|
+
api={ResourceTriplets.Motor}
|
|
145
|
+
mutations={[goToMutation]}
|
|
118
146
|
>
|
|
119
|
-
|
|
120
|
-
|
|
147
|
+
{#snippet subheading()}<Section.Text>Turn to a specified position</Section.Text
|
|
148
|
+
>{/snippet}
|
|
149
|
+
<div class="flex grow flex-wrap justify-between gap-2">
|
|
150
|
+
<GoTo {goTo} />
|
|
151
|
+
</div>
|
|
152
|
+
</ApiSection>
|
|
121
153
|
{/if}
|
|
122
154
|
</div>
|
|
123
155
|
|
|
124
156
|
<div class="flex w-full flex-col divide-y @2xl:ml-auto @2xl:max-w-1/2 @4xl:max-w-1/3">
|
|
125
157
|
<ApiSection
|
|
126
|
-
|
|
127
|
-
|
|
158
|
+
class="grow flex-col gap-4"
|
|
159
|
+
method="Stop"
|
|
160
|
+
api={ResourceTriplets.Motor}
|
|
161
|
+
mutations={[stopMutation]}
|
|
128
162
|
>
|
|
129
163
|
<StopButton
|
|
130
|
-
error={stopMutation.error}
|
|
131
164
|
onStop={() => {
|
|
132
165
|
stopMutation.mutate([])
|
|
133
166
|
}}
|
|
@@ -135,45 +168,48 @@
|
|
|
135
168
|
</ApiSection>
|
|
136
169
|
<IsMoving
|
|
137
170
|
client={MotorClient}
|
|
138
|
-
api=
|
|
171
|
+
api={ResourceTriplets.Motor}
|
|
139
172
|
{partID}
|
|
140
173
|
{resourceName}
|
|
141
174
|
>
|
|
142
175
|
<div class="flex flex-col gap-6 pt-2">
|
|
143
176
|
<ApiSection
|
|
144
|
-
|
|
145
|
-
api=
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
Stepper motors will report ”true” if they are being powered while holding
|
|
150
|
-
a position and while they are turning."
|
|
177
|
+
method="IsPowered"
|
|
178
|
+
api={ResourceTriplets.Motor}
|
|
179
|
+
queries={[isPoweredQuery]}
|
|
180
|
+
class="grow flex-col gap-3 p-0!"
|
|
151
181
|
>
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
182
|
+
{#snippet tooltip()}
|
|
183
|
+
Returns whether or not the motor is running and the current portion of max power.
|
|
184
|
+
Stepper motors will report ”true” if they are being powered while holding a
|
|
185
|
+
position and while they are turning.
|
|
186
|
+
{/snippet}
|
|
187
|
+
{#if isPoweredQuery.data !== undefined}
|
|
188
|
+
{@const [isPowered, powerPct] = isPoweredQuery.data}
|
|
189
|
+
<span class="font-roboto-mono flex flex-row gap-1 text-xs">
|
|
190
|
+
<p class="text-default">{isPowered}</p>
|
|
191
|
+
<p class="text-disabled">/</p>
|
|
192
|
+
<p class="text-subtle-1">
|
|
193
|
+
{formatNumeric(powerPct * 100, 1)}%
|
|
194
|
+
</p>
|
|
195
|
+
</span>
|
|
196
|
+
{/if}
|
|
164
197
|
</ApiSection>
|
|
165
198
|
{#if propertiesQuery.data?.positionReporting === true}
|
|
166
199
|
<ApiSection
|
|
167
|
-
|
|
168
|
-
api=
|
|
169
|
-
|
|
170
|
-
|
|
200
|
+
method="GetPosition"
|
|
201
|
+
api={ResourceTriplets.Motor}
|
|
202
|
+
queries={[positionQuery]}
|
|
203
|
+
class="grow flex-col gap-3 p-0!"
|
|
171
204
|
>
|
|
172
|
-
|
|
205
|
+
{#snippet tooltip()}
|
|
206
|
+
Reports the position of an encoded motor in revolutions from zero/home.
|
|
207
|
+
{/snippet}
|
|
208
|
+
{#if positionQuery.data !== undefined}
|
|
173
209
|
<p class="font-roboto-mono text-default text-xs">
|
|
174
210
|
{formatNumeric(positionQuery.data, 4)}
|
|
175
211
|
</p>
|
|
176
|
-
|
|
212
|
+
{/if}
|
|
177
213
|
</ApiSection>
|
|
178
214
|
{/if}
|
|
179
215
|
</div>
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { MotorClient } 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 { ResourceTriplets } from '../../../resource-triplet'
|
|
6
7
|
|
|
7
8
|
import QuickMove from './quick-move.svelte'
|
|
8
9
|
|
|
@@ -22,10 +23,17 @@
|
|
|
22
23
|
const quickSetPowerMutation = createResourceMutation(client, 'setPower')
|
|
23
24
|
</script>
|
|
24
25
|
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
<ApiSection
|
|
27
|
+
class="flex-row flex-wrap gap-2"
|
|
28
|
+
method="SetPower"
|
|
29
|
+
api={ResourceTriplets.Motor}
|
|
30
|
+
mutations={[quickSetPowerMutation]}
|
|
31
|
+
>
|
|
32
|
+
<div class="flex grow flex-wrap justify-between gap-2">
|
|
33
|
+
<QuickMove
|
|
34
|
+
setPower={(val) => {
|
|
35
|
+
quickSetPowerMutation.mutate([val], {})
|
|
36
|
+
}}
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
</ApiSection>
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { MotorClient } 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 { ResourceTriplets } from '../../../resource-triplet'
|
|
6
7
|
|
|
7
8
|
import SetPower from './set-power.svelte'
|
|
8
9
|
|
|
@@ -24,6 +25,13 @@
|
|
|
24
25
|
const setPower = (val: number) => setPowerMutation.mutate([val], {})
|
|
25
26
|
</script>
|
|
26
27
|
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
<ApiSection
|
|
29
|
+
class="flex-row flex-wrap gap-2"
|
|
30
|
+
method="SetPower"
|
|
31
|
+
api={ResourceTriplets.Motor}
|
|
32
|
+
mutations={[setPowerMutation]}
|
|
33
|
+
>
|
|
34
|
+
<div class="flex grow flex-wrap justify-between gap-2">
|
|
35
|
+
<SetPower {setPower} />
|
|
36
|
+
</div>
|
|
37
|
+
</ApiSection>
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { MotorClient } 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 { ResourceTriplets } from '../../../resource-triplet'
|
|
6
7
|
|
|
7
8
|
import SetRPM from './set-rpm.svelte'
|
|
8
9
|
|
|
@@ -24,6 +25,13 @@
|
|
|
24
25
|
const setRPM = (val: number) => setRPMMutation.mutate([val], {})
|
|
25
26
|
</script>
|
|
26
27
|
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
<ApiSection
|
|
29
|
+
class="flex-row flex-wrap gap-2"
|
|
30
|
+
method="SetRPM"
|
|
31
|
+
api={ResourceTriplets.Motor}
|
|
32
|
+
mutations={[setRPMMutation]}
|
|
33
|
+
>
|
|
34
|
+
<div class="flex grow flex-wrap justify-between gap-2">
|
|
35
|
+
<SetRPM {setRPM} />
|
|
36
|
+
</div>
|
|
37
|
+
</ApiSection>
|
|
@@ -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 Accuracy from './accuracy.svelte'
|
|
9
9
|
|
|
@@ -24,15 +24,12 @@
|
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
26
|
<ApiSection
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
method="GetAccuracy"
|
|
28
|
+
api={ResourceTriplets.MovementSensor}
|
|
29
|
+
queries={[query]}
|
|
30
|
+
class="grow flex-col gap-4"
|
|
29
31
|
>
|
|
30
|
-
|
|
31
|
-
{query}
|
|
32
|
-
|
|
33
|
-
>
|
|
34
|
-
{#if query.data !== undefined}
|
|
35
|
-
<Accuracy data={query.data} />
|
|
36
|
-
{/if}
|
|
37
|
-
</Query>
|
|
32
|
+
{#if query.data !== undefined}
|
|
33
|
+
<Accuracy data={query.data} />
|
|
34
|
+
{/if}
|
|
38
35
|
</ApiSection>
|
|
@@ -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 CompassHeading from './compass-heading.svelte'
|
|
9
9
|
|
|
@@ -24,15 +24,12 @@
|
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
26
|
<ApiSection
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
method="GetCompassHeading"
|
|
28
|
+
api={ResourceTriplets.MovementSensor}
|
|
29
|
+
queries={[query]}
|
|
30
|
+
class="grow flex-col gap-4"
|
|
29
31
|
>
|
|
30
|
-
|
|
31
|
-
{query}
|
|
32
|
-
|
|
33
|
-
>
|
|
34
|
-
{#if query.data !== undefined}
|
|
35
|
-
<CompassHeading data={query.data} />
|
|
36
|
-
{/if}
|
|
37
|
-
</Query>
|
|
32
|
+
{#if query.data !== undefined}
|
|
33
|
+
<CompassHeading data={query.data} />
|
|
34
|
+
{/if}
|
|
38
35
|
</ApiSection>
|
|
@@ -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 Orientation from './orientation.svelte'
|
|
9
9
|
|
|
@@ -24,15 +24,12 @@
|
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
26
|
<ApiSection
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
method="GetOrientation"
|
|
28
|
+
api={ResourceTriplets.MovementSensor}
|
|
29
|
+
queries={[query]}
|
|
30
|
+
class="grow flex-col gap-4"
|
|
29
31
|
>
|
|
30
|
-
|
|
31
|
-
{query}
|
|
32
|
-
|
|
33
|
-
>
|
|
34
|
-
{#if query.data !== undefined}
|
|
35
|
-
<Orientation data={query.data} />
|
|
36
|
-
{/if}
|
|
37
|
-
</Query>
|
|
32
|
+
{#if query.data !== undefined}
|
|
33
|
+
<Orientation data={query.data} />
|
|
34
|
+
{/if}
|
|
38
35
|
</ApiSection>
|
|
@@ -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.MovementSensor}
|
|
29
|
+
queries={[query]}
|
|
30
|
+
class="grow flex-col gap-4"
|
|
29
31
|
>
|
|
30
|
-
|
|
31
|
-
{query}
|
|
32
|
-
|
|
33
|
-
>
|
|
34
|
-
{#if query.data !== undefined}
|
|
35
|
-
<Position data={query.data} />
|
|
36
|
-
{/if}
|
|
37
|
-
</Query>
|
|
32
|
+
{#if query.data !== undefined}
|
|
33
|
+
<Position data={query.data} />
|
|
34
|
+
{/if}
|
|
38
35
|
</ApiSection>
|