@viamrobotics/test-widgets 0.11.3 → 0.13.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/dist/components/refetch-controller.svelte +5 -2
- package/dist/components/refetch-interval-store.svelte.d.ts +1 -1
- package/dist/components/widgets/arm/arm.svelte +7 -20
- package/dist/components/widgets/arm/joint-position-editor.svelte +8 -3
- package/dist/components/widgets/arm/joint-position-editor.svelte.d.ts +2 -1
- package/dist/components/widgets/arm/joint-position-jogging.svelte +216 -0
- package/dist/components/widgets/arm/joint-position-jogging.svelte.d.ts +13 -0
- package/dist/components/widgets/arm/move-control-mode.d.ts +23 -0
- package/dist/components/widgets/arm/move-control-mode.js +26 -0
- package/dist/components/widgets/arm/move-to-joint-positions-widget.svelte +2 -2
- package/dist/components/widgets/arm/move-to-joint-positions.svelte +11 -9
- package/dist/components/widgets/arm/move-to-joint-positions.svelte.d.ts +2 -1
- package/dist/components/widgets/arm/move-to-position-control.svelte +184 -0
- package/dist/components/widgets/arm/move-to-position-control.svelte.d.ts +7 -0
- package/dist/components/widgets/arm/move-to-position-widget.svelte +5 -33
- package/dist/components/widgets/arm/move-to-position.svelte +8 -2
- package/dist/components/widgets/arm/move-to-position.svelte.d.ts +1 -0
- package/dist/components/widgets/arm/useJogQueue.svelte.d.ts +51 -0
- package/dist/components/widgets/arm/useJogQueue.svelte.js +143 -0
- package/dist/components/widgets/camera/camera.svelte +122 -124
- package/dist/components/widgets/camera/export-screenshot.svelte +12 -8
- package/dist/components/widgets/camera/picture-in-picture-button.svelte +13 -12
- package/dist/components/widgets/do-command/create-do-command-client.svelte.d.ts +2 -3
- package/dist/components/widgets/do-command/create-do-command-client.svelte.js +7 -1
- package/dist/components/widgets/do-command/resource-do-command.svelte +3 -3
- package/dist/components/widgets/vision-service/vision-service.svelte +11 -5
- package/dist/registry.js +1 -1
- package/package.json +2 -2
- package/dist/components/widgets/arm/joint-position-quick-move.svelte +0 -85
- package/dist/components/widgets/arm/joint-position-quick-move.svelte.d.ts +0 -9
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import {
|
|
5
5
|
createResourceClient,
|
|
6
6
|
createResourceQuery,
|
|
7
|
-
|
|
7
|
+
useResourceStatuses,
|
|
8
8
|
} from '@viamrobotics/svelte-sdk'
|
|
9
9
|
|
|
10
10
|
import { useAddImageToDataset } from '../../../add-image-to-dataset'
|
|
@@ -46,12 +46,18 @@
|
|
|
46
46
|
let showObjectPointClouds = $state(false)
|
|
47
47
|
let isRemote = $state(false)
|
|
48
48
|
|
|
49
|
-
const
|
|
49
|
+
const cameraStatuses = useResourceStatuses(() => partID, 'camera')
|
|
50
|
+
|
|
51
|
+
const cameras = $derived(
|
|
52
|
+
cameraStatuses.current
|
|
53
|
+
.map((status) => status.name?.name)
|
|
54
|
+
.filter((name): name is string => name !== undefined)
|
|
55
|
+
)
|
|
50
56
|
|
|
51
57
|
$effect.pre(() => {
|
|
52
|
-
if (cameras.
|
|
58
|
+
if (cameras.length > 0 && !initialFetchComplete) {
|
|
53
59
|
initialFetchComplete = true
|
|
54
|
-
cameraName = cameras
|
|
60
|
+
cameraName = cameras[0] ?? ''
|
|
55
61
|
}
|
|
56
62
|
})
|
|
57
63
|
|
|
@@ -136,7 +142,7 @@
|
|
|
136
142
|
>
|
|
137
143
|
Default camera
|
|
138
144
|
</option>
|
|
139
|
-
{#each cameras
|
|
145
|
+
{#each cameras as name (name)}
|
|
140
146
|
<option
|
|
141
147
|
selected={cameraName === name}
|
|
142
148
|
value={name}
|
package/dist/registry.js
CHANGED
|
@@ -17,7 +17,7 @@ const resourceWidgetRegistry = {
|
|
|
17
17
|
widgets: [ArmMoveToJointPositionsWidget],
|
|
18
18
|
},
|
|
19
19
|
{ id: 'move-to-position', label: 'MoveToPosition', widgets: [ArmMoveToPositionWidget] },
|
|
20
|
-
{ id: 'quick-move', label: '
|
|
20
|
+
{ id: 'quick-move', label: 'Jogging', widgets: [ArmQuickMoveWidget] },
|
|
21
21
|
{
|
|
22
22
|
id: 'get-joint-positions',
|
|
23
23
|
label: 'GetJointPositions',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viamrobotics/test-widgets",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"wireit": {
|
|
@@ -249,7 +249,7 @@
|
|
|
249
249
|
"@types/three": "^0.183.1",
|
|
250
250
|
"@viamrobotics/prime-core": "^0.1.22",
|
|
251
251
|
"@viamrobotics/sdk": "^0.69.0",
|
|
252
|
-
"@viamrobotics/svelte-sdk": "^1.
|
|
252
|
+
"@viamrobotics/svelte-sdk": "^1.5.1",
|
|
253
253
|
"@viamrobotics/tailwind-config": "^1.2.0",
|
|
254
254
|
"@vitest/browser": "^4.1.10",
|
|
255
255
|
"@vitest/browser-playwright": "^4.1.5",
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Button, Icon, Tooltip } from '@viamrobotics/prime-core'
|
|
3
|
-
|
|
4
|
-
import Table from '../../table.svelte'
|
|
5
|
-
import { degreesToRadians, formatNumeric } from '../../../format'
|
|
6
|
-
|
|
7
|
-
const INCREMENT_DEGREES = 5
|
|
8
|
-
|
|
9
|
-
interface Props {
|
|
10
|
-
positions: number[]
|
|
11
|
-
moveToJointPositions: (jointPositions: number[]) => void
|
|
12
|
-
useRadians: boolean
|
|
13
|
-
isMoving: boolean
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const { positions, moveToJointPositions, useRadians, isMoving }: Props = $props()
|
|
17
|
-
|
|
18
|
-
const toDisplayAngle = (degrees: number) => (useRadians ? degreesToRadians(degrees) : degrees)
|
|
19
|
-
|
|
20
|
-
const currentDisplayPositions = $derived(positions.map((degrees) => toDisplayAngle(degrees)))
|
|
21
|
-
|
|
22
|
-
const quickMove = (index: number, increment: number) => {
|
|
23
|
-
if (isMoving) {
|
|
24
|
-
return
|
|
25
|
-
}
|
|
26
|
-
const clonedPositions = positions.map((position, positionIndex) =>
|
|
27
|
-
positionIndex === index ? position + increment : position
|
|
28
|
-
)
|
|
29
|
-
moveToJointPositions(clonedPositions)
|
|
30
|
-
}
|
|
31
|
-
</script>
|
|
32
|
-
|
|
33
|
-
<Tooltip>
|
|
34
|
-
<span class="flex items-center gap-1 text-xs text-amber-600">
|
|
35
|
-
<Icon
|
|
36
|
-
name="alert"
|
|
37
|
-
size="sm"
|
|
38
|
-
cx="text-amber-600"
|
|
39
|
-
/>
|
|
40
|
-
Quick move executes immediately
|
|
41
|
-
</span>
|
|
42
|
-
<span slot="description">
|
|
43
|
-
Each ±5° button sends a move command as soon as it is pressed. Buttons are disabled while the
|
|
44
|
-
arm is moving.
|
|
45
|
-
</span>
|
|
46
|
-
</Tooltip>
|
|
47
|
-
|
|
48
|
-
<Table>
|
|
49
|
-
<thead>
|
|
50
|
-
<tr>
|
|
51
|
-
<th>Joint</th>
|
|
52
|
-
<th>Move (degrees)</th>
|
|
53
|
-
</tr>
|
|
54
|
-
</thead>
|
|
55
|
-
<tbody>
|
|
56
|
-
{#each positions as position, index (index)}
|
|
57
|
-
{@const currentValue = currentDisplayPositions[index] ?? position}
|
|
58
|
-
{@const unit = useRadians ? ' rad' : '°'}
|
|
59
|
-
<tr>
|
|
60
|
-
<th scope="row">{index}</th>
|
|
61
|
-
<th>
|
|
62
|
-
<div class="flex h-full max-h-6.5 w-full items-center justify-center gap-1.5">
|
|
63
|
-
<Button
|
|
64
|
-
aria-label="Decrease joint {index} by 5 degrees"
|
|
65
|
-
disabled={isMoving}
|
|
66
|
-
onclick={() => quickMove(index, -INCREMENT_DEGREES)}
|
|
67
|
-
>
|
|
68
|
-
−5°
|
|
69
|
-
</Button>
|
|
70
|
-
<span class="min-w-16 grow text-center text-xs text-gray-700 tabular-nums">
|
|
71
|
-
{formatNumeric(currentValue)}{unit}
|
|
72
|
-
</span>
|
|
73
|
-
<Button
|
|
74
|
-
aria-label="Increase joint {index} by 5 degrees"
|
|
75
|
-
disabled={isMoving}
|
|
76
|
-
onclick={() => quickMove(index, INCREMENT_DEGREES)}
|
|
77
|
-
>
|
|
78
|
-
+5°
|
|
79
|
-
</Button>
|
|
80
|
-
</div>
|
|
81
|
-
</th>
|
|
82
|
-
</tr>
|
|
83
|
-
{/each}
|
|
84
|
-
</tbody>
|
|
85
|
-
</Table>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
interface Props {
|
|
2
|
-
positions: number[];
|
|
3
|
-
moveToJointPositions: (jointPositions: number[]) => void;
|
|
4
|
-
useRadians: boolean;
|
|
5
|
-
isMoving: boolean;
|
|
6
|
-
}
|
|
7
|
-
declare const JointPositionQuickMove: import("svelte").Component<Props, {}, "">;
|
|
8
|
-
type JointPositionQuickMove = ReturnType<typeof JointPositionQuickMove>;
|
|
9
|
-
export default JointPositionQuickMove;
|