@viamrobotics/motion-tools 0.11.6 → 0.11.7
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.
|
@@ -22,33 +22,23 @@
|
|
|
22
22
|
</script>
|
|
23
23
|
|
|
24
24
|
{#each frames.current as object (object.uuid)}
|
|
25
|
-
<Pose
|
|
25
|
+
<Pose
|
|
26
|
+
name={object.name}
|
|
27
|
+
parent={object.referenceFrame}
|
|
28
|
+
>
|
|
26
29
|
{#snippet children({ pose })}
|
|
27
|
-
{
|
|
30
|
+
<Portal id={object.referenceFrame}>
|
|
28
31
|
<Frame
|
|
29
32
|
uuid={object.uuid}
|
|
30
33
|
name={object.name}
|
|
31
|
-
{pose}
|
|
34
|
+
pose={pose ?? object.pose}
|
|
32
35
|
geometry={object.geometry}
|
|
33
36
|
metadata={object.metadata}
|
|
34
37
|
>
|
|
35
38
|
<PortalTarget id={object.name} />
|
|
36
39
|
<Label text={object.name} />
|
|
37
40
|
</Frame>
|
|
38
|
-
|
|
39
|
-
<Portal id={object.referenceFrame}>
|
|
40
|
-
<Frame
|
|
41
|
-
uuid={object.uuid}
|
|
42
|
-
name={object.name}
|
|
43
|
-
pose={pose ?? object.pose}
|
|
44
|
-
geometry={object.geometry}
|
|
45
|
-
metadata={object.metadata}
|
|
46
|
-
>
|
|
47
|
-
<PortalTarget id={object.name} />
|
|
48
|
-
<Label text={object.name} />
|
|
49
|
-
</Frame>
|
|
50
|
-
</Portal>
|
|
51
|
-
{/if}
|
|
41
|
+
</Portal>
|
|
52
42
|
{/snippet}
|
|
53
43
|
</Pose>
|
|
54
44
|
{/each}
|
|
@@ -23,11 +23,15 @@ export const provideFrames = (partID) => {
|
|
|
23
23
|
continue;
|
|
24
24
|
}
|
|
25
25
|
const resourceName = resourceNames.current.find((item) => item.name === frame.referenceFrame);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
26
|
+
const frameName = frame.referenceFrame ? frame.referenceFrame : 'Unnamed frame';
|
|
27
|
+
objects.push(new WorldObject(frameName, frame.poseInObserverFrame?.pose, frame.poseInObserverFrame?.referenceFrame));
|
|
28
|
+
if (frame.physicalObject?.geometryType) {
|
|
29
|
+
objects.push(new WorldObject(`${frameName} ${frame.physicalObject.geometryType.case}`, frame.physicalObject.center, frameName, frame.physicalObject.geometryType, resourceName
|
|
30
|
+
? {
|
|
31
|
+
color: resourceColors[resourceName.subtype],
|
|
32
|
+
}
|
|
33
|
+
: undefined));
|
|
34
|
+
}
|
|
31
35
|
}
|
|
32
36
|
return objects;
|
|
33
37
|
});
|
|
@@ -11,6 +11,7 @@ export const usePose = (name, parent) => {
|
|
|
11
11
|
const motionClient = useMotionClient();
|
|
12
12
|
const resources = useResourceNames(() => partID.current);
|
|
13
13
|
const resource = $derived(resources.current.find((resource) => resource.name === name()));
|
|
14
|
+
const parentResource = $derived(resources.current.find((resource) => resource.name === parent()));
|
|
14
15
|
const client = createResourceClient(MotionClient, () => partID.current, () => motionClient.current ?? '');
|
|
15
16
|
const interval = $derived(refreshRates.get('Poses'));
|
|
16
17
|
const options = $derived(queryOptions({
|
|
@@ -28,7 +29,8 @@ export const usePose = (name, parent) => {
|
|
|
28
29
|
if (!client.current || !resource) {
|
|
29
30
|
throw new Error('No client');
|
|
30
31
|
}
|
|
31
|
-
const
|
|
32
|
+
const resolvedParent = parentResource?.subtype === 'arm' ? `${parent()}_origin` : parent();
|
|
33
|
+
const pose = await client.current.getPose(resource.name, resolvedParent ?? 'world', []);
|
|
32
34
|
return pose;
|
|
33
35
|
},
|
|
34
36
|
}));
|