@viamrobotics/test-widgets 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/widgets/motion/{component-name-select.svelte → frame-select.svelte} +3 -3
- package/dist/components/widgets/motion/frame-select.svelte.d.ts +9 -0
- package/dist/components/widgets/motion/frame-system-config.d.ts +13 -4
- package/dist/components/widgets/motion/frame-system-config.js +17 -5
- package/dist/components/widgets/motion/motion.svelte +42 -4
- package/dist/components/widgets/motion/move-widget.svelte +18 -37
- package/dist/components/widgets/motion/move-widget.svelte.d.ts +4 -0
- package/dist/components/widgets/motion/move.svelte +14 -22
- package/dist/components/widgets/motion/move.svelte.d.ts +4 -2
- package/dist/components/widgets/motion/parse-move-args.d.ts +3 -3
- package/dist/components/widgets/motion/parse-move-args.js +4 -4
- package/dist/components/widgets/motion/{pose-in-frame-input.svelte → pose-input.svelte} +13 -27
- package/dist/components/widgets/motion/pose-input.svelte.d.ts +8 -0
- package/dist/registry.js +2 -5
- package/package.json +1 -1
- package/dist/components/widgets/motion/component-name-select.svelte.d.ts +0 -9
- package/dist/components/widgets/motion/pose-in-frame-input.svelte.d.ts +0 -10
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
interface Props {
|
|
5
5
|
value: string
|
|
6
6
|
options: string[]
|
|
7
|
-
label
|
|
7
|
+
label: string
|
|
8
8
|
onChange: (value: string) => void
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
const { value, options, label
|
|
11
|
+
const { value, options, label, onChange }: Props = $props()
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
<Label>
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
onChange((event.target as HTMLSelectElement).value)
|
|
22
22
|
}}
|
|
23
23
|
>
|
|
24
|
-
<option value="">Select a
|
|
24
|
+
<option value="">Select a frame…</option>
|
|
25
25
|
{#each options as name (name)}
|
|
26
26
|
<option value={name}>{name}</option>
|
|
27
27
|
{/each}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
value: string;
|
|
3
|
+
options: string[];
|
|
4
|
+
label: string;
|
|
5
|
+
onChange: (value: string) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const FrameSelect: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type FrameSelect = ReturnType<typeof FrameSelect>;
|
|
9
|
+
export default FrameSelect;
|
|
@@ -17,12 +17,21 @@ export interface FrameConfigEntry {
|
|
|
17
17
|
*/
|
|
18
18
|
export declare const movableFrameNames: (config: FrameConfigEntry[] | undefined) => string[];
|
|
19
19
|
/**
|
|
20
|
-
* The parent frame a
|
|
21
|
-
*
|
|
20
|
+
* The parent frame a frame is attached to in the machine's frame system. A
|
|
21
|
+
* frame's parent is the reference frame of the pose that positions it (its
|
|
22
22
|
* observer frame), so `getPose` and `Move` can be expressed relative to it.
|
|
23
23
|
*
|
|
24
24
|
* @param config - The machine's frame system config, or `undefined` while loading.
|
|
25
|
-
* @param
|
|
25
|
+
* @param frameName - The frame whose parent to look up.
|
|
26
26
|
* @returns The parent frame name, or `'world'` when there is no configured parent.
|
|
27
27
|
*/
|
|
28
|
-
export declare const parentFrame: (config: FrameConfigEntry[] | undefined,
|
|
28
|
+
export declare const parentFrame: (config: FrameConfigEntry[] | undefined, frameName: string) => string;
|
|
29
|
+
/**
|
|
30
|
+
* The reference frames a destination pose can be expressed in: the root
|
|
31
|
+
* `'world'` frame first, then every frame in the machine's frame system
|
|
32
|
+
* (already sorted alphabetically by `movableFrameNames`).
|
|
33
|
+
*
|
|
34
|
+
* @param config - The machine's frame system config, or `undefined` while loading.
|
|
35
|
+
* @returns The selectable reference frame names, always led by `'world'`.
|
|
36
|
+
*/
|
|
37
|
+
export declare const referenceFrameNames: (config: FrameConfigEntry[] | undefined) => string[];
|
|
@@ -16,15 +16,27 @@ export const movableFrameNames = (config) => {
|
|
|
16
16
|
.toSorted((a, b) => a.localeCompare(b));
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
|
-
* The parent frame a
|
|
20
|
-
*
|
|
19
|
+
* The parent frame a frame is attached to in the machine's frame system. A
|
|
20
|
+
* frame's parent is the reference frame of the pose that positions it (its
|
|
21
21
|
* observer frame), so `getPose` and `Move` can be expressed relative to it.
|
|
22
22
|
*
|
|
23
23
|
* @param config - The machine's frame system config, or `undefined` while loading.
|
|
24
|
-
* @param
|
|
24
|
+
* @param frameName - The frame whose parent to look up.
|
|
25
25
|
* @returns The parent frame name, or `'world'` when there is no configured parent.
|
|
26
26
|
*/
|
|
27
|
-
export const parentFrame = (config,
|
|
28
|
-
const entry = config?.find((item) => item.frame?.referenceFrame ===
|
|
27
|
+
export const parentFrame = (config, frameName) => {
|
|
28
|
+
const entry = config?.find((item) => item.frame?.referenceFrame === frameName);
|
|
29
29
|
return entry?.frame?.poseInObserverFrame?.referenceFrame || 'world';
|
|
30
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* The reference frames a destination pose can be expressed in: the root
|
|
33
|
+
* `'world'` frame first, then every frame in the machine's frame system
|
|
34
|
+
* (already sorted alphabetically by `movableFrameNames`).
|
|
35
|
+
*
|
|
36
|
+
* @param config - The machine's frame system config, or `undefined` while loading.
|
|
37
|
+
* @returns The selectable reference frame names, always led by `'world'`.
|
|
38
|
+
*/
|
|
39
|
+
export const referenceFrameNames = (config) => {
|
|
40
|
+
const frames = movableFrameNames(config).filter((name) => name !== 'world');
|
|
41
|
+
return ['world', ...frames];
|
|
42
|
+
};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { createRobotQuery, useRobotClient } from '@viamrobotics/svelte-sdk'
|
|
3
|
+
|
|
2
4
|
import ApiSection from '../../api-section.svelte'
|
|
3
5
|
import ConnectionStatus from '../../connection-status.svelte'
|
|
4
6
|
|
|
7
|
+
import FrameSelect from './frame-select.svelte'
|
|
8
|
+
import { movableFrameNames, parentFrame, referenceFrameNames } from './frame-system-config'
|
|
5
9
|
import MoveWidget from './move-widget.svelte'
|
|
6
10
|
|
|
7
11
|
interface Props {
|
|
@@ -10,6 +14,20 @@
|
|
|
10
14
|
}
|
|
11
15
|
|
|
12
16
|
const { partID, resourceName }: Props = $props()
|
|
17
|
+
|
|
18
|
+
const robotClient = useRobotClient(() => partID)
|
|
19
|
+
const frameSystem = createRobotQuery(robotClient, 'frameSystemConfig', () => ({
|
|
20
|
+
refetchInterval: 5000,
|
|
21
|
+
}))
|
|
22
|
+
|
|
23
|
+
const frameNames = $derived(movableFrameNames(frameSystem.data))
|
|
24
|
+
const destinationOptions = $derived(referenceFrameNames(frameSystem.data))
|
|
25
|
+
|
|
26
|
+
let selectedFrame = $state<string>()
|
|
27
|
+
const frameName = $derived(selectedFrame ?? frameNames[0] ?? '')
|
|
28
|
+
|
|
29
|
+
let selectedDestination = $state<string>()
|
|
30
|
+
const destination = $derived(selectedDestination ?? parentFrame(frameSystem.data, frameName))
|
|
13
31
|
</script>
|
|
14
32
|
|
|
15
33
|
<ConnectionStatus {partID}>
|
|
@@ -18,10 +36,30 @@
|
|
|
18
36
|
title="Move"
|
|
19
37
|
api="rdk:service:motion"
|
|
20
38
|
>
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
39
|
+
<div class="flex min-w-0 flex-col gap-4">
|
|
40
|
+
<FrameSelect
|
|
41
|
+
label="Component"
|
|
42
|
+
value={frameName}
|
|
43
|
+
options={frameNames}
|
|
44
|
+
onChange={(value) => {
|
|
45
|
+
selectedFrame = value
|
|
46
|
+
}}
|
|
47
|
+
/>
|
|
48
|
+
<FrameSelect
|
|
49
|
+
label="Destination frame"
|
|
50
|
+
value={destination}
|
|
51
|
+
options={destinationOptions}
|
|
52
|
+
onChange={(value) => {
|
|
53
|
+
selectedDestination = value
|
|
54
|
+
}}
|
|
55
|
+
/>
|
|
56
|
+
<MoveWidget
|
|
57
|
+
{partID}
|
|
58
|
+
{resourceName}
|
|
59
|
+
{frameName}
|
|
60
|
+
{destination}
|
|
61
|
+
/>
|
|
62
|
+
</div>
|
|
25
63
|
</ApiSection>
|
|
26
64
|
{/snippet}
|
|
27
65
|
</ConnectionStatus>
|
|
@@ -7,17 +7,19 @@
|
|
|
7
7
|
useRobotClient,
|
|
8
8
|
} from '@viamrobotics/svelte-sdk'
|
|
9
9
|
|
|
10
|
-
import ComponentNameSelect from './component-name-select.svelte'
|
|
11
|
-
import { movableFrameNames, parentFrame } from './frame-system-config'
|
|
12
10
|
import Move from './move.svelte'
|
|
13
11
|
import { type MoveInput, parseMoveArgs } from './parse-move-args'
|
|
14
12
|
|
|
15
13
|
interface Props {
|
|
16
14
|
partID: string
|
|
17
15
|
resourceName: string
|
|
16
|
+
/** The frame to move — a frame from the machine's frame system. */
|
|
17
|
+
frameName: string
|
|
18
|
+
/** The reference frame the destination pose is expressed in. */
|
|
19
|
+
destination: string
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
const { partID, resourceName }: Props = $props()
|
|
22
|
+
const { partID, resourceName, frameName, destination }: Props = $props()
|
|
21
23
|
|
|
22
24
|
const robotClient = useRobotClient(() => partID)
|
|
23
25
|
const client = createResourceClient(
|
|
@@ -27,26 +29,14 @@
|
|
|
27
29
|
)
|
|
28
30
|
|
|
29
31
|
const move = createResourceMutation(client, 'move')
|
|
30
|
-
const frameSystem = createRobotQuery(robotClient, 'frameSystemConfig', () => ({
|
|
31
|
-
refetchInterval: 5000,
|
|
32
|
-
}))
|
|
33
|
-
const frameNames = $derived(movableFrameNames(frameSystem.data))
|
|
34
|
-
|
|
35
|
-
let selectedName = $state<string>()
|
|
36
|
-
const componentName = $derived(selectedName ?? frameNames[0] ?? '')
|
|
37
|
-
|
|
38
|
-
const destinationFrame = $derived(parentFrame(frameSystem.data, componentName))
|
|
39
|
-
const poseArgs = $derived<Parameters<RobotClient['getPose']>>([
|
|
40
|
-
componentName,
|
|
41
|
-
destinationFrame,
|
|
42
|
-
[],
|
|
43
|
-
])
|
|
44
32
|
|
|
33
|
+
// Pre-fill the editor with the frame's current pose in the destination frame.
|
|
34
|
+
const poseArgs = $derived<Parameters<RobotClient['getPose']>>([frameName, destination, []])
|
|
45
35
|
const poseQuery = createRobotQuery(
|
|
46
36
|
robotClient,
|
|
47
37
|
'getPose',
|
|
48
38
|
() => poseArgs,
|
|
49
|
-
() => ({ enabled:
|
|
39
|
+
() => ({ enabled: frameName !== '' })
|
|
50
40
|
)
|
|
51
41
|
|
|
52
42
|
const currentPose = $derived(poseQuery.data?.pose)
|
|
@@ -57,28 +47,19 @@
|
|
|
57
47
|
const executeMove = (input: MoveInput) => {
|
|
58
48
|
try {
|
|
59
49
|
parseError = undefined
|
|
60
|
-
move.mutate(parseMoveArgs(
|
|
50
|
+
move.mutate(parseMoveArgs(frameName, input), {})
|
|
61
51
|
} catch (error) {
|
|
62
52
|
parseError = error instanceof Error ? error : new Error(String(error))
|
|
63
53
|
}
|
|
64
54
|
}
|
|
65
55
|
</script>
|
|
66
56
|
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
{componentName}
|
|
77
|
-
{currentPose}
|
|
78
|
-
currentReferenceFrame={destinationFrame}
|
|
79
|
-
isPending={move.isPending}
|
|
80
|
-
lastError={parseError ?? move.error ?? poseError}
|
|
81
|
-
storageKey={`${partID}/${resourceName}/motion-move`}
|
|
82
|
-
onExecute={executeMove}
|
|
83
|
-
/>
|
|
84
|
-
</div>
|
|
57
|
+
<Move
|
|
58
|
+
{frameName}
|
|
59
|
+
{destination}
|
|
60
|
+
{currentPose}
|
|
61
|
+
isPending={move.isPending}
|
|
62
|
+
lastError={parseError ?? move.error ?? poseError}
|
|
63
|
+
storageKey={`${partID}/${resourceName}/motion-move`}
|
|
64
|
+
onExecute={executeMove}
|
|
65
|
+
/>
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
interface Props {
|
|
2
2
|
partID: string;
|
|
3
3
|
resourceName: string;
|
|
4
|
+
/** The frame to move — a frame from the machine's frame system. */
|
|
5
|
+
frameName: string;
|
|
6
|
+
/** The reference frame the destination pose is expressed in. */
|
|
7
|
+
destination: string;
|
|
4
8
|
}
|
|
5
9
|
declare const MoveWidget: import("svelte").Component<Props, {}, "">;
|
|
6
10
|
type MoveWidget = ReturnType<typeof MoveWidget>;
|
|
@@ -9,12 +9,14 @@
|
|
|
9
9
|
|
|
10
10
|
import type { MoveInput } from './parse-move-args'
|
|
11
11
|
|
|
12
|
-
import
|
|
12
|
+
import PoseInput from './pose-input.svelte'
|
|
13
13
|
|
|
14
14
|
interface Props {
|
|
15
|
-
|
|
15
|
+
/** The frame being moved. Gates execution and re-seeds the editor on change. */
|
|
16
|
+
frameName: string
|
|
17
|
+
/** The reference frame the destination pose is expressed in. */
|
|
18
|
+
destination: string
|
|
16
19
|
currentPose?: Pose
|
|
17
|
-
currentReferenceFrame?: string
|
|
18
20
|
isPending: boolean
|
|
19
21
|
lastError: Error | null
|
|
20
22
|
storageKey: string
|
|
@@ -22,9 +24,9 @@
|
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
const {
|
|
25
|
-
|
|
27
|
+
frameName,
|
|
28
|
+
destination,
|
|
26
29
|
currentPose,
|
|
27
|
-
currentReferenceFrame,
|
|
28
30
|
isPending,
|
|
29
31
|
lastError,
|
|
30
32
|
storageKey,
|
|
@@ -33,25 +35,19 @@
|
|
|
33
35
|
|
|
34
36
|
const zeroPose: Pose = { x: 0, y: 0, z: 0, oX: 0, oY: 0, oZ: 1, theta: 0 }
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
isEdited && edit ? edit.referenceFrame : (currentReferenceFrame ?? 'world')
|
|
40
|
-
)
|
|
41
|
-
|
|
38
|
+
const editKey = $derived(JSON.stringify([frameName, destination]))
|
|
39
|
+
let edit = $state<{ key: string; pose: Pose }>()
|
|
40
|
+
const isEdited = $derived(edit?.key === editKey)
|
|
42
41
|
const pose = $derived(isEdited && edit ? edit.pose : (currentPose ?? zeroPose))
|
|
43
42
|
|
|
44
|
-
// PersistedState is created inside $derived so Svelte can track the storageKey
|
|
45
|
-
// dependency. The localStorage read on construction is benign and idempotent.
|
|
46
|
-
// storageKey is stable for the lifetime of this component.
|
|
47
43
|
const worldState = $derived(new PersistedState(`${storageKey}/world-state`, ''))
|
|
48
44
|
const constraints = $derived(new PersistedState(`${storageKey}/constraints`, ''))
|
|
49
45
|
|
|
50
|
-
const disabled = $derived(
|
|
46
|
+
const disabled = $derived(frameName === '' || isPending)
|
|
51
47
|
|
|
52
48
|
const execute = () => {
|
|
53
49
|
onExecute({
|
|
54
|
-
referenceFrame,
|
|
50
|
+
referenceFrame: destination,
|
|
55
51
|
pose,
|
|
56
52
|
worldStateJson: worldState.current,
|
|
57
53
|
constraintsJson: constraints.current,
|
|
@@ -60,14 +56,10 @@
|
|
|
60
56
|
</script>
|
|
61
57
|
|
|
62
58
|
<div class="flex min-w-0 flex-col gap-4">
|
|
63
|
-
<
|
|
64
|
-
{referenceFrame}
|
|
59
|
+
<PoseInput
|
|
65
60
|
{pose}
|
|
66
|
-
onReferenceFrameChange={(frame) => {
|
|
67
|
-
edit = { component: componentName, referenceFrame: frame, pose }
|
|
68
|
-
}}
|
|
69
61
|
onPoseChange={(next) => {
|
|
70
|
-
edit = {
|
|
62
|
+
edit = { key: editKey, pose: next }
|
|
71
63
|
}}
|
|
72
64
|
/>
|
|
73
65
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { Pose } from '@viamrobotics/sdk';
|
|
2
2
|
import type { MoveInput } from './parse-move-args';
|
|
3
3
|
interface Props {
|
|
4
|
-
|
|
4
|
+
/** The frame being moved. Gates execution and re-seeds the editor on change. */
|
|
5
|
+
frameName: string;
|
|
6
|
+
/** The reference frame the destination pose is expressed in. */
|
|
7
|
+
destination: string;
|
|
5
8
|
currentPose?: Pose;
|
|
6
|
-
currentReferenceFrame?: string;
|
|
7
9
|
isPending: boolean;
|
|
8
10
|
lastError: Error | null;
|
|
9
11
|
storageKey: string;
|
|
@@ -17,8 +17,8 @@ export type MoveArgs = [PoseInFrame, string, WorldState | undefined, Constraints
|
|
|
17
17
|
* Non-empty JSON is parsed with the generated message classes and throws on
|
|
18
18
|
* invalid input — callers should catch and surface the error.
|
|
19
19
|
*
|
|
20
|
-
* @param
|
|
20
|
+
* @param frameName - The frame to move.
|
|
21
21
|
* @param input - The pose, reference frame, and optional world-state/constraints JSON.
|
|
22
|
-
* @returns The `[destination,
|
|
22
|
+
* @returns The `[destination, frameName, worldState?, constraints?]` tuple.
|
|
23
23
|
*/
|
|
24
|
-
export declare const parseMoveArgs: (
|
|
24
|
+
export declare const parseMoveArgs: (frameName: string, input: MoveInput) => MoveArgs;
|
|
@@ -6,11 +6,11 @@ import { Constraints, WorldState } from '@viamrobotics/sdk';
|
|
|
6
6
|
* Non-empty JSON is parsed with the generated message classes and throws on
|
|
7
7
|
* invalid input — callers should catch and surface the error.
|
|
8
8
|
*
|
|
9
|
-
* @param
|
|
9
|
+
* @param frameName - The frame to move.
|
|
10
10
|
* @param input - The pose, reference frame, and optional world-state/constraints JSON.
|
|
11
|
-
* @returns The `[destination,
|
|
11
|
+
* @returns The `[destination, frameName, worldState?, constraints?]` tuple.
|
|
12
12
|
*/
|
|
13
|
-
export const parseMoveArgs = (
|
|
13
|
+
export const parseMoveArgs = (frameName, input) => {
|
|
14
14
|
const destination = {
|
|
15
15
|
referenceFrame: input.referenceFrame,
|
|
16
16
|
pose: input.pose,
|
|
@@ -19,5 +19,5 @@ export const parseMoveArgs = (componentName, input) => {
|
|
|
19
19
|
const constraints = input.constraintsJson.trim() === ''
|
|
20
20
|
? undefined
|
|
21
21
|
: Constraints.fromJsonString(input.constraintsJson);
|
|
22
|
-
return [destination,
|
|
22
|
+
return [destination, frameName, worldState, constraints];
|
|
23
23
|
};
|
|
@@ -4,19 +4,19 @@
|
|
|
4
4
|
>
|
|
5
5
|
import type { Pose } from '@viamrobotics/sdk'
|
|
6
6
|
|
|
7
|
-
const poseLabelsList =
|
|
8
|
-
x
|
|
9
|
-
y
|
|
10
|
-
z
|
|
11
|
-
oX
|
|
12
|
-
oY
|
|
13
|
-
oZ
|
|
14
|
-
theta
|
|
15
|
-
|
|
7
|
+
const poseLabelsList: [keyof Pose, string][] = [
|
|
8
|
+
['x', 'X'],
|
|
9
|
+
['y', 'Y'],
|
|
10
|
+
['z', 'Z'],
|
|
11
|
+
['oX', 'OX'],
|
|
12
|
+
['oY', 'OY'],
|
|
13
|
+
['oZ', 'OZ'],
|
|
14
|
+
['theta', 'θ'],
|
|
15
|
+
]
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
18
|
<script lang="ts">
|
|
19
|
-
import { Button, Icon,
|
|
19
|
+
import { Button, Icon, NumericInput, Tooltip } from '@viamrobotics/prime-core'
|
|
20
20
|
|
|
21
21
|
import AngleUnitToggle from '../../angle-unit-toggle.svelte'
|
|
22
22
|
import CopyButton from '../../copy-button.svelte'
|
|
@@ -28,13 +28,11 @@
|
|
|
28
28
|
import { parsePastedPose } from './parse-pasted-pose'
|
|
29
29
|
|
|
30
30
|
interface Props {
|
|
31
|
-
referenceFrame: string
|
|
32
31
|
pose: Pose
|
|
33
|
-
onReferenceFrameChange: (frame: string) => void
|
|
34
32
|
onPoseChange: (pose: Pose) => void
|
|
35
33
|
}
|
|
36
34
|
|
|
37
|
-
const {
|
|
35
|
+
const { pose, onPoseChange }: Props = $props()
|
|
38
36
|
|
|
39
37
|
let useRadians = $state(false)
|
|
40
38
|
|
|
@@ -85,7 +83,8 @@
|
|
|
85
83
|
/>
|
|
86
84
|
|
|
87
85
|
<span slot="description">
|
|
88
|
-
The target pose expressed in the
|
|
86
|
+
The target pose expressed in the selected reference frame. Translations are in
|
|
87
|
+
millimeters.
|
|
89
88
|
</span>
|
|
90
89
|
</Tooltip>
|
|
91
90
|
</span>
|
|
@@ -101,19 +100,6 @@
|
|
|
101
100
|
</div>
|
|
102
101
|
</div>
|
|
103
102
|
|
|
104
|
-
<Label>
|
|
105
|
-
Reference frame
|
|
106
|
-
|
|
107
|
-
<Input
|
|
108
|
-
slot="input"
|
|
109
|
-
value={referenceFrame}
|
|
110
|
-
placeholder="world"
|
|
111
|
-
on:input={(event) => {
|
|
112
|
-
onReferenceFrameChange((event.target as HTMLInputElement).value)
|
|
113
|
-
}}
|
|
114
|
-
/>
|
|
115
|
-
</Label>
|
|
116
|
-
|
|
117
103
|
<Table>
|
|
118
104
|
<thead>
|
|
119
105
|
<tr>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Pose } from '@viamrobotics/sdk';
|
|
2
|
+
interface Props {
|
|
3
|
+
pose: Pose;
|
|
4
|
+
onPoseChange: (pose: Pose) => void;
|
|
5
|
+
}
|
|
6
|
+
declare const PoseInput: import("svelte").Component<Props, {}, "">;
|
|
7
|
+
type PoseInput = ReturnType<typeof PoseInput>;
|
|
8
|
+
export default PoseInput;
|
package/dist/registry.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ArmGetJointPositionsWidget, ArmIsMovingWidget, ArmMoveToJointPositionsWidget, ArmMoveToPositionWidget, ArmQuickMoveWidget, ArmWidget, AudioInputGetPropertiesWidget, AudioInputWidget, AudioOutputGetPropertiesWidget, AudioOutputWidget, BaseIsMovingWidget, BaseMoveStraightWidget, BaseQuickMoveWidget, BaseSetPowerWidget, BaseSetVelocityWidget, BaseSpinWidget, BaseWidget, BoardWidget, ButtonWidget, CameraWidget, DiscoveryWidget, EncoderGetPositionWidget, EncoderWidget, GantryGetPositionWidget, GantryHomeWidget, GantryIsMovingWidget, GantryMoveToPositionWidget, GantryQuickMoveWidget, GantryWidget, GripperGrabWidget, GripperIsHoldingSomethingWidget, GripperIsMovingWidget, GripperOpenWidget, GripperWidget, InputControllerWidget, MLModelServiceWidget,
|
|
1
|
+
import { ArmGetJointPositionsWidget, ArmIsMovingWidget, ArmMoveToJointPositionsWidget, ArmMoveToPositionWidget, ArmQuickMoveWidget, ArmWidget, AudioInputGetPropertiesWidget, AudioInputWidget, AudioOutputGetPropertiesWidget, AudioOutputWidget, BaseIsMovingWidget, BaseMoveStraightWidget, BaseQuickMoveWidget, BaseSetPowerWidget, BaseSetVelocityWidget, BaseSpinWidget, BaseWidget, BoardWidget, ButtonWidget, CameraWidget, DiscoveryWidget, EncoderGetPositionWidget, EncoderWidget, GantryGetPositionWidget, GantryHomeWidget, GantryIsMovingWidget, GantryMoveToPositionWidget, GantryQuickMoveWidget, GantryWidget, GripperGrabWidget, GripperIsHoldingSomethingWidget, GripperIsMovingWidget, GripperOpenWidget, GripperWidget, InputControllerWidget, MLModelServiceWidget, MotionServiceWidget, MotorGoForWidget, MotorGoToWidget, MotorIsMovingWidget, MotorQuickMoveWidget, MotorSetPowerWidget, MotorSetRPMWidget, MotorWidget, MovementSensorGetAccuracyWidget, MovementSensorGetCompassHeadingWidget, MovementSensorGetOrientationWidget, MovementSensorGetPositionWidget, MovementSensorWidget, NavigationServiceWidget, PowerSensorGetCurrentWidget, PowerSensorGetPowerWidget, PowerSensorGetVoltageWidget, PowerSensorWidget, SensorWidget, ServoIsMovingWidget, ServoMoveWidget, ServoQuickMoveWidget, ServoWidget, SlamGetPositionWidget, SlamWidget, SwitchWidget, VisionServiceWidget, } from "./components/index.js";
|
|
2
2
|
import { getResourceAPI } from "./get-resource-api.js";
|
|
3
3
|
import { ResourceTriplets } from "./resource-triplet.js";
|
|
4
4
|
/**
|
|
@@ -132,10 +132,7 @@ const resourceWidgetRegistry = {
|
|
|
132
132
|
// services
|
|
133
133
|
[ResourceTriplets.Discovery]: { widget: DiscoveryWidget, apis: [] },
|
|
134
134
|
[ResourceTriplets.MLModel]: { widget: MLModelServiceWidget, apis: [] },
|
|
135
|
-
[ResourceTriplets.Motion]: {
|
|
136
|
-
widget: MotionServiceWidget,
|
|
137
|
-
apis: [{ id: 'move', label: 'Move', widgets: [MotionMoveWidget] }],
|
|
138
|
-
},
|
|
135
|
+
[ResourceTriplets.Motion]: { widget: MotionServiceWidget, apis: [] },
|
|
139
136
|
[ResourceTriplets.Navigation]: { widget: NavigationServiceWidget, apis: [] },
|
|
140
137
|
[ResourceTriplets.Slam]: {
|
|
141
138
|
widget: SlamWidget,
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
interface Props {
|
|
2
|
-
value: string;
|
|
3
|
-
options: string[];
|
|
4
|
-
label?: string;
|
|
5
|
-
onChange: (value: string) => void;
|
|
6
|
-
}
|
|
7
|
-
declare const ComponentNameSelect: import("svelte").Component<Props, {}, "">;
|
|
8
|
-
type ComponentNameSelect = ReturnType<typeof ComponentNameSelect>;
|
|
9
|
-
export default ComponentNameSelect;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Pose } from '@viamrobotics/sdk';
|
|
2
|
-
interface Props {
|
|
3
|
-
referenceFrame: string;
|
|
4
|
-
pose: Pose;
|
|
5
|
-
onReferenceFrameChange: (frame: string) => void;
|
|
6
|
-
onPoseChange: (pose: Pose) => void;
|
|
7
|
-
}
|
|
8
|
-
declare const PoseInFrameInput: import("svelte").Component<Props, {}, "">;
|
|
9
|
-
type PoseInFrameInput = ReturnType<typeof PoseInFrameInput>;
|
|
10
|
-
export default PoseInFrameInput;
|