@wandelbots/wandelbots-js-react-components 2.54.5-pr.feat-upgrade-jogging-to-v2.404.bbdcc8a → 2.55.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.
Files changed (109) hide show
  1. package/README.md +1 -1
  2. package/dist/auth0-spa-js.production.esm-1QXzndwB.js +950 -0
  3. package/dist/auth0-spa-js.production.esm-1QXzndwB.js.map +1 -0
  4. package/dist/auth0-spa-js.production.esm-BLRAk7Yh.cjs +5 -0
  5. package/dist/auth0-spa-js.production.esm-BLRAk7Yh.cjs.map +1 -0
  6. package/dist/components/3d-viewport/CoordinateSystemTransform.d.ts +1 -1
  7. package/dist/components/3d-viewport/CoordinateSystemTransform.d.ts.map +1 -1
  8. package/dist/components/3d-viewport/SafetyZonesRenderer.d.ts.map +1 -1
  9. package/dist/components/3d-viewport/collider/ColliderCollection.d.ts +1 -1
  10. package/dist/components/3d-viewport/collider/ColliderCollection.d.ts.map +1 -1
  11. package/dist/components/3d-viewport/collider/ColliderElement.d.ts +1 -1
  12. package/dist/components/3d-viewport/collider/ColliderElement.d.ts.map +1 -1
  13. package/dist/components/3d-viewport/collider/CollisionSceneRenderer.d.ts +1 -1
  14. package/dist/components/3d-viewport/collider/CollisionSceneRenderer.d.ts.map +1 -1
  15. package/dist/components/3d-viewport/collider/colliderShapeToBufferGeometry.d.ts +1 -1
  16. package/dist/components/3d-viewport/collider/colliderShapeToBufferGeometry.d.ts.map +1 -1
  17. package/dist/components/ProgramStateIndicator.d.ts +3 -3
  18. package/dist/components/ProgramStateIndicator.d.ts.map +1 -1
  19. package/dist/components/RobotCard.d.ts +3 -4
  20. package/dist/components/RobotCard.d.ts.map +1 -1
  21. package/dist/components/jogging/JoggingCartesianTab.d.ts.map +1 -1
  22. package/dist/components/jogging/JoggingJointTab.d.ts.map +1 -1
  23. package/dist/components/jogging/JoggingPanel.d.ts +1 -1
  24. package/dist/components/jogging/JoggingPanel.d.ts.map +1 -1
  25. package/dist/components/jogging/JoggingStore.d.ts +5 -10
  26. package/dist/components/jogging/JoggingStore.d.ts.map +1 -1
  27. package/dist/components/jogging/PoseCartesianValues.d.ts +2 -2
  28. package/dist/components/jogging/PoseCartesianValues.d.ts.map +1 -1
  29. package/dist/components/jogging/PoseJointValues.d.ts +2 -1
  30. package/dist/components/jogging/PoseJointValues.d.ts.map +1 -1
  31. package/dist/components/robots/DHRobot.d.ts.map +1 -1
  32. package/dist/components/robots/Robot.d.ts +1 -1
  33. package/dist/components/robots/Robot.d.ts.map +1 -1
  34. package/dist/components/robots/RobotAnimator.d.ts +2 -2
  35. package/dist/components/robots/RobotAnimator.d.ts.map +1 -1
  36. package/dist/components/robots/SupportedRobot.d.ts +3 -3
  37. package/dist/components/robots/SupportedRobot.d.ts.map +1 -1
  38. package/dist/components/robots/manufacturerHomePositions.d.ts +1 -1
  39. package/dist/components/robots/manufacturerHomePositions.d.ts.map +1 -1
  40. package/dist/components/safetyBar/OperationModeIndicator.d.ts +2 -2
  41. package/dist/components/safetyBar/OperationModeIndicator.d.ts.map +1 -1
  42. package/dist/components/safetyBar/SafetyBar.d.ts +3 -3
  43. package/dist/components/safetyBar/SafetyBar.d.ts.map +1 -1
  44. package/dist/components/safetyBar/SafetyStateIndicator.d.ts +2 -2
  45. package/dist/components/safetyBar/SafetyStateIndicator.d.ts.map +1 -1
  46. package/dist/components/utils/errorHandling.d.ts.map +1 -1
  47. package/dist/index.cjs +50 -48
  48. package/dist/index.cjs.map +1 -1
  49. package/dist/index.js +20431 -15783
  50. package/dist/index.js.map +1 -1
  51. package/package.json +2 -2
  52. package/src/components/3d-viewport/CoordinateSystemTransform.tsx +1 -1
  53. package/src/components/3d-viewport/SafetyZonesRenderer.tsx +2 -1
  54. package/src/components/3d-viewport/collider/ColliderCollection.tsx +1 -1
  55. package/src/components/3d-viewport/collider/ColliderElement.tsx +1 -1
  56. package/src/components/3d-viewport/collider/CollisionSceneRenderer.tsx +1 -1
  57. package/src/components/3d-viewport/collider/colliderShapeToBufferGeometry.ts +1 -1
  58. package/src/components/ProgramStateIndicator.tsx +6 -3
  59. package/src/components/RobotCard.tsx +7 -4
  60. package/src/components/jogging/JoggingCartesianTab.tsx +11 -13
  61. package/src/components/jogging/JoggingJointLimitDetector.tsx +2 -2
  62. package/src/components/jogging/JoggingJointTab.tsx +3 -4
  63. package/src/components/jogging/JoggingPanel.tsx +3 -6
  64. package/src/components/jogging/JoggingStore.ts +39 -66
  65. package/src/components/jogging/PoseCartesianValues.tsx +4 -3
  66. package/src/components/jogging/PoseJointValues.tsx +4 -3
  67. package/src/components/robots/DHRobot.tsx +3 -2
  68. package/src/components/robots/Robot.tsx +1 -1
  69. package/src/components/robots/RobotAnimator.test.tsx +22 -7
  70. package/src/components/robots/RobotAnimator.tsx +13 -8
  71. package/src/components/robots/SupportedRobot.tsx +6 -3
  72. package/src/components/robots/manufacturerHomePositions.ts +1 -1
  73. package/src/components/safetyBar/OperationModeIndicator.tsx +2 -2
  74. package/src/components/safetyBar/SafetyBar.tsx +6 -3
  75. package/src/components/safetyBar/SafetyStateIndicator.tsx +2 -2
  76. package/src/components/utils/errorHandling.ts +0 -4
  77. package/src/i18n/locales/de/translations.json +0 -3
  78. package/src/i18n/locales/en/translations.json +0 -3
  79. package/dist/auth0-spa-js.production.esm-Bb4L9JDU.js +0 -1423
  80. package/dist/auth0-spa-js.production.esm-Bb4L9JDU.js.map +0 -1
  81. package/dist/auth0-spa-js.production.esm-CEI5Uihg.cjs +0 -5
  82. package/dist/auth0-spa-js.production.esm-CEI5Uihg.cjs.map +0 -1
  83. package/dist/components/jogging/JoggingBlocked.d.ts +0 -7
  84. package/dist/components/jogging/JoggingBlocked.d.ts.map +0 -1
  85. package/dist/components/utils/errorHandling.test.d.ts +0 -2
  86. package/dist/components/utils/errorHandling.test.d.ts.map +0 -1
  87. package/dist/lib/ConnectedMotionGroup.d.ts +0 -90
  88. package/dist/lib/ConnectedMotionGroup.d.ts.map +0 -1
  89. package/dist/lib/JoggerConnection.d.ts +0 -113
  90. package/dist/lib/JoggerConnection.d.ts.map +0 -1
  91. package/dist/lib/JoggerConnection.test.d.ts +0 -2
  92. package/dist/lib/JoggerConnection.test.d.ts.map +0 -1
  93. package/dist/lib/MotionStreamConnection.d.ts +0 -24
  94. package/dist/lib/MotionStreamConnection.d.ts.map +0 -1
  95. package/dist/lib/MotionStreamConnection.test.d.ts +0 -2
  96. package/dist/lib/MotionStreamConnection.test.d.ts.map +0 -1
  97. package/dist/lib/motionStateUpdate.d.ts +0 -7
  98. package/dist/lib/motionStateUpdate.d.ts.map +0 -1
  99. package/dist/lib/motionStateUpdate.test.d.ts +0 -2
  100. package/dist/lib/motionStateUpdate.test.d.ts.map +0 -1
  101. package/src/components/jogging/JoggingBlocked.tsx +0 -37
  102. package/src/components/utils/errorHandling.test.ts +0 -41
  103. package/src/lib/ConnectedMotionGroup.ts +0 -444
  104. package/src/lib/JoggerConnection.test.ts +0 -120
  105. package/src/lib/JoggerConnection.ts +0 -674
  106. package/src/lib/MotionStreamConnection.test.ts +0 -23
  107. package/src/lib/MotionStreamConnection.ts +0 -186
  108. package/src/lib/motionStateUpdate.test.ts +0 -28
  109. package/src/lib/motionStateUpdate.ts +0 -117
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wandelbots/wandelbots-js-react-components",
3
- "version": "2.54.5-pr.feat-upgrade-jogging-to-v2.404.bbdcc8a",
3
+ "version": "2.55.0",
4
4
  "description": "React UI toolkit for building applications on top of the Wandelbots platform",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -70,7 +70,7 @@
70
70
  "@types/react": "^19.1.8",
71
71
  "@types/three": "^0.174.0",
72
72
  "@vitejs/plugin-react": "^4.3.4",
73
- "@wandelbots/nova-js": "3.3.1",
73
+ "@wandelbots/nova-js": "^2.1.0",
74
74
  "add": "^2.0.6",
75
75
  "eslint-plugin-storybook": "^10.0.1",
76
76
  "glob": "^11.0.1",
@@ -1,4 +1,4 @@
1
- import type { CoordinateSystem } from "@wandelbots/nova-js/v1"
1
+ import type { CoordinateSystem } from "@wandelbots/nova-api/v1"
2
2
  import type { ReactNode } from "react"
3
3
  import { Quaternion, Vector3 } from "three"
4
4
 
@@ -1,5 +1,6 @@
1
1
  import { type ThreeElements } from "@react-three/fiber"
2
- import type { Geometry, SafetySetupSafetyZone } from "@wandelbots/nova-js/v1"
2
+ import type { Geometry } from "@wandelbots/nova-api/v1"
3
+ import type { SafetySetupSafetyZone } from "@wandelbots/nova-js/v1"
3
4
  import * as THREE from "three"
4
5
  import { ConvexGeometry } from "three-stdlib"
5
6
 
@@ -1,5 +1,5 @@
1
1
  import type { ThreeElements } from "@react-three/fiber"
2
- import type { Collider } from "@wandelbots/nova-js/v1"
2
+ import type { Collider } from "@wandelbots/nova-api/v1"
3
3
  import ColliderElement from "./ColliderElement"
4
4
 
5
5
  export type MeshChildrenProvider = (
@@ -1,4 +1,4 @@
1
- import type { Collider } from "@wandelbots/nova-js/v1"
1
+ import type { Collider } from "@wandelbots/nova-api/v1"
2
2
  import type React from "react"
3
3
  import * as THREE from "three"
4
4
  import { colliderShapeToBufferGeometry } from "./colliderShapeToBufferGeometry"
@@ -1,4 +1,4 @@
1
- import type { CollisionScene } from "@wandelbots/nova-js/v1"
1
+ import type { CollisionScene } from "@wandelbots/nova-api/v1"
2
2
  import ColliderCollection, {
3
3
  type MeshChildrenProvider,
4
4
  } from "./ColliderCollection"
@@ -1,4 +1,4 @@
1
- import type { ColliderShape } from "@wandelbots/nova-js/v1"
1
+ import type { ColliderShape } from "@wandelbots/nova-api/v1"
2
2
  import * as THREE from "three"
3
3
  import { ConvexGeometry } from "three-stdlib"
4
4
 
@@ -1,5 +1,8 @@
1
1
  import { Chip, Typography, useTheme } from "@mui/material"
2
- import type { OperationMode, SafetyStateType } from "@wandelbots/nova-js/v2"
2
+ import type {
3
+ RobotControllerStateOperationModeEnum,
4
+ RobotControllerStateSafetyStateEnum,
5
+ } from "@wandelbots/nova-js/v1"
3
6
  import { observer } from "mobx-react-lite"
4
7
  import { useTranslation } from "react-i18next"
5
8
  import { externalizeComponent } from "../externalizeComponent"
@@ -9,9 +12,9 @@ export interface ProgramStateIndicatorProps {
9
12
  /** The current state of the program */
10
13
  programState: ProgramState
11
14
  /** The current safety state of the robot controller */
12
- safetyState: SafetyStateType
15
+ safetyState: RobotControllerStateSafetyStateEnum
13
16
  /** The current operation mode of the robot controller */
14
- operationMode: OperationMode
17
+ operationMode: RobotControllerStateOperationModeEnum
15
18
  /** Additional CSS class name */
16
19
  className?: string
17
20
  }
@@ -1,13 +1,16 @@
1
1
  import { Box, Button, Card, Divider, Typography, useTheme } from "@mui/material"
2
2
  import { Bounds } from "@react-three/drei"
3
3
  import { Canvas } from "@react-three/fiber"
4
- import type { OperationMode, SafetyStateType } from "@wandelbots/nova-js/v2"
4
+ import type {
5
+ ConnectedMotionGroup,
6
+ RobotControllerStateOperationModeEnum,
7
+ RobotControllerStateSafetyStateEnum,
8
+ } from "@wandelbots/nova-js/v1"
5
9
  import { observer } from "mobx-react-lite"
6
10
  import { useCallback, useEffect, useRef, useState } from "react"
7
11
  import { useTranslation } from "react-i18next"
8
12
  import type { Group } from "three"
9
13
  import { externalizeComponent } from "../externalizeComponent"
10
- import type { ConnectedMotionGroup } from "../lib/ConnectedMotionGroup"
11
14
  import { PresetEnvironment } from "./3d-viewport/PresetEnvironment"
12
15
  import type { ProgramState } from "./ProgramControl"
13
16
  import { ProgramStateIndicator } from "./ProgramStateIndicator"
@@ -19,9 +22,9 @@ export interface RobotCardProps {
19
22
  /** Current program state */
20
23
  programState: ProgramState
21
24
  /** Current safety state of the robot controller */
22
- safetyState: SafetyStateType
25
+ safetyState: RobotControllerStateSafetyStateEnum
23
26
  /** Current operation mode of the robot controller */
24
- operationMode: OperationMode
27
+ operationMode: RobotControllerStateOperationModeEnum
25
28
  /** Whether the "Drive to Home" button should be enabled */
26
29
  driveToHomeEnabled?: boolean
27
30
  /** Callback fired when "Drive to Home" button is pressed */
@@ -6,18 +6,13 @@ import {
6
6
  useTheme,
7
7
  type Theme,
8
8
  } from "@mui/material"
9
- import {
10
- degreesToRadians,
11
- radiansToDegrees,
12
- XYZ_TO_VECTOR,
13
- } from "@wandelbots/nova-js"
9
+ import { degreesToRadians, radiansToDegrees } from "@wandelbots/nova-js"
14
10
  import { observer } from "mobx-react-lite"
15
11
  import { useTranslation } from "react-i18next"
16
12
  import XAxisIcon from "../../icons/axis-x.svg"
17
13
  import YAxisIcon from "../../icons/axis-y.svg"
18
14
  import ZAxisIcon from "../../icons/axis-z.svg"
19
15
  import RotationIcon from "../../icons/rotation.svg"
20
- import type { Vector3Simple } from "../../lib/JoggerConnection"
21
16
  import { useReaction } from "../utils/hooks"
22
17
  import { JoggingCartesianAxisControl } from "./JoggingCartesianAxisControl"
23
18
  import { JoggingJointLimitDetector } from "./JoggingJointLimitDetector"
@@ -61,7 +56,7 @@ export const JoggingCartesianTab = observer(
61
56
  () => {
62
57
  store.jogger.motionStream.motionStateSocket.changeUrl(
63
58
  store.jogger.nova.makeWebsocketURL(
64
- `/controllers/${store.jogger.motionStream.controllerId}/motion-groups/${store.jogger.motionGroupId}/state-stream?tcp=${store.selectedTcpId}`,
59
+ `/motion-groups/${store.jogger.motionGroupId}/state-stream?tcp=${store.selectedTcpId}&response_coordinate_system=${store.selectedCoordSystemId}`,
65
60
  ),
66
61
  )
67
62
  },
@@ -75,8 +70,8 @@ export const JoggingCartesianTab = observer(
75
70
  const jogger = await store.activate()
76
71
 
77
72
  const tcpPose = jogger.motionStream.rapidlyChangingMotionState.tcp_pose
78
- const jointPosition = jogger.motionStream.rapidlyChangingMotionState
79
- .joint_position as Vector3Simple
73
+ const jointPosition =
74
+ jogger.motionStream.rapidlyChangingMotionState.state.joint_position
80
75
  if (!tcpPose) return
81
76
 
82
77
  await store.withMotionLock(async () => {
@@ -122,13 +117,13 @@ export const JoggingCartesianTab = observer(
122
117
  }
123
118
 
124
119
  if (opts.motionType === "translate") {
125
- await store.jogger.translateTCP({
120
+ await store.jogger.startTCPTranslation({
126
121
  axis: opts.axis,
127
122
  direction: opts.direction,
128
123
  velocityMmPerSec: store.translationVelocityMmPerSec,
129
124
  })
130
125
  } else {
131
- await store.jogger.rotateTCP({
126
+ await store.jogger.startTCPRotation({
132
127
  axis: opts.axis,
133
128
  direction: opts.direction,
134
129
  velocityRadsPerSec: store.rotationVelocityRadsPerSec,
@@ -194,7 +189,10 @@ export const JoggingCartesianTab = observer(
194
189
  return (
195
190
  <Stack flexGrow={1} gap={2} sx={{ padding: "18px 24px" }}>
196
191
  <Stack gap={2}>
192
+ {/* Jogging options */}
197
193
  <JoggingOptions store={store} />
194
+
195
+ {/* Velocity slider */}
198
196
  <JoggingVelocitySlider store={store} />
199
197
  <Divider />
200
198
  </Stack>
@@ -259,7 +257,7 @@ export const JoggingCartesianTab = observer(
259
257
  getDisplayedValue={() =>
260
258
  formatMM(
261
259
  store.jogger.motionStream.rapidlyChangingMotionState
262
- .tcp_pose?.position?.[XYZ_TO_VECTOR[axis.id]] || 0,
260
+ .tcp_pose?.position[axis.id] || 0,
263
261
  )
264
262
  }
265
263
  startJogging={(direction: "-" | "+") =>
@@ -303,7 +301,7 @@ export const JoggingCartesianTab = observer(
303
301
  getDisplayedValue={() =>
304
302
  formatDegrees(
305
303
  store.jogger.motionStream.rapidlyChangingMotionState
306
- .tcp_pose?.orientation?.[XYZ_TO_VECTOR[axis.id]] || 0,
304
+ .tcp_pose?.orientation?.[axis.id] || 0,
307
305
  )
308
306
  }
309
307
  startJogging={(direction: "-" | "+") =>
@@ -17,14 +17,14 @@ export const JoggingJointLimitDetector = ({
17
17
  const { t } = useTranslation()
18
18
 
19
19
  const [jointLimitsReached, setJointLimitsReached] = useState(
20
- store.jogger.motionStream.rapidlyChangingMotionState
20
+ store.jogger.motionStream.rapidlyChangingMotionState.state
21
21
  .joint_limit_reached.limit_reached,
22
22
  )
23
23
  const jointLimitsReachedRef = useRef(jointLimitsReached)
24
24
 
25
25
  useAnimationFrame(() => {
26
26
  const newLimitsReached =
27
- store.jogger.motionStream.rapidlyChangingMotionState
27
+ store.jogger.motionStream.rapidlyChangingMotionState.state
28
28
  .joint_limit_reached.limit_reached
29
29
 
30
30
  if (!isEqual(jointLimitsReachedRef.current, newLimitsReached)) {
@@ -16,7 +16,7 @@ export const JoggingJointTab = observer(
16
16
  }) {
17
17
  await store.activate()
18
18
 
19
- await store.jogger.rotateJoints({
19
+ await store.jogger.startJointRotation({
20
20
  joint: opts.joint,
21
21
  direction: opts.direction,
22
22
  velocityRadsPerSec: store.rotationVelocityRadsPerSec,
@@ -42,8 +42,7 @@ export const JoggingJointTab = observer(
42
42
  <Stack alignItems="center" gap="24px">
43
43
  {store.jogger.motionStream.joints.map((joint) => {
44
44
  const jointLimits =
45
- store.motionGroupDescription.operation_limits.auto_limits
46
- ?.joints?.[joint.index]?.position
45
+ store.motionGroupSpec.mechanical_joint_limits?.[joint.index]
47
46
  const lowerLimitDegs =
48
47
  jointLimits?.lower_limit !== undefined
49
48
  ? radiansToDegrees(jointLimits.lower_limit)
@@ -81,7 +80,7 @@ export const JoggingJointTab = observer(
81
80
  getValueDegs={() => {
82
81
  const value =
83
82
  store.jogger.motionStream.rapidlyChangingMotionState
84
- .joint_position[joint.index]
83
+ .state.joint_position.joints[joint.index]
85
84
  return value !== undefined
86
85
  ? radiansToDegrees(value)
87
86
  : undefined
@@ -1,16 +1,14 @@
1
1
  import MoveIcon from "@mui/icons-material/OpenWith"
2
2
  import ShareIcon from "@mui/icons-material/Share"
3
3
  import { Stack, Tab, Tabs, type SxProps } from "@mui/material"
4
- import { NovaClient } from "@wandelbots/nova-js/v2"
4
+ import { NovaClient } from "@wandelbots/nova-js/v1"
5
5
  import { isString } from "lodash-es"
6
6
  import { runInAction } from "mobx"
7
7
  import { observer, useLocalObservable } from "mobx-react-lite"
8
8
  import { useEffect } from "react"
9
9
  import { useTranslation } from "react-i18next"
10
10
  import { externalizeComponent } from "../../externalizeComponent"
11
- import { JoggerConnection } from "../../lib/JoggerConnection"
12
11
  import { LoadingCover } from "../LoadingCover"
13
- import { JoggingBlocked } from "./JoggingBlocked"
14
12
  import { JoggingCartesianTab } from "./JoggingCartesianTab"
15
13
  import { JoggingJointTab } from "./JoggingJointTab"
16
14
  import { JoggingStore } from "./JoggingStore"
@@ -60,7 +58,7 @@ export const JoggingPanel = externalizeComponent(
60
58
  try {
61
59
  let joggingStore = props.store
62
60
  if (!joggingStore) {
63
- const jogger = await JoggerConnection.open(nova, props.motionGroupId)
61
+ const jogger = await nova.connectJogger(props.motionGroupId)
64
62
  joggingStore = await JoggingStore.loadFor(jogger)
65
63
  }
66
64
  runInAction(() => {
@@ -183,6 +181,7 @@ const JoggingPanelInner = observer(
183
181
  )
184
182
  })}
185
183
  </Tabs>
184
+
186
185
  {/* Current tab content */}
187
186
  <Stack
188
187
  flexGrow={1}
@@ -191,8 +190,6 @@ const JoggingPanelInner = observer(
191
190
  >
192
191
  {renderTabContent()}
193
192
  </Stack>
194
- {/* Overlay when jogging connection is blocked */}
195
- {store.blocked && <JoggingBlocked store={store} />}
196
193
  </Stack>
197
194
  )
198
195
  },
@@ -1,18 +1,14 @@
1
1
  import { tryParseJson } from "@wandelbots/nova-js"
2
2
  import type {
3
3
  CoordinateSystem,
4
- MotionGroupDescription,
4
+ JoggerConnection,
5
+ MotionGroupSpecification,
5
6
  RobotTcp,
6
- } from "@wandelbots/nova-js/v2"
7
+ } from "@wandelbots/nova-js/v1"
7
8
  import { countBy } from "lodash-es"
8
9
  import keyBy from "lodash-es/keyBy"
9
10
  import uniqueId from "lodash-es/uniqueId"
10
11
  import { autorun, makeAutoObservable, type IReactionDisposer } from "mobx"
11
- import type {
12
- JoggerConnection,
13
- JoggerOrientation,
14
- Vector3Simple,
15
- } from "../../lib/JoggerConnection"
16
12
 
17
13
  const discreteIncrementOptions = [
18
14
  { id: "0.1", mm: 0.1, degrees: 0.05 },
@@ -59,9 +55,6 @@ export class JoggingStore {
59
55
  /** Locks to prevent UI interactions during certain operations */
60
56
  locks = new Set<string>()
61
57
 
62
- /** Block jogging UI interactions when connection is taken by another jogger */
63
- blocked: boolean = false
64
-
65
58
  /**
66
59
  * Id of selected coordinate system from among those defined on the API side
67
60
  */
@@ -112,7 +105,7 @@ export class JoggingStore {
112
105
  maxRotationVelocityDegPerSec: number = 60
113
106
 
114
107
  /** Whether to show the coordinate system select dropdown in the UI */
115
- showCoordSystemSelect: boolean = false
108
+ showCoordSystemSelect: boolean = true
116
109
 
117
110
  /** Whether to show the TCP select dropdown in the UI */
118
111
  showTcpSelect: boolean = true
@@ -145,34 +138,34 @@ export class JoggingStore {
145
138
  const { nova } = jogger
146
139
 
147
140
  // Find out what TCPs this motion group has (we need it for jogging)
148
- const [coordinatesystems, description] = await Promise.all([
149
- // Fetch coord systems so user can select between them
150
- nova.api.controller.listCoordinateSystems(
151
- jogger.motionStream.controllerId,
152
- "ROTATION_VECTOR",
153
- ),
154
-
155
- // Same for TCPs and other info from description
156
- nova.api.motionGroup.getMotionGroupDescription(
157
- jogger.motionStream.controllerId,
158
- jogger.motionGroupId,
159
- ),
160
- ])
161
-
162
- const tcps = Object.entries(description.tcps || {}).map(([id, tcp]) => ({
163
- id,
164
- readable_name: tcp.name,
165
- position: tcp.pose.position as Vector3Simple,
166
- orientation: tcp.pose.orientation as Vector3Simple,
167
- }))
168
-
169
- return new JoggingStore(jogger, coordinatesystems || [], description, tcps)
141
+ const [motionGroupSpec, { coordinatesystems }, { tcps }] =
142
+ await Promise.all([
143
+ nova.api.motionGroupInfos.getMotionGroupSpecification(
144
+ jogger.motionGroupId,
145
+ ),
146
+
147
+ // Fetch coord systems so user can select between them
148
+ nova.api.coordinateSystems.listCoordinateSystems("ROTATION_VECTOR"),
149
+
150
+ // Same for TCPs
151
+ nova.api.motionGroupInfos.listTcps(
152
+ jogger.motionGroupId,
153
+ "ROTATION_VECTOR",
154
+ ),
155
+ ])
156
+
157
+ return new JoggingStore(
158
+ jogger,
159
+ motionGroupSpec,
160
+ coordinatesystems || [],
161
+ tcps || [],
162
+ )
170
163
  }
171
164
 
172
165
  constructor(
173
166
  readonly jogger: JoggerConnection,
167
+ readonly motionGroupSpec: MotionGroupSpecification,
174
168
  readonly coordSystems: CoordinateSystem[],
175
- readonly motionGroupDescription: MotionGroupDescription,
176
169
  readonly tcps: RobotTcp[],
177
170
  ) {
178
171
  // TODO workaround for default coord system on backend having a canonical id
@@ -186,21 +179,13 @@ export class JoggingStore {
186
179
  this.selectedCoordSystemId = coordSystems[0]?.coordinate_system || "world"
187
180
  this.selectedTcpId = tcps[0]?.id || ""
188
181
 
189
- // Make all properties observable and actions auto-bound
190
182
  makeAutoObservable(this, {}, { autoBind: true })
191
183
 
192
- // Register blocked watching
193
- this.jogger.onBlocked = () => {
194
- this.block()
195
- }
196
-
197
184
  // Load user settings from local storage if available
198
185
  this.loadFromLocalStorage()
199
186
 
200
187
  // Automatically save user settings to local storage when save changes
201
188
  this.disposers.push(autorun(() => this.saveToLocalStorage()))
202
-
203
- // Assign joggingStore to window
204
189
  ;(window as any).joggingStore = this
205
190
  }
206
191
 
@@ -216,31 +201,30 @@ export class JoggingStore {
216
201
  }
217
202
 
218
203
  async deactivate() {
219
- if (this.jogger.mode === "jogging") {
220
- return this.jogger.stop()
204
+ const websocket = this.jogger.activeWebsocket
205
+
206
+ this.jogger.setJoggingMode("increment")
207
+
208
+ if (websocket) {
209
+ await websocket.closed()
221
210
  }
222
211
  }
223
212
 
224
213
  /** Activate the jogger with current settings */
225
214
  async activate() {
226
215
  if (this.currentTab.id === "cartesian") {
227
- if (
228
- this.jogger.tcp !== this.selectedTcpId ||
229
- this.jogger.orientation !== this.selectedOrientation
230
- ) {
231
- this.jogger.setOptions({
232
- tcp: this.selectedTcpId,
233
- orientation: this.selectedOrientation as JoggerOrientation,
234
- })
216
+ const cartesianJoggingOpts = {
217
+ tcpId: this.selectedTcpId,
218
+ coordSystemId: this.activeCoordSystemId,
235
219
  }
236
220
 
237
221
  if (this.activeDiscreteIncrement) {
238
- this.jogger.setJoggingMode("trajectory")
222
+ this.jogger.setJoggingMode("increment", cartesianJoggingOpts)
239
223
  } else {
240
- this.jogger.setJoggingMode("jogging")
224
+ this.jogger.setJoggingMode("cartesian", cartesianJoggingOpts)
241
225
  }
242
226
  } else {
243
- this.jogger.setJoggingMode("jogging")
227
+ this.jogger.setJoggingMode("joint")
244
228
  }
245
229
 
246
230
  return this.jogger
@@ -449,17 +433,6 @@ export class JoggingStore {
449
433
  this.locks.delete(id)
450
434
  }
451
435
 
452
- block() {
453
- this.blocked = true
454
- }
455
-
456
- unblock() {
457
- this.blocked = false
458
- if (this.jogger.mode === "jogging") {
459
- this.jogger.initializeJoggingWebsocket()
460
- }
461
- }
462
-
463
436
  /** Lock the UI until the given async callback resolves */
464
437
  async withMotionLock(fn: () => Promise<void>) {
465
438
  const lockId = uniqueId()
@@ -1,12 +1,13 @@
1
1
  import { Button, Stack } from "@mui/material"
2
- import { poseToWandelscriptString, type Pose } from "@wandelbots/nova-js/v2"
2
+ import { poseToWandelscriptString } from "@wandelbots/nova-js"
3
+ import type { TcpPose } from "@wandelbots/nova-js/v1"
3
4
  import { observer } from "mobx-react-lite"
4
5
  import { useState } from "react"
5
6
  import { externalizeComponent } from "../../externalizeComponent"
6
7
  import { CopyableText } from "../CopyableText"
7
8
 
8
9
  export type PoseCartesianValuesProps = {
9
- tcpPose: Pose
10
+ tcpPose: TcpPose
10
11
  showCopyButton?: boolean
11
12
  }
12
13
 
@@ -43,7 +44,7 @@ export const PoseCartesianValues = externalizeComponent(
43
44
  onClick={handleCopy}
44
45
  sx={{ flexShrink: 0 }}
45
46
  >
46
- {copyMessage ? copyMessage : "Copy"}
47
+ { copyMessage ? copyMessage : "Copy"}
47
48
  </Button>
48
49
  )}
49
50
  </Stack>
@@ -1,18 +1,19 @@
1
1
  import { Button, Stack } from "@mui/material"
2
+ import type { Joints } from "@wandelbots/nova-api/v1"
2
3
  import { observer } from "mobx-react-lite"
3
4
  import { useState } from "react"
4
5
  import { externalizeComponent } from "../../externalizeComponent"
5
6
  import { CopyableText } from "../CopyableText"
6
7
 
7
8
  export type PoseJointValuesProps = {
8
- joints: Array<number>
9
+ joints: Joints
9
10
  showCopyButton?: boolean
10
11
  }
11
12
 
12
13
  export const PoseJointValues = externalizeComponent(
13
14
  observer(({ joints, showCopyButton = false }: PoseJointValuesProps) => {
14
15
  const [copyMessage, setCopyMessage] = useState<string | null>(null)
15
- const poseString = `[${joints.map((j: number) => parseFloat(j.toFixed(4))).join(", ")}]`
16
+ const poseString = `[${joints.joints.map((j: number) => parseFloat(j.toFixed(4))).join(", ")}]`
16
17
 
17
18
  const handleCopy = async () => {
18
19
  try {
@@ -42,7 +43,7 @@ export const PoseJointValues = externalizeComponent(
42
43
  onClick={handleCopy}
43
44
  sx={{ flexShrink: 0 }}
44
45
  >
45
- {copyMessage ? copyMessage : "Copy"}
46
+ { copyMessage ? copyMessage : "Copy"}
46
47
  </Button>
47
48
  )}
48
49
  </Stack>
@@ -1,5 +1,5 @@
1
1
  import { Line } from "@react-three/drei"
2
- import type { DHParameter } from "@wandelbots/nova-js/v2"
2
+ import type { DHParameter } from "@wandelbots/nova-api/v1"
3
3
  import React, { useRef } from "react"
4
4
  import type * as THREE from "three"
5
5
  import { Matrix4, Quaternion, Vector3 } from "three"
@@ -113,7 +113,8 @@ export function DHRobot({
113
113
  {dhParameters!.map((param, index) => {
114
114
  const { a, b } = getLinePoints(
115
115
  param,
116
- rapidlyChangingMotionState.joint_position[index] ?? 0,
116
+ rapidlyChangingMotionState.state.joint_position.joints[index] ??
117
+ 0,
117
118
  )
118
119
  const jointName = `dhrobot_J0${index}`
119
120
  return (
@@ -1,7 +1,7 @@
1
1
  import type { ThreeElements } from "@react-three/fiber"
2
2
 
3
+ import type { ConnectedMotionGroup } from "@wandelbots/nova-js/v1"
3
4
  import type { Group } from "three"
4
- import type { ConnectedMotionGroup } from "../../lib/ConnectedMotionGroup"
5
5
  import { defaultGetModel } from "./robotModelLogic"
6
6
  import { SupportedRobot } from "./SupportedRobot"
7
7
 
@@ -1,4 +1,7 @@
1
- import type { DHParameter, MotionGroupState } from "@wandelbots/nova-api/v2"
1
+ import type {
2
+ DHParameter,
3
+ MotionGroupStateResponse,
4
+ } from "@wandelbots/nova-api/v1"
2
5
  import { describe, expect, it, vi } from "vitest"
3
6
  import RobotAnimator from "./RobotAnimator"
4
7
 
@@ -23,8 +26,12 @@ describe("RobotAnimator", () => {
23
26
 
24
27
  it("should handle props with different numbers of joints", () => {
25
28
  // Test that the component accepts different numbers of DH parameters
26
- const mockMotionState4Joints: MotionGroupState = {
27
- joint_position: [0.1, 0.2, 0.3, 0.4],
29
+ const mockMotionState4Joints: MotionGroupStateResponse = {
30
+ state: {
31
+ joint_position: {
32
+ joints: [0.1, 0.2, 0.3, 0.4],
33
+ },
34
+ },
28
35
  } as any
29
36
 
30
37
  const mockDHParameters4Joints: DHParameter[] = [
@@ -34,8 +41,12 @@ describe("RobotAnimator", () => {
34
41
  { theta: 0, reverse_rotation_direction: false },
35
42
  ]
36
43
 
37
- const mockMotionState7Joints: MotionGroupState = {
38
- joint_position: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7],
44
+ const mockMotionState7Joints: MotionGroupStateResponse = {
45
+ state: {
46
+ joint_position: {
47
+ joints: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7],
48
+ },
49
+ },
39
50
  } as any
40
51
 
41
52
  const mockDHParameters7Joints: DHParameter[] = Array(7).fill({
@@ -52,7 +63,9 @@ describe("RobotAnimator", () => {
52
63
  }
53
64
  // Verify props are correctly typed
54
65
  expect(props4.dhParameters).toHaveLength(4)
55
- expect(props4.rapidlyChangingMotionState.joint_position).toHaveLength(4)
66
+ expect(
67
+ props4.rapidlyChangingMotionState.state.joint_position.joints,
68
+ ).toHaveLength(4)
56
69
  }).not.toThrow()
57
70
 
58
71
  expect(() => {
@@ -62,7 +75,9 @@ describe("RobotAnimator", () => {
62
75
  children: null,
63
76
  }
64
77
  expect(props7.dhParameters).toHaveLength(7)
65
- expect(props7.rapidlyChangingMotionState.joint_position).toHaveLength(7)
78
+ expect(
79
+ props7.rapidlyChangingMotionState.state.joint_position.joints,
80
+ ).toHaveLength(7)
66
81
  }).not.toThrow()
67
82
  })
68
83
 
@@ -1,5 +1,8 @@
1
1
  import { useFrame, useThree } from "@react-three/fiber"
2
- import type { DHParameter, MotionGroupState } from "@wandelbots/nova-js/v2"
2
+ import type {
3
+ DHParameter,
4
+ MotionGroupStateResponse,
5
+ } from "@wandelbots/nova-api/v1"
3
6
  import React, { useEffect, useRef } from "react"
4
7
  import type { Group, Object3D } from "three"
5
8
  import { useAutorun } from "../utils/hooks"
@@ -7,7 +10,7 @@ import { ValueInterpolator } from "../utils/interpolation"
7
10
  import { collectJoints } from "./robotModelLogic"
8
11
 
9
12
  type RobotAnimatorProps = {
10
- rapidlyChangingMotionState: MotionGroupState
13
+ rapidlyChangingMotionState: MotionGroupStateResponse
11
14
  dhParameters: DHParameter[]
12
15
  onRotationChanged?: (joints: Object3D[], jointValues: number[]) => void
13
16
  children: React.ReactNode
@@ -26,9 +29,10 @@ export default function RobotAnimator({
26
29
 
27
30
  // Initialize interpolator
28
31
  useEffect(() => {
29
- const initialJointValues = rapidlyChangingMotionState.joint_position.filter(
30
- (item) => item !== undefined,
31
- )
32
+ const initialJointValues =
33
+ rapidlyChangingMotionState.state.joint_position.joints.filter(
34
+ (item) => item !== undefined,
35
+ )
32
36
 
33
37
  interpolatorRef.current = new ValueInterpolator(initialJointValues, {
34
38
  tension: 120, // Controls spring stiffness - higher values create faster, more responsive motion
@@ -87,9 +91,10 @@ export default function RobotAnimator({
87
91
  }
88
92
 
89
93
  useAutorun(() => {
90
- const newJointValues = rapidlyChangingMotionState.joint_position.filter(
91
- (item) => item !== undefined,
92
- )
94
+ const newJointValues =
95
+ rapidlyChangingMotionState.state.joint_position.joints.filter(
96
+ (item) => item !== undefined,
97
+ )
93
98
 
94
99
  requestAnimationFrame(() => updateJoints(newJointValues))
95
100
  })