@viamrobotics/motion-tools 1.3.2 → 1.3.3

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.
@@ -31,10 +31,7 @@
31
31
 
32
32
  const { ...rest } = $props()
33
33
 
34
- const dragPosition = new PersistedState<Vector2Like | undefined>(
35
- 'details-drag-position',
36
- undefined
37
- )
34
+ const dragPosition = new PersistedState<Vector2Like>('details-drag-position', { x: 0, y: 0 })
38
35
 
39
36
  const resourceByName = useResourceByName()
40
37
  const frames = useFrames()
@@ -10,6 +10,7 @@ import { RefetchRates } from '../components/RefreshRate.svelte';
10
10
  import { useLogs } from './useLogs.svelte';
11
11
  import { useResourceByName } from './useResourceByName.svelte';
12
12
  import { useRefetchPoses } from './useRefetchPoses';
13
+ const origingFrameComponentTypes = ['arm', 'gantry', 'gripper'];
13
14
  export const usePose = (name, parent) => {
14
15
  const environment = useEnvironment();
15
16
  const logs = useLogs();
@@ -25,10 +26,10 @@ export const usePose = (name, parent) => {
25
26
  const frames = useFrames();
26
27
  let pose = $state(undefined);
27
28
  const interval = $derived(refreshRates.get(RefreshRates.poses));
28
- const resolvedParent = $derived(parentResource?.subtype === 'arm' || parentResource?.subtype === 'gantry'
29
+ const resolvedParent = $derived(origingFrameComponentTypes.includes(parentResource?.subtype ?? '')
29
30
  ? `${parent()}_origin`
30
31
  : parent());
31
- const resolvedName = $derived(resource?.subtype === 'arm' || resource?.subtype === 'gantry'
32
+ const resolvedName = $derived(origingFrameComponentTypes.includes(resource?.subtype ?? '')
32
33
  ? `${currentName}_origin`
33
34
  : currentName);
34
35
  const query = createRobotQuery(robotClient, 'getPose', () => [resolvedName, resolvedParent ?? 'world', []], () => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viamrobotics/motion-tools",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "Motion visualization with Viam",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",