@wandelbots/wandelbots-js-react-components 6.4.0-pr.revamp.667.58dae5c → 6.4.0-pr.revamp.667.59de050

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 (92) hide show
  1. package/README.md +176 -33
  2. package/dist/3d.cjs +1 -1
  3. package/dist/3d.d.ts +2 -3
  4. package/dist/3d.js +34 -37
  5. package/dist/CurrentPose/index.js +1 -1
  6. package/dist/CurrentPoseBar/index.js +1 -1
  7. package/dist/RobotControl/index.cjs +1 -1
  8. package/dist/RobotControl/index.js +1 -1
  9. package/dist/RobotControlPanel/index.cjs +1 -1
  10. package/dist/RobotControlPanel/index.js +1 -1
  11. package/dist/RobotHeader/index.cjs +1 -1
  12. package/dist/RobotHeader/index.js +1 -1
  13. package/dist/RobotScene/index.cjs +1 -1
  14. package/dist/RobotScene/index.js +3 -3
  15. package/dist/RobotView/index.cjs +1 -1
  16. package/dist/RobotView/index.js +1 -1
  17. package/dist/chunks/ConnectedMotionGroup-CQ4W__Ch.cjs +3 -0
  18. package/dist/chunks/{ConnectedMotionGroup-B8GUihu0.js → ConnectedMotionGroup-CgPNxKbs.js} +2 -2
  19. package/dist/chunks/{CurrentPose-N5MWQHi8.js → CurrentPose-jTdJrjYe.js} +1 -1
  20. package/dist/chunks/{CurrentPoseBar-DGW1vpUW.js → CurrentPoseBar--HkZBGnN.js} +10 -10
  21. package/dist/chunks/Pose3-BfBNPRDM.cjs +1 -0
  22. package/dist/chunks/{Pose3-B_fLR-Wv.js → Pose3-DWxfC6Dj.js} +1 -2
  23. package/dist/chunks/{Robot-DIJbjjSt.cjs → Robot-229TG9wF.cjs} +1 -1
  24. package/dist/chunks/{Robot-DBZdSKsG.js → Robot-DGa4V_4u.js} +5 -5
  25. package/dist/chunks/RobotActivation-CRVxXvlx.cjs +1 -0
  26. package/dist/chunks/{RobotActivation-D5SPSBED.js → RobotActivation-oR-8Y0iq.js} +47 -34
  27. package/dist/chunks/RobotControl-5YZQVCM4.js +332 -0
  28. package/dist/chunks/RobotControl-Cf1TMWXG.cjs +1 -0
  29. package/dist/chunks/RobotControlPanel-B7NxoHsO.cjs +1 -0
  30. package/dist/chunks/RobotControlPanel-CkQlkq8x.js +1029 -0
  31. package/dist/chunks/RobotScene-BnhM3iuc.cjs +1 -0
  32. package/dist/chunks/RobotScene-CHQcpJG-.js +1276 -0
  33. package/dist/chunks/{RobotView-BemOONOj.cjs → RobotView-C1_PW7jD.cjs} +1 -1
  34. package/dist/chunks/{RobotView-CfOUuvEc.js → RobotView-DdjUVCYj.js} +1 -1
  35. package/dist/chunks/{useSmoothedMotionState-BSSV8aZN.js → hooks-BWoeBWLV.js} +43 -87
  36. package/dist/chunks/hooks-BXe2bNMo.cjs +1 -0
  37. package/dist/chunks/{loadRobotSession-DWixPw7W.js → loadRobotSession-CtCpA65z.js} +871 -624
  38. package/dist/chunks/loadRobotSession-GOa6wyyF.cjs +1 -0
  39. package/dist/chunks/{poseText-CX7mvWIB.js → poseText-BxG4Caa-.js} +4 -4
  40. package/dist/chunks/{robotActivationOf-BsFcsAdF.cjs → robotActivationOf-CvylCSYs.cjs} +1 -1
  41. package/dist/chunks/{robotActivationOf-CY-F1A3W.js → robotActivationOf-GTYfLNrW.js} +1 -1
  42. package/dist/chunks/useSmoothedMotionState-CCXmMZ0S.cjs +1 -0
  43. package/dist/chunks/useSmoothedMotionState-CELh-YJa.js +50 -0
  44. package/dist/components/VelocitySlider.d.ts +14 -1
  45. package/dist/components/connectionWarning/ConnectionWarning.d.ts +1 -1
  46. package/dist/components/connectionWarning/connectionWarningOf.d.ts +8 -1
  47. package/dist/components/jogging/JoggingCartesianAxisControl.d.ts +7 -1
  48. package/dist/components/jogging/JoggingCartesianTab.d.ts +6 -0
  49. package/dist/components/jogging/JoggingJointTab.d.ts +5 -0
  50. package/dist/components/jogging/JoggingJointValueControl.d.ts +7 -1
  51. package/dist/components/jogging/JoggingPanel.d.ts +11 -0
  52. package/dist/components/jogging/JoggingStore.d.ts +155 -11
  53. package/dist/components/jogging/joggingColors.d.ts +6 -0
  54. package/dist/components/robotControl/MoveToTab.d.ts +6 -1
  55. package/dist/components/robotControl/RobotControlPanel.d.ts +15 -8
  56. package/dist/components/robotHeader/robotActivationOf.d.ts +5 -0
  57. package/dist/components/robotHeader/robotSafetyOf.d.ts +8 -1
  58. package/dist/components/robots/MotionGroupVisualizer.d.ts +6 -4
  59. package/dist/components/robots/SupportedLinearAxis.d.ts +6 -4
  60. package/dist/components/robots/SupportedRobot.d.ts +7 -5
  61. package/dist/components/robots/useFrameSmoothedMotionState.d.ts +25 -0
  62. package/dist/components/utils/useSmoothedMotionState.d.ts +11 -2
  63. package/dist/core.cjs +1 -1
  64. package/dist/core.d.ts +5 -5
  65. package/dist/core.js +63 -69
  66. package/dist/index.cjs +1 -1
  67. package/dist/index.js +100 -110
  68. package/dist/lib/ConnectedMotionGroup.d.ts +11 -0
  69. package/dist/lib/ControllerStateStream.d.ts +9 -9
  70. package/dist/lib/JoggerConnection.d.ts +17 -1
  71. package/dist/lib/MotionStreamConnection.d.ts +3 -2
  72. package/dist/lib/TrajectoryExecutionStore.d.ts +41 -12
  73. package/dist/lib/controllerStateSource.d.ts +6 -5
  74. package/dist/lib/robotSession/RobotActivation.d.ts +16 -18
  75. package/dist/lib/robotSession/RobotSession.d.ts +20 -7
  76. package/dist/lib/robotSession/RobotTargetPose.d.ts +4 -2
  77. package/dist/lib/robotSession/loadRobotSession.d.ts +1 -1
  78. package/dist/session.cjs +1 -1
  79. package/dist/session.d.ts +5 -5
  80. package/dist/session.js +26 -33
  81. package/package.json +22 -1
  82. package/dist/chunks/ConnectedMotionGroup-Df8Igvna.cjs +0 -3
  83. package/dist/chunks/Pose3-Ch4xVeXV.cjs +0 -1
  84. package/dist/chunks/RobotActivation-BaPImZRq.cjs +0 -1
  85. package/dist/chunks/RobotControl-BdJ7RAAo.js +0 -318
  86. package/dist/chunks/RobotControl-CscCNoSM.cjs +0 -1
  87. package/dist/chunks/RobotControlPanel-BJ80O4ER.cjs +0 -1
  88. package/dist/chunks/RobotControlPanel-D5ke3Ntx.js +0 -1019
  89. package/dist/chunks/RobotScene-DWFKwcNM.js +0 -1255
  90. package/dist/chunks/RobotScene-Dc7UpxxA.cjs +0 -1
  91. package/dist/chunks/loadRobotSession-qoLKP8Hu.cjs +0 -1
  92. package/dist/chunks/useSmoothedMotionState-B9WO73k0.cjs +0 -1
package/README.md CHANGED
@@ -17,11 +17,13 @@ pnpm add @wandelbots/wandelbots-js-react-components \
17
17
  @wandelbots/mui mobx mobx-react-lite
18
18
  ```
19
19
 
20
+ An app without the library's UI, which takes only `/session`, installs the library and `mobx` (see [Peer dependencies](#peer-dependencies)).
21
+
20
22
  The 3D parts need three.js and React Three Fiber in addition. `/core` has the parts without 3D:
21
23
 
22
24
  ```typescript
23
25
  import {
24
- JoggingPanel,
26
+ JoggingButtons,
25
27
  SafetyBar,
26
28
  } from "@wandelbots/wandelbots-js-react-components/core"
27
29
  ```
@@ -68,15 +70,23 @@ Browse the full icon set at https://wandelbotsgmbh.github.io/nova-design-system/
68
70
  **Available Entry Points:**
69
71
 
70
72
  - **`.`** (Main) — All components. Requires the peer dependencies of `/core` and `/3d`.
71
- - **`/core`** — The parts without 3D (jogging, `SafetyBar`, `AppHeader`, `LoadingCover`, `NoMotionGroupModal`), the NOVA connections and `JoggingStore`, the motion state helpers and `i18n`. Draws nothing in 3D, but still needs three.js installed (see [Without three.js or without React](#without-threejs-or-without-react)).
72
- - **`/session`** — The library without React: a robot of a NOVA cell, loaded and connected (`loadRobotSession`, `RobotSession` with its description, live state, safety, activation, jogging and Move to), `JoggingStore`, `TrajectoryExecutionStore`, the NOVA connections (`ControllerStateStream`, `JoggerConnection`, `MotionStreamConnection`), the pose math and the motion state helpers. Loads no React, no MUI and no three.js. `/core` exports all of it as well.
73
+ - **`/core`** — The parts without 3D (jogging, `RobotHeader`, `CurrentPose`, `SafetyBar`, `AppHeader`, `LoadingCover`, `NoMotionGroupModal`), `RobotSessionProvider`, everything of `/session` (the robot session, `JoggingStore`, the NOVA connections, the motion state helpers), the deprecated `ConnectedMotionGroup` and `i18n`. Draws nothing in 3D, but still needs three.js installed (see [Without three.js or without React](#without-threejs-or-without-react)).
74
+ - **`/session`** — The library without React: a robot of a NOVA cell, loaded and connected (`loadRobotSession`, `RobotSession` with its description, live state, safety, activation, jogging and Move to), `JoggingStore`, the NOVA connections (`JoggerConnection`, `MotionStreamConnection`), the pose math and the motion state helpers. Loads no React, no MUI and no three.js. `/core` exports all of it as well.
73
75
  - **`/3d`** — The 3D parts (`Robot`, `MotionGroupVisualizer`, `SafetyZonesRenderer`, …). Requires in addition three, three-stdlib, @react-three/fiber and @react-three/drei.
74
- - **`/nats`** — A robot's live controller state over NOVA's NATS server (`natsControllerStateSource`, `natsUrlOf`), a source for `ControllerStateStream` of `/core` instead of its websocket (`controllerStateWebsocket`). Requires in addition nats.ws; no other entry point loads it.
75
- - **`/SafetyBar`** — Only `SafetyBar` (also as the default export).
76
+ - **`/nats`** — A robot's live controller state over NOVA's NATS server (`natsControllerStateSource`, `natsUrlOf`): the `stateSource` of `loadRobotSession` instead of NOVA's websocket. Requires in addition nats.ws; no other entry point loads it.
77
+ - **`/SafetyBar`** — Only `SafetyBar` (also as the default export), and `robotSafetyOf` for a robot session.
76
78
  - **`/JoggingGizmo`** — Only `JoggingGizmo` (also as the default export) and `JoggingGizmoOrientation`. Requires in addition three and @react-three/fiber.
77
79
  - **`/JoggingButtons`** — Only `JoggingButtons` (also as the default export). No 3D packages needed.
78
80
  - **`/JoggingJointSlider`** — Only `JoggingJointSlider` (also as the default export). No 3D packages needed.
79
81
  - **`/RobotControlPanel`** — The whole Robot control panel, `RobotControlPanel` (also as the default export). It shows the jog gizmo, so it requires in addition three and @react-three/fiber, as `/JoggingGizmo` does.
82
+ - **`/RobotControl`** — `RobotControl` (also as the default export), the Robot control panel of a robot session, and `useRobotControlProps`. Requires in addition three and @react-three/fiber, as `/RobotControlPanel` does.
83
+ - **`/RobotView`** — `RobotView` (also as the default export), the 3D view of a robot session, and `RobotCanvas`. Requires in addition three, three-stdlib, @react-three/fiber and @react-three/drei.
84
+ - **`/RobotScene`** — `RobotScene` (also as the default export), the 3D scene of a robot session for the app's own `<Canvas>`, `RobotSceneView`, `useRobotSceneProps` and `JoggingAxes`. Requires in addition three, three-stdlib, @react-three/fiber and @react-three/drei.
85
+ - **`/CurrentPose`** — `CurrentPose` (also as the default export), the current pose bar of a robot session, and `useCurrentPoseProps`. No 3D packages needed.
86
+ - **`/CurrentPoseBar`** — Only `CurrentPoseBar` (also as the default export). No 3D packages needed.
87
+ - **`/RobotHeader`** — `RobotHeader` (also as the default export), `robotSafetyOf`, `robotActivationOf`, `ConnectionWarning` and `connectionWarningOf`. No 3D packages needed.
88
+
89
+ The entry points of a robot session's parts (`/RobotControl`, `/RobotView`, `/RobotScene`, `/CurrentPose`) also export `RobotSessionProvider` and `useRobotSession`.
80
90
 
81
91
  A component's own entry point brings only what that component needs, e.g. `/JoggingButtons` no three.js and no NOVA client, unlike `/core`. The entry points share their common code, so an app that imports a component from both `/core` and its own entry point gets one copy of it:
82
92
 
@@ -88,32 +98,49 @@ import JoggingJointSlider from "@wandelbots/wandelbots-js-react-components/Joggi
88
98
 
89
99
  - **An app without a 3D view** needs no three.js. It takes the robot from `/session` and its parts from the component entry points that draw nothing in 3D: `/RobotHeader`, `/CurrentPose`, `/CurrentPoseBar`, `/SafetyBar`, `/JoggingButtons` and `/JoggingJointSlider`.
90
100
  - **`/core` needs three.js installed**, although it draws nothing in 3D: the deprecated `ConnectedMotionGroup` that it exports gives a three.js quaternion (`mountingQuaternion`). That ends when `ConnectedMotionGroup` is removed.
91
- - **An app without React**, or with a UI of its own, uses `/session` alone (and `/nats`). Of the peer dependencies it loads only `mobx`:
101
+ - **An app without React**, or with a UI of its own, uses `/session` alone (and `/nats`). Of the peer dependencies it needs only `mobx` (see [Peer dependencies](#peer-dependencies)). The parts of a session are MobX stores: such an app follows them with `autorun` or `reaction` of MobX. What it calls returns a promise that rejects when it fails (a jog that may not start rejects with a `JoggingRefusedError`); what fails in the background goes to `onError`. `load.dispose()` closes the session's connections.
92
102
 
93
103
  ```typescript
104
+ import { autorun } from "mobx"
94
105
  import { loadRobotSession } from "@wandelbots/wandelbots-js-react-components/session"
95
106
 
96
- const load = loadRobotSession("https://my-instance.wandelbots.io", "0@ur5e")
107
+ const load = loadRobotSession("https://my-instance.wandelbots.io", "0@ur5e", {
108
+ onError: (error) => console.warn(error.kind, error.message),
109
+ })
110
+ // Rejects when the load fails; load.retry() loads again
97
111
  const session = await load.ready
98
- console.log(session.state.displayedTcpPose)
112
+
113
+ const stopFollowing = autorun(() => {
114
+ console.log(session.safety.canBeMoved, session.state.displayedTcpPose)
115
+ })
116
+
117
+ // Jog along X while a key of the app's own UI is held
118
+ await session.activation.activate()
119
+ await session.jogging.startCartesianJogging("translate", "x", "+")
120
+ // … and when it is let go
121
+ await session.jogging.stopJogging()
122
+
123
+ stopFollowing()
99
124
  load.dispose()
100
125
  ```
101
126
 
102
127
  ### Peer dependencies
103
128
 
104
- | Package | Version |
105
- | --- | --- |
106
- | `react`, `react-dom` | ^19 |
107
- | `@mui/material`, `@mui/icons-material` | ^7 |
108
- | `@emotion/react`, `@emotion/styled` | ^11 |
109
- | `@wandelbots/mui` | ^2 |
110
- | `mobx` | ^6.13.6 |
111
- | `mobx-react-lite` | ^4.1.0 |
112
- | `three` (only `/3d`, `/JoggingGizmo`, `/RobotControlPanel`, and `/core` until `ConnectedMotionGroup` is removed) | >=0.182 |
113
- | `three-stdlib` (only `/3d`) | >=2 |
114
- | `@react-three/fiber` (only `/3d`, `/JoggingGizmo`, `/RobotControlPanel`) | ^9 |
115
- | `@react-three/drei` (only `/3d`) | ^10 |
116
- | `nats.ws` (only `/nats`) | ^1.30.3 |
129
+ | Package | Version | Needed by |
130
+ | --- | --- | --- |
131
+ | `mobx` | ^6.13.6 | Every entry point |
132
+ | `react`, `react-dom` | ^19 | Every entry point with UI: all but `/session` and `/nats` |
133
+ | `@mui/material`, `@mui/icons-material` | ^7 | Every entry point with UI |
134
+ | `@emotion/react`, `@emotion/styled` | ^11 | Every entry point with UI |
135
+ | `@wandelbots/mui` | ^2 | Every entry point with UI |
136
+ | `mobx-react-lite` | ^4.1.0 | Every entry point with UI |
137
+ | `three` | >=0.182 | `.`, `/3d`, `/JoggingGizmo`, `/RobotControlPanel`, `/RobotControl`, `/RobotScene`, `/RobotView`, and `/core` until `ConnectedMotionGroup` is removed |
138
+ | `@react-three/fiber` | ^9 | `.`, `/3d`, `/JoggingGizmo`, `/RobotControlPanel`, `/RobotControl`, `/RobotScene`, `/RobotView` |
139
+ | `three-stdlib` | >=2 | `.`, `/3d`, `/RobotScene`, `/RobotView` |
140
+ | `@react-three/drei` | ^10 | `.`, `/3d`, `/RobotScene`, `/RobotView` |
141
+ | `nats.ws` | ^1.30.3 | `/nats` |
142
+
143
+ Only `mobx` is a required peer. The others are optional in `package.json`, so an app installs those of the entry points it imports: an app that takes only `/session` (and `/nats`) installs `mobx` (and `nats.ws`), and no React, MUI or three.js. Three of the library's own dependencies (`react-i18next`, `react-error-boundary` and `@wandelbots/icons`) name `react` as their peer, so a package manager may still warn about React, or install it, for such an app; `/session` does not load it.
117
144
 
118
145
  These packages are peer dependencies because the app and the library must use the same copy: React, the MUI theme of the app, the MobX stores that the app reads with its own `observer`, and the `<Canvas>` of React Three Fiber.
119
146
 
@@ -198,6 +225,40 @@ What changes besides the names:
198
225
  | `dispose()` | `load.dispose()`, or `session.dispose()` |
199
226
  | `<Robot connectedMotionGroup={…}>`, `<LinearAxis connectedMotionGroup={…}>` | `<Robot motionGroup={robotModelOf(session)}>`, the same for `LinearAxis`. `motionGroup` also takes a `ConnectedMotionGroup`, or the app's own data (see `RobotModelSource`). |
200
227
 
228
+ ### From JoggingPanel to RobotControl
229
+
230
+ `JoggingPanel` and the older parts it is built from (`JoggingCartesianAxisControl`, `JoggingJointValueControl`, `VelocitySlider`, which reads a `JoggingStore`, and `VelocitySliderLabel`) are deprecated. They keep working until a later major version removes them. `RobotControl` replaces the panel: the Robot control panel of the design (Translate, Rotate, Joint and Move to) for a [robot session](#from-connectedmotiongroup-to-robotsession).
231
+
232
+ ```tsx
233
+ // Before
234
+ <JoggingPanel nova={nova} motionGroupId="0@ur5e" cellId={cellId} locked={programRuns} />
235
+
236
+ // After
237
+ const load = loadRobotSession(nova, "0@ur5e", { cellId, storage: localStorage })
238
+ const session = await load.ready
239
+ <RobotControl session={session} disabled={programRuns} />
240
+ ```
241
+
242
+ | `JoggingPanel` | Instead |
243
+ | --- | --- |
244
+ | `nova`, `motionGroupId`, `cellId` | `loadRobotSession(nova, motionGroupId, { cellId })`; its session goes to `session`, or comes from a `RobotSessionProvider` |
245
+ | `locked` | `disabled` |
246
+ | `onSetup(store)`, `store` | `session.jogging`, the session's `JoggingStore`. It lives as long as the session, also while the panel is hidden. |
247
+ | The jogging settings in `localStorage` | Only with `storage: localStorage` (or a storage of the app) for `loadRobotSession`; without it nothing is kept |
248
+ | `sx` | `sx` |
249
+ | `children` | No replacement: the app puts its own parts next to the panel, see [Placing the parts](#placing-the-parts) |
250
+ | The `show…` flags of `JoggingStore` (`showTcpSelect`, `showIncrementSelect`, …), its `tabs` and `onTabChange` | The props of `RobotControlPanel`: take `useRobotControlProps(session)` and leave out or replace a prop, e.g. `<RobotControlPanel {...props} increments={undefined} />` for no Increment mode |
251
+ | `JoggingCartesianAxisControl` | `JoggingButtons` (a minus and a plus button per axis), or `JoggingGizmo` |
252
+ | `JoggingJointValueControl` | `JoggingJointSlider` |
253
+ | `VelocitySlider`, `VelocitySliderLabel` | The velocity of `RobotControlPanel` |
254
+ | `JoggingStore.activate()` | `startCartesianJogging`, `startJointJogging` and `runIncrementalCartesianJog` of `JoggingStore` activate what they need; `session.ensureMovementOwnership("jogging")` hands the robot to jogging |
255
+
256
+ What changes besides the names:
257
+
258
+ - **Props in, callbacks out:** `RobotControlPanel`, `JoggingButtons`, `JoggingGizmo` and `JoggingJointSlider` take no store and move nothing themselves (`onJogStart`, `onJogStop`). `RobotControl` is `RobotControlPanel` with the props of `useRobotControlProps(session)`, which jogs the session's robot.
259
+ - **The gizmo** needs the camera of the app's 3D view: `gizmoOrientation`, written by a `JoggingGizmoOrientation` in the view. Without it the panel jogs with buttons.
260
+ - **Jogging is off** while the robot may not move (not activated, its safety, no live state), while a trajectory moves it or another client jogs it: `RobotControl` says why in the panel. `disabled` is only the app's own lock.
261
+
201
262
  ### 4.x Core Changes
202
263
 
203
264
  Robot data is now fetched from a running nova instance. This eliminates the need of shipping every react application with the robot data attached.
@@ -230,18 +291,9 @@ Breaking changes for each major version are documented in the [GitHub Releases](
230
291
 
231
292
  Manual robot control interfaces.
232
293
 
233
- **JoggingPanel** - Complete jogging interface with cartesian and joint controls
234
-
235
- - Dual-mode operation (Cartesian & Joint space)
236
- - Real-time velocity control
237
- - Multiple coordinate systems support (Robot base or Tool)
238
-
239
- **Individual Jogging Controls**
294
+ **JoggingPanel** (deprecated, see [From JoggingPanel to RobotControl](#from-joggingpanel-to-robotcontrol)) - The jogging panel of earlier versions, with cartesian and joint controls. The older parts it is built from are deprecated with it: **JoggingCartesianAxisControl** (use `JoggingButtons`), **JoggingJointValueControl** (use `JoggingJointSlider`), **VelocitySlider** and **VelocitySliderLabel** (use the velocity of `RobotControlPanel`).
240
295
 
241
- - **JoggingCartesianAxisControl** - Single-axis cartesian movement
242
- - **JoggingJointValueControl** - Individual joint controls
243
- - **VelocitySlider** (and **VelocitySliderLabel**) - Speed adjustment interface
244
- - **JoggingStore** - The state of the jogging (velocity, coordinate system, the jogging connection). `JoggingPanel` gives it to `onSetup`, and `JoggingStore.loadFor` creates one for your own controls. It also jogs for them: `startCartesianJogging(motion, axis, direction)` or `startJointJogging(joint, direction)` when a control is pressed and `stopJogging()` when it is let go, and `runIncrementalCartesianJog(motion, axis, direction, increment)` for one step. The store keeps the order that hold-to-jog needs: a press that ends before the jogging connection is ready moves nothing, and one step runs at a time. While the store is locked, or its owner says that the robot may not move (the option `notMoveableReason`, which a `RobotSession` gives its store), or after NOVA refused the jogging connection because another client jogs (`blocked`, until `unblock()`), it starts no jog: the start rejects with a `JoggingRefusedError`, whose `reason.code` says why. The same holds for everything else that opens the jogging connection, a TCP change (`requestTcpChange`) and `session.ensureMovementOwnership("jogging")`: NOVA switches a controller to control mode by itself for it. The store asks again once the connection is open, and closes it when the robot may no longer move by then.
296
+ **JoggingStore** - The state of the jogging (velocity, coordinate system, the jogging connection). A robot session has one (`session.jogging`), and `JoggingStore.loadFor` creates one for your own controls. It also jogs for them: `startCartesianJogging(motion, axis, direction)` or `startJointJogging(joint, direction)` when a control is pressed and `stopJogging()` when it is let go, and `runIncrementalCartesianJog(motion, axis, direction, increment)` for one step. The store keeps the order that hold-to-jog needs: a press that ends before the jogging connection is ready moves nothing, and one step runs at a time. While the store is locked, or its owner says that the robot may not move (the option `notMoveableReason`, which a `RobotSession` gives its store), or after NOVA refused the jogging connection because another client jogs (`blocked`, until `unblock()`), it starts no jog: the start rejects with a `JoggingRefusedError`, whose `reason.code` says why. The same holds for everything else that opens the jogging connection, a TCP change (`requestTcpChange`) and `session.ensureMovementOwnership("jogging")`: NOVA switches a controller to control mode by itself for it. The store asks again once the connection is open, and closes it when the robot may no longer move by then.
245
297
 
246
298
  **JoggingGizmo** and **JoggingGizmoOrientation** (from `/3d` or `/JoggingGizmo`) - Jogging by the axes of the jog frame as the camera of the 3D view sees them: orbit the view and the gizmo turns with it, so the arrow pointing right on screen moves the robot right on screen. Hold a handle to jog.
247
299
 
@@ -378,6 +430,97 @@ const orientation = useRef<Quaternion | null>(null)
378
430
  />
379
431
  ```
380
432
 
433
+ ### The parts of a robot session
434
+
435
+ `RobotControl`, `RobotView`, `RobotScene` and `CurrentPose` are connected components: a UI component, which takes props and reports through callbacks, with a hook that fills its props from a `RobotSession`. Both are exported, so an app can take the hook and replace single props, or give the UI component props of its own. A prop given to the connected component replaces the hook's: `<RobotControl increments={undefined} />` has no Increment mode.
436
+
437
+ | Connected component | UI component and hook |
438
+ | --- | --- |
439
+ | `RobotControl` | `RobotControlPanel` with `useRobotControlProps(session, { disabled, gizmoOrientation })` |
440
+ | `RobotScene` | `RobotSceneView` with `useRobotSceneProps(session)` |
441
+ | `RobotView` | `RobotScene` in a `RobotCanvas` |
442
+ | `CurrentPose` | `CurrentPoseBar` with `useCurrentPoseProps(session)` |
443
+
444
+ ```tsx
445
+ <RobotControlPanel {...useRobotControlProps(session)} increments={undefined} />
446
+ ```
447
+
448
+ **RobotSessionProvider** and **useRobotSession** - A connected component takes its robot from its `session` prop, else from the nearest `RobotSessionProvider`; without either it throws. `useRobotSession()` gives the app's own components that session. For several robots on a page, use one provider per robot, or a `session` prop on each component.
449
+
450
+ **RobotControl** (from `/3d` or `/RobotControl`) - The Robot control panel (see `RobotControlPanel` above) of a session: Translate and Rotate jog the TCP with the session's jogging store, Joint jogs the joints, and Move to plans the typed pose and moves along it while held. `disabled` is the app's lock; jogging is also off, with the reason in the panel, while the robot may not move. `gizmoOrientation` gives the gizmo the camera of the app's 3D view; without it, the panel jogs with buttons. Another session gets a new panel: what the panel held for the old robot ends.
451
+
452
+ **RobotView**, **RobotCanvas**, **RobotScene**, **RobotSceneView**, **useRobotSceneProps** and **JoggingAxes** (from `/3d`, `/RobotView` or `/RobotScene`) - The 3D view of a session:
453
+
454
+ - `RobotView` is the view, ready to use: `RobotScene` in a `RobotCanvas` whose camera orbits the robot's base. It fills its parent. Its children are the app's own parts of the scene, in NOVA's coordinates (Z up, metres), e.g. a `JoggingGizmoOrientation`.
455
+ - `RobotCanvas` is the canvas alone, prop-only: a floor grid and a camera that orbits `orbitTarget`. When the browser cannot draw 3D, it says so (and calls `onWebGLUnavailable`) instead of loading forever.
456
+ - `RobotScene` goes into the app's own `<Canvas>`, whose camera and controls are the app's: the robot at its mounting, the ghost of a planned motion's end, the safety zones, the axes that jogging moves along and the light. It draws in NOVA's coordinates; in a scene that is Y up, turn it: `<group rotation={[-Math.PI / 2, 0, 0]}>`. `RobotSceneView` is its UI component, `useRobotSceneProps(session)` its props.
457
+ - `JoggingAxes` is one part of that scene alone: the axes of a coordinate system and of the TCP, with those that jogging does not move along in grey.
458
+
459
+ **CurrentPose** (from `/core` or `/CurrentPose`) - The current pose bar of a session: the TCP's pose in a TCP and a coordinate system of the bar's own, the state of the motion stream and the last jog error. `CurrentPoseBar` is its UI component, `useCurrentPoseProps(session)` its props.
460
+
461
+ **RobotHeader**, **robotSafetyOf**, **robotActivationOf**, **ConnectionWarning** and **connectionWarningOf** (from `/core` or `/RobotHeader`) - The header of a robot app, as Figma's top bar: the app menu and the app's name, the motion group select, the `SafetyBar`, the activation switch and the app's own `actions`. It takes props only. `robotSafetyOf(session)` gives its `safety` (also the props of `SafetyBar`), `robotActivationOf(session)` its `activation` (a refused mode change goes to the session's `onError`), and `connectionWarningOf(session)` the props of `ConnectionWarning`, an icon that shows once the robot's live state stops arriving. They are plain functions, not hooks, so a header that shows while no robot is loaded passes `session ? robotSafetyOf(session) : undefined`. They read the session's MobX state when they are called and return plain props, so the component that calls them must be an `observer` of mobx-react-lite, as `AppBar` below: any other keeps what it read at its last render, e.g. no emergency stop after one was pressed.
462
+
463
+ #### Placing the parts
464
+
465
+ The library has no layout: an app puts `RobotHeader`, `RobotView`, `RobotControl` and `CurrentPose` where it wants, and each fills the box that the app gives it. The Layouts page of the playground (`playground/src/pages/LayoutsPage.tsx`) places them as the Figma design does: the header on top, the 3D view under it, the panel floating at the view's top right and the pose bar along its bottom.
466
+
467
+ ```tsx
468
+ import Box from "@mui/material/Box"
469
+ import Stack from "@mui/material/Stack"
470
+ import {
471
+ ConnectionWarning,
472
+ CurrentPose,
473
+ connectionWarningOf,
474
+ JoggingGizmoOrientation,
475
+ RobotControl,
476
+ RobotHeader,
477
+ type RobotSession,
478
+ RobotSessionProvider,
479
+ RobotView,
480
+ robotActivationOf,
481
+ robotSafetyOf,
482
+ } from "@wandelbots/wandelbots-js-react-components"
483
+ import { observer } from "mobx-react-lite"
484
+ import { useRef } from "react"
485
+ import type { Quaternion } from "three"
486
+
487
+ // An observer: the header follows the session's safety, mode and connection
488
+ const AppBar = observer(({ session }: { session: RobotSession }) => (
489
+ <RobotHeader
490
+ appName="My robot app"
491
+ safety={robotSafetyOf(session)}
492
+ activation={robotActivationOf(session)}
493
+ actions={<ConnectionWarning {...connectionWarningOf(session)} />}
494
+ />
495
+ ))
496
+
497
+ export function RobotApp({ session }: { session: RobotSession }) {
498
+ // The camera of the 3D view, for the panel's gizmo
499
+ const orientation = useRef<Quaternion | null>(null)
500
+
501
+ return (
502
+ <RobotSessionProvider session={session}>
503
+ <Stack sx={{ height: "100vh" }}>
504
+ <AppBar session={session} />
505
+ <Box sx={{ position: "relative", flex: 1, minHeight: 0 }}>
506
+ <Box sx={{ position: "absolute", inset: 0 }}>
507
+ <RobotView>
508
+ <JoggingGizmoOrientation target={orientation} />
509
+ </RobotView>
510
+ </Box>
511
+ <Box sx={{ position: "absolute", top: 12, right: 12, width: 444 }}>
512
+ <RobotControl gizmoOrientation={orientation} />
513
+ </Box>
514
+ <Box sx={{ position: "absolute", left: 12, right: 12, bottom: 12 }}>
515
+ <CurrentPose />
516
+ </Box>
517
+ </Box>
518
+ </Stack>
519
+ </RobotSessionProvider>
520
+ )
521
+ }
522
+ ```
523
+
381
524
  ### 3D Visualization & Robotics
382
525
 
383
526
  3D components for robot visualization. They render inside the `<Canvas>` of React Three Fiber.
@@ -426,7 +569,7 @@ Safety components for production environments.
426
569
 
427
570
  ### Logic
428
571
 
429
- - **loadRobotSession** and **RobotSession** - A robot of a cell, loaded and connected: its description, live state, safety, activation, jogging and Move to
572
+ - **loadRobotSession** and **RobotSession** - A robot of a cell, loaded and connected: its description, live state, safety, activation, jogging and Move to. In a React app, its UI is [the parts of a robot session](#the-parts-of-a-robot-session); without React, see [Without three.js or without React](#without-threejs-or-without-react).
430
573
  - **TrajectoryExecutionStore** (`session.trajectory`) and **RobotTargetPose** (`session.targetPose`) - Move to without a UI. `planTrajectory(target)` plans a trajectory and loads it; `hold(target)` moves along it while a button is held and `release()` stops the robot, whatever the order of NOVA's messages, and both are safe to repeat. `hold` starts nothing along a trajectory that was planned for another target, or with another velocity than the jogging store has now (`isPlanOutdated`: plan it again). `targetPose.plan(pose)`, `holdMove(pose)` and `releaseMove()` do the same for the typed pose that the Robot control shows, which also keeps why its plan or its move failed (`staged.errorKey`, `staged.errorMessage`)
431
574
  - **ConnectedMotionGroup** (deprecated, see [From ConnectedMotionGroup to RobotSession](#from-connectedmotiongroup-to-robotsession)) - A motion group with its live motion state, safety state and operation mode
432
575
  - **MotionStreamConnection** and **JoggerConnection** - The motion state stream and the jogging connection of a motion group
package/dist/3d.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/Robot-DIJbjjSt.cjs"),o=require("./chunks/RobotScene-Dc7UpxxA.cjs"),a=require("./chunks/JoggingGizmo-CNFjpWDv.cjs"),s=require("./chunks/JoggingGizmoOrientation-laUrgY0N.cjs"),u=require("./chunks/RobotControlPanel-BJ80O4ER.cjs"),r=require("./chunks/RobotControl-CscCNoSM.cjs"),n=require("./chunks/RobotView-BemOONOj.cjs"),i=require("./chunks/useSmoothedMotionState-B9WO73k0.cjs"),t=require("./chunks/Pose3-Ch4xVeXV.cjs");exports.CollisionSceneRenderer=e.CollisionSceneRenderer;exports.JointLimitGizmo=e.JointLimitGizmo;exports.LinearAxis=e.LinearAxis;exports.Robot=e.Robot;exports.TrajectoryRenderer=e.TrajectoryRenderer;exports.FLANGE_NODE_SUFFIX=o.FLANGE_NODE_SUFFIX;exports.JOINT_NODE_NAME=o.JOINT_NODE_NAME;exports.JOINT_REST_SUFFIX=o.JOINT_REST_SUFFIX;exports.JoggingAxes=o.JoggingAxes;exports.MODEL_ROTATION=o.MODEL_ROTATION;exports.MotionGroupVisualizer=o.MotionGroupVisualizer;exports.MotionGroupVisualizerExact=o.MotionGroupVisualizerExact;exports.PresetEnvironment=o.PresetEnvironment;exports.RobotScene=o.RobotScene;exports.RobotSceneView=o.RobotSceneView;exports.SafetyZonesRenderer=o.SafetyZonesRenderer;exports.SupportedLinearAxis=o.SupportedLinearAxis;exports.SupportedLinearAxisExact=o.SupportedLinearAxisExact;exports.SupportedRobot=o.SupportedRobot;exports.SupportedRobotExact=o.SupportedRobotExact;exports.defaultGetModel=o.defaultGetModel;exports.jointIndexOf=o.jointIndexOf;exports.revokeAllModelUrls=o.revokeAllModelUrls;exports.robotModelOf=o.robotModelOf;exports.useRobotSceneProps=o.useRobotSceneProps;exports.JoggingGizmo=a.JoggingGizmo;exports.JoggingGizmoOrientation=s.JoggingGizmoOrientation;exports.RobotControlPanel=u.RobotControlPanel;exports.RobotControl=r.RobotControl;exports.useRobotControlProps=r.useRobotControlProps;exports.RobotCanvas=n.RobotCanvas;exports.RobotView=n.RobotView;exports.ValueInterpolator=i.ValueInterpolator;exports.useSmoothedMotionState=i.useSmoothedMotionState;exports.Pose3=t.Pose3;exports.parseRotationToQuaternion=t.parseRotationToQuaternion;exports.quaternionToRotationVector=t.quaternionToRotationVector;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/Robot-229TG9wF.cjs"),o=require("./chunks/RobotScene-BnhM3iuc.cjs"),i=require("./chunks/JoggingGizmo-CNFjpWDv.cjs"),s=require("./chunks/JoggingGizmoOrientation-laUrgY0N.cjs"),a=require("./chunks/RobotControlPanel-B7NxoHsO.cjs"),t=require("./chunks/RobotControl-Cf1TMWXG.cjs"),n=require("./chunks/RobotView-C1_PW7jD.cjs"),u=require("./chunks/hooks-BXe2bNMo.cjs"),R=require("./chunks/useSmoothedMotionState-CCXmMZ0S.cjs"),r=require("./chunks/Pose3-BfBNPRDM.cjs");exports.CollisionSceneRenderer=e.CollisionSceneRenderer;exports.JointLimitGizmo=e.JointLimitGizmo;exports.LinearAxis=e.LinearAxis;exports.Robot=e.Robot;exports.TrajectoryRenderer=e.TrajectoryRenderer;exports.FLANGE_NODE_SUFFIX=o.FLANGE_NODE_SUFFIX;exports.JOINT_REST_SUFFIX=o.JOINT_REST_SUFFIX;exports.JoggingAxes=o.JoggingAxes;exports.MotionGroupVisualizer=o.MotionGroupVisualizer;exports.MotionGroupVisualizerExact=o.MotionGroupVisualizerExact;exports.PresetEnvironment=o.PresetEnvironment;exports.RobotScene=o.RobotScene;exports.RobotSceneView=o.RobotSceneView;exports.SafetyZonesRenderer=o.SafetyZonesRenderer;exports.SupportedLinearAxis=o.SupportedLinearAxis;exports.SupportedLinearAxisExact=o.SupportedLinearAxisExact;exports.SupportedRobot=o.SupportedRobot;exports.SupportedRobotExact=o.SupportedRobotExact;exports.defaultGetModel=o.defaultGetModel;exports.jointIndexOf=o.jointIndexOf;exports.robotModelOf=o.robotModelOf;exports.useRobotSceneProps=o.useRobotSceneProps;exports.JoggingGizmo=i.JoggingGizmo;exports.JoggingGizmoOrientation=s.JoggingGizmoOrientation;exports.RobotControlPanel=a.RobotControlPanel;exports.RobotControl=t.RobotControl;exports.useRobotControlProps=t.useRobotControlProps;exports.RobotCanvas=n.RobotCanvas;exports.RobotView=n.RobotView;exports.ValueInterpolator=u.ValueInterpolator;exports.useSmoothedMotionState=R.useSmoothedMotionState;exports.Pose3=r.Pose3;exports.parseRotationToQuaternion=r.parseRotationToQuaternion;
package/dist/3d.d.ts CHANGED
@@ -20,12 +20,11 @@ export type { WebGLUnavailableContext } from "./components/utils/useWebGLRendere
20
20
  export * from "./components/robots/LinearAxis";
21
21
  export * from "./components/robots/MotionGroupVisualizer";
22
22
  export * from "./components/robots/Robot";
23
- export { MODEL_ROTATION } from "./components/robots/modelRotation";
24
- export { defaultGetModel, FLANGE_NODE_SUFFIX, JOINT_NODE_NAME, JOINT_REST_SUFFIX, jointIndexOf, revokeAllModelUrls, } from "./components/robots/robotModelLogic";
23
+ export { defaultGetModel, FLANGE_NODE_SUFFIX, JOINT_REST_SUFFIX, jointIndexOf, } from "./components/robots/robotModelLogic";
25
24
  export { type RobotModelSource, robotModelOf, } from "./components/robots/robotModelSource";
26
25
  export * from "./components/robots/SupportedLinearAxis";
27
26
  export * from "./components/robots/SupportedRobot";
28
27
  export { ValueInterpolator, type InterpolationOptions, } from "./components/utils/interpolation";
29
28
  export * from "./components/utils/useSmoothedMotionState";
30
29
  export { Pose3 } from "./lib/Pose3";
31
- export { parseRotationToQuaternion, quaternionToRotationVector, } from "./lib/rotation";
30
+ export { parseRotationToQuaternion } from "./lib/rotation";
package/dist/3d.js CHANGED
@@ -1,48 +1,45 @@
1
- import { C as a, J as t, L as r, R as s, T as n } from "./chunks/Robot-DBZdSKsG.js";
2
- import { F as p, J as R, a as l, b as u, M as x, c as m, d as S, P as d, R as f, e as b, S as c, f as g, g as E, h as J, i as O, j as M, k as T, r as A, l as G, u as I } from "./chunks/RobotScene-DWFKwcNM.js";
3
- import { J as N } from "./chunks/JoggingGizmo-RDiEVQes.js";
1
+ import { C as a, J as t, L as r, R as s, T as n } from "./chunks/Robot-DGa4V_4u.js";
2
+ import { F as p, J as R, a as x, M as u, b as m, P as f, R as S, c as b, S as d, d as l, e as g, f as c, g as J, h as E, j as G, r as P, u as C } from "./chunks/RobotScene-CHQcpJG-.js";
3
+ import { J as L } from "./chunks/JoggingGizmo-RDiEVQes.js";
4
4
  import { J as V } from "./chunks/JoggingGizmoOrientation-Dzzz2gEz.js";
5
- import { R as C } from "./chunks/RobotControlPanel-D5ke3Ntx.js";
6
- import { R as z, u as j } from "./chunks/RobotControl-BdJ7RAAo.js";
7
- import { R as D, a as U } from "./chunks/RobotView-CfOUuvEc.js";
8
- import { V as k, a as q } from "./chunks/useSmoothedMotionState-BSSV8aZN.js";
9
- import { P as y, p as X, q as Q } from "./chunks/Pose3-B_fLR-Wv.js";
5
+ import { R as A } from "./chunks/RobotControlPanel-CkQlkq8x.js";
6
+ import { R as O, u as T } from "./chunks/RobotControl-5YZQVCM4.js";
7
+ import { R as j, a as N } from "./chunks/RobotView-DdjUVCYj.js";
8
+ import { V as v } from "./chunks/hooks-BWoeBWLV.js";
9
+ import { u as y } from "./chunks/useSmoothedMotionState-CELh-YJa.js";
10
+ import { P as X, p as D } from "./chunks/Pose3-DWxfC6Dj.js";
10
11
  export {
11
12
  a as CollisionSceneRenderer,
12
13
  p as FLANGE_NODE_SUFFIX,
13
- R as JOINT_NODE_NAME,
14
- l as JOINT_REST_SUFFIX,
15
- u as JoggingAxes,
16
- N as JoggingGizmo,
14
+ R as JOINT_REST_SUFFIX,
15
+ x as JoggingAxes,
16
+ L as JoggingGizmo,
17
17
  V as JoggingGizmoOrientation,
18
18
  t as JointLimitGizmo,
19
19
  r as LinearAxis,
20
- x as MODEL_ROTATION,
21
- m as MotionGroupVisualizer,
22
- S as MotionGroupVisualizerExact,
23
- y as Pose3,
24
- d as PresetEnvironment,
20
+ u as MotionGroupVisualizer,
21
+ m as MotionGroupVisualizerExact,
22
+ X as Pose3,
23
+ f as PresetEnvironment,
25
24
  s as Robot,
26
- D as RobotCanvas,
27
- z as RobotControl,
28
- C as RobotControlPanel,
29
- f as RobotScene,
25
+ j as RobotCanvas,
26
+ O as RobotControl,
27
+ A as RobotControlPanel,
28
+ S as RobotScene,
30
29
  b as RobotSceneView,
31
- U as RobotView,
32
- c as SafetyZonesRenderer,
33
- g as SupportedLinearAxis,
34
- E as SupportedLinearAxisExact,
35
- J as SupportedRobot,
36
- O as SupportedRobotExact,
30
+ N as RobotView,
31
+ d as SafetyZonesRenderer,
32
+ l as SupportedLinearAxis,
33
+ g as SupportedLinearAxisExact,
34
+ c as SupportedRobot,
35
+ J as SupportedRobotExact,
37
36
  n as TrajectoryRenderer,
38
- k as ValueInterpolator,
39
- M as defaultGetModel,
40
- T as jointIndexOf,
41
- X as parseRotationToQuaternion,
42
- Q as quaternionToRotationVector,
43
- A as revokeAllModelUrls,
44
- G as robotModelOf,
45
- j as useRobotControlProps,
46
- I as useRobotSceneProps,
47
- q as useSmoothedMotionState
37
+ v as ValueInterpolator,
38
+ E as defaultGetModel,
39
+ G as jointIndexOf,
40
+ D as parseRotationToQuaternion,
41
+ P as robotModelOf,
42
+ T as useRobotControlProps,
43
+ C as useRobotSceneProps,
44
+ y as useSmoothedMotionState
48
45
  };
@@ -1,4 +1,4 @@
1
- import { C as e, C as r, u as t } from "../chunks/CurrentPose-N5MWQHi8.js";
1
+ import { C as e, C as r, u as t } from "../chunks/CurrentPose-jTdJrjYe.js";
2
2
  import { R as a, u as n } from "../chunks/RobotSessionProvider-TVaKGzqa.js";
3
3
  export {
4
4
  e as CurrentPose,
@@ -1,4 +1,4 @@
1
- import { C as e, C as o } from "../chunks/CurrentPoseBar-DGW1vpUW.js";
1
+ import { C as e, C as o } from "../chunks/CurrentPoseBar--HkZBGnN.js";
2
2
  export {
3
3
  e as CurrentPoseBar,
4
4
  o as default
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../chunks/RobotControl-CscCNoSM.cjs"),e=require("../chunks/RobotSessionProvider--AekyPqD.cjs");exports.RobotControl=o.RobotControl;exports.default=o.RobotControl;exports.useRobotControlProps=o.useRobotControlProps;exports.RobotSessionProvider=e.RobotSessionProvider;exports.useRobotSession=e.useRobotSession;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../chunks/RobotControl-Cf1TMWXG.cjs"),e=require("../chunks/RobotSessionProvider--AekyPqD.cjs");exports.RobotControl=o.RobotControl;exports.default=o.RobotControl;exports.useRobotControlProps=o.useRobotControlProps;exports.RobotSessionProvider=e.RobotSessionProvider;exports.useRobotSession=e.useRobotSession;
@@ -1,4 +1,4 @@
1
- import { R as r, R as t, u as e } from "../chunks/RobotControl-BdJ7RAAo.js";
1
+ import { R as r, R as t, u as e } from "../chunks/RobotControl-5YZQVCM4.js";
2
2
  import { R as a, u } from "../chunks/RobotSessionProvider-TVaKGzqa.js";
3
3
  export {
4
4
  r as RobotControl,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../chunks/RobotControlPanel-BJ80O4ER.cjs");exports.RobotControlPanel=o.RobotControlPanel;exports.default=o.RobotControlPanel;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../chunks/RobotControlPanel-B7NxoHsO.cjs");exports.RobotControlPanel=o.RobotControlPanel;exports.default=o.RobotControlPanel;
@@ -1,4 +1,4 @@
1
- import { R as t, R as e } from "../chunks/RobotControlPanel-D5ke3Ntx.js";
1
+ import { R as t, R as e } from "../chunks/RobotControlPanel-CkQlkq8x.js";
2
2
  export {
3
3
  t as RobotControlPanel,
4
4
  e as default
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../chunks/robotActivationOf-BsFcsAdF.cjs"),t=require("../chunks/robotSafetyOf-Cbp35lO-.cjs");exports.ConnectionWarning=o.ConnectionWarning;exports.RobotHeader=o.RobotHeader;exports.connectionWarningOf=o.connectionWarningOf;exports.default=o.RobotHeader;exports.robotActivationOf=o.robotActivationOf;exports.robotSafetyOf=t.robotSafetyOf;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../chunks/robotActivationOf-CvylCSYs.cjs"),t=require("../chunks/robotSafetyOf-Cbp35lO-.cjs");exports.ConnectionWarning=o.ConnectionWarning;exports.RobotHeader=o.RobotHeader;exports.connectionWarningOf=o.connectionWarningOf;exports.default=o.RobotHeader;exports.robotActivationOf=o.robotActivationOf;exports.robotSafetyOf=t.robotSafetyOf;
@@ -1,4 +1,4 @@
1
- import { C as n, R as r, c as t, R as e, r as f } from "../chunks/robotActivationOf-CY-F1A3W.js";
1
+ import { C as n, R as r, c as t, R as e, r as f } from "../chunks/robotActivationOf-GTYfLNrW.js";
2
2
  import { r as s } from "../chunks/robotSafetyOf-kNLaX0_5.js";
3
3
  export {
4
4
  n as ConnectionWarning,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../chunks/RobotScene-Dc7UpxxA.cjs"),o=require("../chunks/RobotSessionProvider--AekyPqD.cjs");exports.JoggingAxes=e.JoggingAxes;exports.RobotScene=e.RobotScene;exports.RobotSceneView=e.RobotSceneView;exports.default=e.RobotScene;exports.useRobotSceneProps=e.useRobotSceneProps;exports.RobotSessionProvider=o.RobotSessionProvider;exports.useRobotSession=o.useRobotSession;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../chunks/RobotScene-BnhM3iuc.cjs"),o=require("../chunks/RobotSessionProvider--AekyPqD.cjs");exports.JoggingAxes=e.JoggingAxes;exports.RobotScene=e.RobotScene;exports.RobotSceneView=e.RobotSceneView;exports.default=e.RobotScene;exports.useRobotSceneProps=e.useRobotSceneProps;exports.RobotSessionProvider=o.RobotSessionProvider;exports.useRobotSession=o.useRobotSession;
@@ -1,10 +1,10 @@
1
- import { b as s, R as a, e as t, R, u as r } from "../chunks/RobotScene-DWFKwcNM.js";
2
- import { R as n, u as i } from "../chunks/RobotSessionProvider-TVaKGzqa.js";
1
+ import { a as s, R as a, c as t, R, u as r } from "../chunks/RobotScene-CHQcpJG-.js";
2
+ import { R as b, u as i } from "../chunks/RobotSessionProvider-TVaKGzqa.js";
3
3
  export {
4
4
  s as JoggingAxes,
5
5
  a as RobotScene,
6
6
  t as RobotSceneView,
7
- n as RobotSessionProvider,
7
+ b as RobotSessionProvider,
8
8
  R as default,
9
9
  r as useRobotSceneProps,
10
10
  i as useRobotSession
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../chunks/RobotView-BemOONOj.cjs"),e=require("../chunks/RobotSessionProvider--AekyPqD.cjs");exports.RobotCanvas=o.RobotCanvas;exports.RobotView=o.RobotView;exports.default=o.RobotView;exports.RobotSessionProvider=e.RobotSessionProvider;exports.useRobotSession=e.useRobotSession;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../chunks/RobotView-C1_PW7jD.cjs"),e=require("../chunks/RobotSessionProvider--AekyPqD.cjs");exports.RobotCanvas=o.RobotCanvas;exports.RobotView=o.RobotView;exports.default=o.RobotView;exports.RobotSessionProvider=e.RobotSessionProvider;exports.useRobotSession=e.useRobotSession;
@@ -1,4 +1,4 @@
1
- import { R as a, a as e, a as t } from "../chunks/RobotView-CfOUuvEc.js";
1
+ import { R as a, a as e, a as t } from "../chunks/RobotView-DdjUVCYj.js";
2
2
  import { R, u as b } from "../chunks/RobotSessionProvider-TVaKGzqa.js";
3
3
  export {
4
4
  a as RobotCanvas,
@@ -0,0 +1,3 @@
1
+ "use strict";const t=require("react/jsx-runtime"),be=require("@mui/material/AppBar"),se=require("@mui/material/Backdrop"),O=require("@mui/material/Box"),ve=require("@mui/material/Menu"),D=require("@mui/material/MenuItem"),je=require("@mui/material/Toolbar"),y=require("@mui/material/Typography"),ye=require("@wandelbots/design-tokens"),Ce=require("@wandelbots/icons/ExpandMoreFilled"),Se=require("@wandelbots/mui"),S=require("mobx-react-lite"),v=require("react"),W=require("./externalizeComponent-CA_sHzyH.cjs"),we=require("@mui/icons-material/OpenWith"),Me=require("@mui/icons-material/Share"),b=require("@mui/material/Stack"),Te=require("@mui/material/Tab"),Ee=require("@mui/material/Tabs"),C=require("mobx"),A=require("react-i18next"),H=require("./loadRobotSession-GOa6wyyF.cjs"),le=require("@mui/material/CircularProgress"),Ie=require("@mui/material/utils"),K=require("lodash-es"),Je=require("./robotSafetyOf-Cbp35lO-.cjs"),ke=require("@mui/material/Alert"),Re=require("@mui/material/AlertTitle"),Q=require("@mui/material/Button"),V=require("@mui/material/styles"),q=require("@mui/material/Divider"),ie=require("@mui/material/ToggleButton"),_=require("@wandelbots/nova-js"),Z=require("@mui/material/IconButton"),te=require("./hooks-BXe2bNMo.cjs"),$=require("./joggingColors-Cqpfuw4G.cjs"),_e=require("@mui/material/InputAdornment"),Ae=require("@mui/material/FormControl"),Pe=require("@mui/material/InputLabel"),Oe=require("@mui/material/Select"),Ve=require("@mui/material/ToggleButtonGroup"),ce=require("@mui/material/Slider"),U=require("@wandelbots/nova-js/v2"),Le=require("@mui/icons-material/ChevronLeft"),De=require("@mui/icons-material/ChevronRight"),qe=require("@mui/material/Dialog"),$e=require("@mui/material/DialogActions"),Be=require("@mui/material/DialogContent"),ze=require("@mui/material/DialogTitle"),Fe=require("three"),G=require("./PoseTransformer-2QIzECOZ.cjs");function de(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,i.get?i:{enumerable:!0,get:()=>e[o]})}}return n.default=e,Object.freeze(n)}const f=de(v),re=de(Fe),Ne=W.externalizeComponent(S.observer(e=>{const{appIcon:n,appName:o,apps:i=[],onAppSelect:a,disabled:l=!1,sx:d}=e,[r,g]=v.useState(null),p=!!r,j=s=>{g(s.currentTarget)},u=()=>{g(null)},c=s=>{u(),s.onClick?s.onClick():s.href&&(window.location.href=s.href),a==null||a(s)};return t.jsxs(t.Fragment,{children:[t.jsx(be,{position:"static",sx:{boxShadow:"none",backgroundImage:"none","& .MuiAppBar-root":{backgroundImage:"none",backgroundColor:"transparent"},...d},children:t.jsxs(je,{sx:{minHeight:"62px !important"},children:[t.jsx(O,{sx:{mr:1,display:"flex",alignItems:"center"},children:n}),t.jsxs(O,{sx:{display:"flex",alignItems:"center",flexGrow:1},children:[t.jsx(y,{component:"h1",variant:"subtitle1",children:o}),i.length>0&&t.jsx(Se.RoundedIconButton,{icon:t.jsx(Ce.ExpandMoreFilled,{size:20}),ariaLabel:"switch app","aria-controls":"app-menu","aria-haspopup":"true",onClick:j,disabled:l,sx:{ml:1}})]})]})}),t.jsx(se,{open:p,onClick:u,sx:{backdropFilter:"blur(4px)",backgroundColor:ye.ZeroGravityComponentsBackdropFill,zIndex:s=>s.zIndex.modal-1}}),t.jsx(ve,{id:"app-menu",anchorEl:r,open:p,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},sx:{zIndex:s=>s.zIndex.modal,"& .MuiPaper-root":{minWidth:200,mt:1}},children:i.map(s=>t.jsxs(D,{onClick:()=>c(s),children:[t.jsx(O,{sx:{display:"flex",alignItems:"center"},children:s.icon}),t.jsx(y,{variant:"body1",sx:{ml:2},children:s.name})]},s.id))})]})})),Ge=({title:e,titleId:n,...o},i)=>f.createElement("svg",{width:21,height:21,viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:i,"aria-labelledby":n,...o},e?f.createElement("title",{id:n},e):null,f.createElement("g",{id:"JogMinus"},f.createElement("path",{id:"Minus",d:"M0 13V8H21V13H0Z",fill:"white"}))),He=v.forwardRef(Ge),We=({title:e,titleId:n,...o},i)=>f.createElement("svg",{width:21,height:21,viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:i,"aria-labelledby":n,...o},e?f.createElement("title",{id:n},e):null,f.createElement("g",{id:"JogPlus"},f.createElement("g",{id:"Plus"},f.createElement("path",{d:"M0 13V8H8V13H0Z",fill:"white"}),f.createElement("path",{d:"M8 0L13 2.18557e-07L13 21H8L8 0Z",fill:"white"}),f.createElement("path",{d:"M13 13V8H21V13H13Z",fill:"white"})))),Ue=v.forwardRef(We),ee=W.externalizeComponent(S.observer(({colors:e,label:n,getDisplayedValue:o,startJogging:i,stopJogging:a,disabled:l,activeJoggingDirection:d,...r})=>{var E,I,J,k,R,B,z;te.useAnimationFrame(()=>{const T=o(),P=c.current;P&&(P.textContent=T)});const g=V.useTheme(),[p,j]=v.useState(null);v.useEffect(()=>{l&&M()},[l]);const u=d||p,c=v.useRef(null);e||(e={color:"#fff",backgroundColor:"#000",borderColor:"#000",buttonBackgroundColor:{disabled:"#000",default:"#000",hovered:"#000",pressed:"#000"},labelColor:"#000"});const s=u?(E=e.buttonBackgroundColor)==null?void 0:E.pressed:e.borderColor,m={width:"55px",color:e.color,path:{fill:e.color},alignContent:"center",fontSize:"37px",svg:{pointerEvents:"none"}},h={...m,backgroundColor:(I=e.buttonBackgroundColor)==null?void 0:I.default,":hover":{backgroundColor:(J=e.buttonBackgroundColor)==null?void 0:J.hovered},":active":{backgroundColor:(k=e.buttonBackgroundColor)==null?void 0:k.pressed,color:e.backgroundColor,path:{fill:e.backgroundColor}},":disabled":{backgroundColor:(R=e.buttonBackgroundColor)==null?void 0:R.disabled,"svg path":{fill:g.palette.action.disabled}}},w={...m,backgroundColor:(B=e.buttonBackgroundColor)==null?void 0:B.pressed,color:e.backgroundColor,path:{fill:e.backgroundColor},":disabled":{backgroundColor:(z=e.buttonBackgroundColor)==null?void 0:z.pressed,"svg path":{fill:g.palette.action.disabled}}};function L(T,P){l||T.button===0&&(j(P),i(P))}function M(){j(null),a()}return t.jsxs(b,{height:"64px",direction:"row",justifyContent:"center",...r,children:[t.jsx(Z,{disabled:l,disableRipple:!0,onPointerDown:T=>L(T,"-"),onPointerUp:M,onPointerOut:M,size:"large",sx:{...u==="-"?w:h,borderRadius:"16px 0px 0px 16px",borderLeft:`2px solid ${s??"#fff"}`,borderBottom:`2px solid ${s??"#fff"}`,borderTop:`2px solid ${s??"#fff"}`},children:t.jsx(He,{})}),t.jsxs(b,{spacing:"6px",sx:{width:"150px",backgroundColor:e.backgroundColor,alignItems:"center",justifyContent:"center",opacity:"0.9",borderBottom:`2px solid ${s??"#fff"}`,borderTop:`2px solid ${s??"#fff"}`},children:[t.jsx(b,{height:"22px",direction:"row",alignItems:"center",justifyItems:"center",spacing:1,sx:{userSelect:"none",color:e.color,".MuiTypography-root":{fontWeight:700,...l?{color:g.palette.action.disabled}:{}},...l?{"svg path":{fill:g.palette.action.disabled}}:{}},children:n}),t.jsx(y,{height:"22px",sx:{fontSize:"15px",color:l?g.palette.action.disabled:e.color,fontWeight:700,fontVariantNumeric:"tabular-nums",minWidth:"80px",textAlign:"center"},ref:c,children:o()})]}),t.jsx(Z,{disableRipple:!0,disabled:l,onPointerDown:T=>L(T,"+"),onPointerUp:M,onPointerOut:M,size:"large",sx:{...u==="+"?w:h,borderRadius:"0px 16px 16px 0px",borderRight:`2px solid ${s??"#fff"}`,borderBottom:`2px solid ${s??"#fff"}`,borderTop:`2px solid ${s??"#fff"}`},children:t.jsx(Ue,{})})]})})),ge=W.externalizeComponent(S.observer(({startJogging:e,stopJogging:n,lowerLimit:o,upperLimit:i,useDegree:a,getValue:l,disabled:d,...r})=>{var k,R,B,z,T,P,oe;const{t:g}=A.useTranslation(),[p,j]=v.useState(),u=V.useTheme(),c={background:(k=u.palette.backgroundPaperElevation)==null?void 0:k[4],color:(R=u.palette.backgroundPaperElevation)==null?void 0:R[11]},s=S.useLocalObservable(()=>({activeJoggingDir:null,startJogging(x){this.activeJoggingDir=x,e(x)},stopJogging(){this.activeJoggingDir=null,n()}})),m=K.throttle(()=>{const x=a?h(l()):l();(x===void 0||p===void 0||Math.abs(p-x)>1e-9)&&j(x)},50);te.useAnimationFrame(m);function h(x){if(x!==void 0)return _.radiansToDegrees(x)}function w(x){x.button===0&&s.startJogging("-")}function L(x){x.button===0&&s.startJogging("+")}function M(x){s.stopJogging()}function E(x){s.stopJogging()}function I(x,F=1){if(x===void 0||Number.isNaN(x))return"";const N=g("General.degree.variable",{amount:x.toFixed(F)});return x>0&&F===0?`+${N}`:N}function J(x,F=1){if(x===void 0||Number.isNaN(x))return"";const N=g("General.mm.variable",{amount:x.toFixed(F)});return x>0&&F===0?`+${N}`:N}return t.jsxs(b,{height:"64px",width:"100%",maxWidth:"260px",direction:"row",...r,sx:{"& .MuiIconButton-root":{width:"52px",color:u.palette.text.primary,alignContent:"center",backgroundColor:(B=u.palette.backgroundPaperElevation)==null?void 0:B[11],"& svg":{width:"42px",height:"42px"},"&.Mui-disabled":{backgroundColor:(z=u.palette.backgroundPaperElevation)==null?void 0:z[11],color:u.palette.action.disabled,opacity:1},"&:hover":{backgroundColor:(T=u.palette.backgroundPaperElevation)==null?void 0:T[9]},"&:active":{...c}}},children:[t.jsx(Z,{onPointerDown:w,onPointerUp:M,onPointerOut:E,disabled:d,disableRipple:!0,sx:{borderRadius:"16px 0px 0px 16px",...s.activeJoggingDir==="-"?c:{}},children:t.jsx(Le,{sx:{pointerEvents:"none",color:$.jointArrowColor}})}),t.jsxs(b,{flexGrow:1,alignItems:"center",justifyContent:"center",sx:{borderStyle:"solid",borderLeftWidth:0,borderRightWidth:0,border:"none",backgroundColor:(P=u.palette.backgroundPaperElevation)==null?void 0:P[11],paddingLeft:"20px",paddingRight:"20px",zIndex:1},children:[t.jsx(y,{sx:{fontSize:"15px",fontWeight:700,position:"relative",top:"5px",fontVariantNumeric:"tabular-nums",minWidth:"80px",textAlign:"center",color:d?u.palette.action.disabled:u.palette.text.primary},children:a?I(p):J(p)}),t.jsx(ce,{disabled:!0,"aria-label":"Joint position",min:a?h(o):o,max:a?h(i):i,value:p||0,track:!1,sx:{"& .MuiSlider-mark":{display:"none"},"& .MuiSlider-thumb":{width:"5px",height:"12px",borderRadius:"2px",color:d?u.palette.action.disabled:u.palette.text.primary},"& .MuiSlider-markLabel":{top:"20px",fontSize:"12px",color:d?u.palette.action.disabled:u.palette.text.secondary},"& .MuiSlider-rail":{backgroundColor:(oe=u.palette.backgroundPaperElevation)==null?void 0:oe[5],opacity:1}},marks:o!==void 0&&i!==void 0&&[{value:a?h(o):o,label:a?I(h(o),0):J(o)},{value:a?h(i):i,label:a?I(h(i),0):J(i)}]})]}),t.jsx(Z,{onPointerDown:L,onPointerUp:M,onPointerOut:E,disabled:d,disableRipple:!0,sx:{borderRadius:"0px 16px 16px 0px",...s.activeJoggingDir==="+"?c:{}},children:t.jsx(De,{sx:{pointerEvents:"none",color:$.jointArrowColor}})})]})})),ue=e=>{const n=e.softTimeout||3e3,[o,i]=v.useState(!1);return v.useEffect(()=>{const a=setTimeout(()=>{i(!0)},n);return()=>clearTimeout(a)}),t.jsx(b,{width:"100%",height:"100%",alignItems:"center",justifyContent:"center",sx:{color:"text.primary"},children:e.error?t.jsx(pe,{loadingMessage:e.message,error:e.error}):t.jsxs(t.Fragment,{children:[t.jsx(le,{sx:{mb:3}}),!!e.message&&t.jsx(y,{variant:"body1",children:e.message}),t.jsx(y,{variant:"body2",sx:{visibility:o?"visible":"hidden",mt:2,color:"text.secondary"},children:"This is taking longer than expected..."})]})})},pe=e=>{const n=Je.makeErrorMessage(e.error),o=e.error instanceof Error?e.error.stack:null;return t.jsxs(b,{sx:{maxHeight:"100%",maxWidth:"min(100%, 800px)",p:2,overflow:"auto",color:"error.main"},children:[t.jsx(y,{variant:"body1",children:(e.loadingMessage?`Error while ${K.lowerFirst(Ie.capitalize(e.loadingMessage))} - `:"")+n}),o&&t.jsx(O,{component:"pre",sx:{typography:"body2",fontFamily:"monospace",whiteSpace:"pre-wrap",wordBreak:"break-word",mt:2,pb:6},children:o})]})},Ye=S.observer(({store:e})=>{const{t:n}=A.useTranslation();return t.jsx(se,{"data-testid":"jogging-blocked","aria-label":"jogging-blocked",open:!0,sx:{position:"absolute",zIndex:o=>o.zIndex.drawer+1,color:"#fff",background:"rgba(15, 15, 15, 0.88)",justifyContent:"flex-start",alignItems:"flex-start"},children:t.jsxs(b,{sx:{m:2,width:"100%"},children:[t.jsxs(ke,{severity:"error",sx:{mb:2},children:[t.jsx(Re,{children:n("Jogging.Blocked.ti")}),n("Jogging.Blocked.lb")]}),t.jsx(Q,{variant:"contained",color:"secondary",onClick:()=>e.unblock(),children:n("Jogging.Blocked.Reenable.bt")})]})})}),Ze=({title:e,titleId:n,...o},i)=>f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:19,height:10,fill:"none",ref:i,"aria-labelledby":n,...o},e?f.createElement("title",{id:n},e):null,f.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M5.131.312a.9.9 0 0 1 0 1.272L3.07 3.645h12.44l-2.06-2.061A.9.9 0 0 1 14.72.313l3.596 3.596a.9.9 0 0 1 0 1.271l-3.596 3.597a.9.9 0 0 1-1.271-1.272l2.061-2.062H3.07L5.13 7.505A.9.9 0 0 1 3.86 8.777L.263 5.18a.9.9 0 0 1 0-1.271L3.86.312a.9.9 0 0 1 1.271 0",clipRule:"evenodd"})),Xe=v.forwardRef(Ze),Ke=({title:e,titleId:n,...o},i)=>f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:19,height:10,fill:"none",ref:i,"aria-labelledby":n,...o},e?f.createElement("title",{id:n},e):null,f.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M5.131.312a.9.9 0 0 1 0 1.272L3.07 3.645h12.44l-2.06-2.061A.9.9 0 0 1 14.72.313l3.596 3.596a.9.9 0 0 1 0 1.271l-3.596 3.597a.9.9 0 0 1-1.271-1.272l2.061-2.062H3.07L5.13 7.505A.9.9 0 0 1 3.86 8.777L.263 5.18a.9.9 0 0 1 0-1.271L3.86.312a.9.9 0 0 1 1.271 0",clipRule:"evenodd"})),Qe=v.forwardRef(Ke),et=({title:e,titleId:n,...o},i)=>f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:10,height:19,fill:"none",ref:i,"aria-labelledby":n,...o},e?f.createElement("title",{id:n},e):null,f.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M9.522 14.811A.899.899 0 1 0 8.25 13.54L6.19 15.601V3.16L8.25 5.221A.9.9 0 0 0 9.522 3.95L5.926.354a.9.9 0 0 0-1.272 0L1.058 3.95a.9.9 0 1 0 1.271 1.271L4.391 3.16v12.442L2.329 13.54a.899.899 0 1 0-1.271 1.271l3.596 3.597a.9.9 0 0 0 1.272 0z",clipRule:"evenodd"})),tt=v.forwardRef(et),nt=({title:e,titleId:n,...o},i)=>f.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:i,"aria-labelledby":n,...o},e?f.createElement("title",{id:n},e):null,f.createElement("path",{d:"M8 16C5.76667 16 3.875 15.225 2.325 13.675C0.775 12.125 0 10.2333 0 8C0 5.76667 0.775 3.875 2.325 2.325C3.875 0.775 5.76667 0 8 0C9.15 0 10.25 0.2375 11.3 0.7125C12.35 1.1875 13.25 1.86667 14 2.75V0H16V7H9V5H13.2C12.6667 4.06667 11.9375 3.33333 11.0125 2.8C10.0875 2.26667 9.08333 2 8 2C6.33333 2 4.91667 2.58333 3.75 3.75C2.58333 4.91667 2 6.33333 2 8C2 9.66667 2.58333 11.0833 3.75 12.25C4.91667 13.4167 6.33333 14 8 14C9.28333 14 10.4417 13.6333 11.475 12.9C11.0583 14.1 12.5083 12.1667 11.475 12.9L12.9 14.325C11.4667 15.4417 9.83333 16 8 16Z",fill:"white"})),ot=v.forwardRef(nt),he=S.observer(({store:e})=>{const{t:n}=A.useTranslation(),[o,i]=v.useState(e.jogger.motionStream.rapidlyChangingMotionState.joint_limit_reached.limit_reached),a=v.useRef(o);te.useAnimationFrame(()=>{const d=e.jogger.motionStream.rapidlyChangingMotionState.joint_limit_reached.limit_reached;K.isEqual(a.current,d)||(a.current=d,i(d))});const l=[];for(const[d,r]of o.entries())r&&l.push(d);return t.jsx(O,{sx:{display:"flex",flexDirection:"row",justifyContent:"center"},children:t.jsx(y,{"data-testid":"jogging-joint-limit-detector","aria-label":"jogging-joint-limit-detector",color:"error",variant:"body2",sx:{fontSize:"0.75rem",lineHeight:1.2,visibility:l.length?"visible":"hidden"},children:n("Jogging.JointLimitsReached.lb",{jointNumbers:l.map(d=>d+1).join(", ")})})})}),it=V.styled(Ae)(({theme:e})=>({"&.MuiFormControl-root":{".MuiSelect-select":{paddingTop:"20px",paddingLeft:"12px"},label:{pointerEvents:"none",fontSize:"16px"},".MuiInputLabel-root":{"&.Mui-focused":{color:e.palette.text.primary}}}}));function Y({labelValue:e,...n}){return t.jsxs(it,{fullWidth:!0,variant:"filled",children:[t.jsx(Pe,{id:n.labelId,children:e}),t.jsx(Oe,{...n})]})}const rt=S.observer(({store:e,useDegree:n})=>{var d;const{t:o}=A.useTranslation(),i=v.useId(),a=[];function l(r){switch(r){case"coordsys":return o("Jogging.Orientation.coordsys");case"tool":return o("Jogging.Orientation.tool");default:return r}}return e.showCoordSystemSelect&&a.push(t.jsx(Y,{labelId:`jogging-coord-select-${i}`,labelValue:o("Jogging.CoordinateSystem.hlb"),value:e.selectedCoordSystemId,size:"small",variant:"filled",displayEmpty:!0,onChange:r=>e.setSelectedCoordSystemId(r.target.value),children:e.coordSystems.map(r=>t.jsx(D,{value:r.coordinate_system,children:r.name&&e.coordSystemCountByName[r.name]>1?`${r.name} / ${r.coordinate_system}`:r.name||r.coordinate_system},r.coordinate_system))},"coord")),e.showTcpSelect&&a.push(t.jsx(Y,{labelId:`jogging-tcp-select-${i}`,labelValue:"TCP",value:e.selectedTcpId,size:"small",variant:"filled",displayEmpty:e.tcpChangeInProgress,onChange:r=>{e.requestTcpChange(r.target.value).catch(g=>{console.error("Failed to change TCP:",g)})},disabled:e.tcpChangeInProgress,endAdornment:e.tcpChangeInProgress?t.jsx(_e,{position:"end",children:t.jsx(le,{size:16})}):void 0,children:e.tcps.map(r=>t.jsx(D,{value:r.id,children:r.id},r.id))},"tcp")),e.showOrientationSelect&&a.push(t.jsx(Y,{labelValue:o("Jogging.Cartesian.Orientation.lb"),labelId:`orientation-select-${i}`,value:e.selectedOrientation,onChange:r=>e.setSelectedOrientation(r.target.value),children:H.ORIENTATION_IDS.map(r=>t.jsx(D,{value:r,children:l(r)},r))},"orientation")),e.showIncrementSelect&&a.push(t.jsxs(Y,{labelValue:o("Jogging.Increment.hlb"),labelId:`jogging-increment-select-${i}`,size:"small",variant:"filled",value:((d=e.activeDiscreteIncrement)==null?void 0:d.id)||"continuous",onChange:r=>e.setSelectedIncrementId(r.target.value),children:[t.jsx(D,{value:"continuous",children:o("Jogging.Increment.Continuous.dd")},"continuous"),e.discreteIncrementOptions.map(r=>t.jsx(D,{value:r.id,children:n?`${r.degrees}°`:`${r.mm}mm`},r.id))]},"increment")),t.jsx(O,{component:"div","data-testid":"jogging-options","aria-label":"jogging-options",sx:{display:"grid",gap:"16px",gridTemplateColumns:"1fr 1fr",gridAutoRows:"min-content","& label":{opacity:.7,fontSize:"12px",marginBottom:"4px"}},children:a.map((r,g)=>t.jsx(O,{sx:{gridColumn:a.length%2===1&&g===a.length-1?"span 2":"auto"},children:r},g))})}),at=V.styled(Ve)(({theme:e})=>{var n;return{"&.MuiToggleButtonGroup-root":{background:(n=e.palette.backgroundPaperElevation)==null?void 0:n[8],borderRadius:"8px",padding:"4px",gap:"4px",button:{border:"none",borderRadius:"4px",flex:"1 1 0px",minWidth:0,"&.MuiToggleButtonGroup-firstButton":{borderRadius:"8px 4px 4px 8px"},"&.MuiToggleButtonGroup-lastButton":{borderRadius:"4px 8px 8px 4px"}}}}}),xe=W.externalizeComponent(S.observer(e=>{const{store:n}=e,{t:o}=A.useTranslation();function i(a,l){l===e.velocity||!K.isNumber(l)||e.onVelocityChange(l,e.useDegree)}return t.jsxs(b,{direction:"row",gap:2,alignItems:"center","data-testid":"velocity-slider","aria-label":"velocity-slider",children:[n.showVelocityLegend&&t.jsx(y,{sx:{color:$.velocitySliderLegendColor,fontSize:"14px"},children:o("Jogging.Velocity.bt")}),t.jsx(ce,{value:e.velocity,color:"secondary",onChange:i,min:e.min,max:e.max,"aria-labelledby":"input-slider",disabled:e.disabled,sx:{"& .MuiSlider-valueLabelOpen":{zIndex:100,backgroundColor:"transparent",top:"0px"}}}),n.showVelocitySliderLabel&&(e.renderValue?e.renderValue(e.velocity):t.jsx(ne,{value:e.velocity.toString()}))]})}));function ne({value:e,sx:n}){var i;const o=V.useTheme();return t.jsx(b,{direction:"row",justifyContent:"center",alignItems:"center",gap:"5px",sx:{padding:"6px 12px",background:(i=o.palette.backgroundPaperElevation)==null?void 0:i[8],borderRadius:"10px",minWidth:"111px",...n},children:t.jsx(y,{component:"span",sx:{textAlign:"right",fontSize:"14px",opacity:.8,color:o.palette.text.primary,whiteSpace:"nowrap"},children:e})})}const me=S.observer(({store:e,useDegree:n})=>{const{t:o}=A.useTranslation();function i(a,l){return l?`ω = ${o("Jogging.Cartesian.Rotation.velocityDegPerSec.lb",{amount:a})}`:`v = ${o("Jogging.Cartesian.Translation.velocityMmPerSec.lb",{amount:a})}`}return t.jsx(xe,{store:e,velocity:e.velocityInDisplayUnits(n),min:e.minVelocityInDisplayUnits(n),max:e.maxVelocityInDisplayUnits(n),onVelocityChange:e.setVelocityFromSlider,useDegree:n,disabled:e.isLocked,renderValue:a=>t.jsx(ne,{value:i(a,n),sx:{minWidth:"111px",span:{transform:"translateY(-1.5px)"}}})})}),fe=S.observer(({store:e})=>{var d,r,g;const{t:n}=A.useTranslation(),o=V.useTheme(),i=((g=(r=(d=e.jogger.motionStream.rapidlyChangingMotionState.execute)==null?void 0:d.details)==null?void 0:r.state)==null?void 0:g.kind)??"KIND_UNKNOWN",a=e.lastJogError,l=e.lastJogErrorTranslationKey;return t.jsxs(O,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",color:o.palette.text.primary},children:[t.jsx(y,{variant:"body2",sx:{fontSize:"0.75rem",lineHeight:1.2},children:n("Jogging.StreamStateSection.lb")}),t.jsx(y,{variant:"body2",color:a?"error":void 0,sx:{fontSize:"0.75rem",lineHeight:1.2,textAlign:"right"},"data-testid":a?"JOG_ERROR":i,children:a?l?n(l):a:n(`Jogging.StreamStateSection.${i}.lb`)})]})}),st=S.observer(({store:e,children:n})=>{const{t:o}=A.useTranslation(),i=V.useTheme(),a=v.useRef(0);function l(c,s){(s==="translate"||s==="rotate")&&e.setSelectedCartesianMotionType(s)}async function d(c,s){const m=await e.activate(),h=m.motionStream.rapidlyChangingMotionState.tcp_pose,w=m.motionStream.rapidlyChangingMotionState.joint_position;h&&await e.withMotionLock(async()=>{try{e.setCurrentIncrementJog({axis:c.axis,direction:c.direction}),await e.jogger.runIncrementalCartesianMotion({currentTcpPose:h,currentJoints:w,coordSystemId:e.activeCoordSystemId,velocityInRelevantUnits:e.selectedCartesianMotionType==="translate"?e.translationVelocityMmPerSec:e.rotationVelocityRadsPerSec,axis:c.axis,direction:c.direction,motion:e.selectedCartesianMotionType==="translate"?{type:"translate",distanceMm:s.mm}:{type:"rotate",distanceRads:_.degreesToRadians(s.degrees)}})}finally{e.setCurrentIncrementJog(null),await e.deactivate()}})}async function r(c){if(e.isLocked)return;const s=++a.current;try{if(await e.activate(),s!==a.current)return;if(e.activeDiscreteIncrement)return await d(c,e.activeDiscreteIncrement);c.motionType==="translate"?await e.jogger.translateTCP({axis:c.axis,direction:c.direction,velocityMmPerSec:e.translationVelocityMmPerSec}):await e.jogger.rotateTCP({axis:c.axis,direction:c.direction,velocityRadsPerSec:e.rotationVelocityRadsPerSec})}catch(m){console.error("Jogging failed:",m)}}async function g(){e.activeDiscreteIncrement||(a.current++,await e.deactivate())}const p=[{id:"x",icon:t.jsx(Xe,{}),colors:$.cartesianAxisColors.X},{id:"y",icon:t.jsx(Qe,{}),colors:$.cartesianAxisColors.Y},{id:"z",icon:t.jsx(tt,{}),colors:$.cartesianAxisColors.Z}];function j(c){return o("General.mm.variable",{amount:c.toFixed(1)})}function u(c){return o("General.degree.variable",{amount:_.radiansToDegrees(c).toFixed(1)})}return t.jsxs(b,{"data-testid":"jogging-cartesian-tab","aria-label":"jogging-cartesian-tab",flexGrow:1,gap:2,sx:{padding:"18px 24px"},children:[t.jsxs(b,{gap:2,children:[t.jsx(rt,{store:e,useDegree:e.selectedCartesianMotionType==="rotate"}),t.jsx(me,{store:e,useDegree:e.selectedCartesianMotionType==="rotate"}),t.jsx(q,{})]}),t.jsx(b,{marginLeft:"auto",marginRight:"auto",gap:"24px",justifyContent:"center",sx:{flexGrow:"1"},children:t.jsxs(b,{alignItems:"center",justifyContent:"center",gap:"24px",sx:{flexGrow:1},children:[t.jsxs(at,{value:e.selectedCartesianMotionType,onChange:l,exclusive:!0,"aria-label":o("Jogging.Cartesian.MotionType.lb"),sx:{justifyContent:"center"},children:[t.jsx(ie,{value:"translate",children:o("Jogging.Cartesian.Translation.bt")}),t.jsx(ie,{value:"rotate",children:o("Jogging.Cartesian.Rotation.bt")})]}),e.selectedCartesianMotionType==="translate"&&p.map(c=>{var s,m;return t.jsx(ee,{"data-testid":`jogging-cartesian-axis-control-${c.id}`,"aria-label":`jogging-cartesian-axis-control-${c.id}`,colors:c.colors,disabled:e.isLocked,activeJoggingDirection:((s=e.incrementJogInProgress)==null?void 0:s.axis)===c.id?e.incrementJogInProgress.direction:void 0,label:t.jsxs(t.Fragment,{children:[c.icon,t.jsx(y,{sx:{fontSize:"24px",color:((m=c.colors)==null?void 0:m.labelColor)??i.palette.text.primary},children:c.id.toUpperCase()})]}),getDisplayedValue:()=>{var h,w;return j(((w=(h=e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose)==null?void 0:h.position)==null?void 0:w[_.XYZ_TO_VECTOR[c.id]])||0)},startJogging:h=>r({axis:c.id,motionType:"translate",direction:h}),stopJogging:g},c.id)}),e.selectedCartesianMotionType==="rotate"&&p.map(c=>{var s,m;return t.jsx(ee,{"data-testid":`jogging-cartesian-axis-control-${c.id}`,"aria-label":`jogging-cartesian-axis-control-${c.id}`,colors:c.colors,disabled:e.isLocked,activeJoggingDirection:((s=e.incrementJogInProgress)==null?void 0:s.axis)===c.id?e.incrementJogInProgress.direction:void 0,label:t.jsxs(t.Fragment,{children:[t.jsx(ot,{}),t.jsx(y,{sx:{fontSize:"24px",color:((m=c.colors)==null?void 0:m.labelColor)??i.palette.text.primary},children:c.id.toUpperCase()})]}),getDisplayedValue:()=>{var h,w;return u(((w=(h=e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose)==null?void 0:h.orientation)==null?void 0:w[_.XYZ_TO_VECTOR[c.id]])||0)},startJogging:h=>r({axis:c.id,motionType:"rotate",direction:h}),stopJogging:g},c.id)})]})}),t.jsx(he,{store:e}),t.jsx(q,{}),t.jsx(fe,{store:e}),n&&t.jsx(q,{}),n]})}),lt=S.observer(({store:e,children:n})=>{const o=V.useTheme(),i=v.useRef(0);async function a(d){const r=++i.current;try{if(await e.activate(),r!==i.current)return;await e.jogger.rotateJoints({joint:d.joint,direction:d.direction,velocityUnit:e.jointType===U.JointTypeEnum.PrismaticJoint?"mm/s":"rad/s",velocityValue:e.jointType===U.JointTypeEnum.PrismaticJoint?e.translationVelocityMmPerSec:e.rotationVelocityRadsPerSec})}catch(g){console.error("Jogging failed:",g)}}async function l(){i.current++,await e.jogger.stop(),await e.deactivate()}return t.jsxs(b,{"data-testid":"jogging-joint-tab","aria-label":"jogging-joint-tab",flexGrow:1,gap:2,sx:{padding:"18px 24px"},children:[t.jsx(me,{store:e,useDegree:e.jointType===U.JointTypeEnum.RevoluteJoint}),t.jsx(q,{}),t.jsx(b,{justifyContent:"center",alignItems:"stretch",sx:{flexGrow:"1"},children:t.jsx(b,{"data-testid":"jogging-joint-value-controls-wrapper","aria-label":"jogging-joint-value-controls-wrapper",alignItems:"center",gap:"24px",children:e.jogger.motionStream.joints.map(d=>{var g,p,j;const r=(j=(p=(g=e.motionGroupDescription.operation_limits.auto_limits)==null?void 0:g.joints)==null?void 0:p[d.index])==null?void 0:j.position;return t.jsxs(b,{"data-testid":`jogging-joint-value-control-${d.index}`,"aria-label":`jogging-joint-value-control-${d.index}`,direction:"row",alignItems:"center",justifyContent:"center",spacing:1.5,width:"100%",children:[e.showJointsLegend&&t.jsx(y,{color:e.isLocked?o.palette.text.disabled:o.palette.text.secondary,children:`G${d.index+1}`}),t.jsx(ge,{disabled:e.isLocked,lowerLimit:r==null?void 0:r.lower_limit,upperLimit:r==null?void 0:r.upper_limit,useDegree:e.jointType===U.JointTypeEnum.RevoluteJoint,getValue:()=>{const u=e.jogger.motionStream.rapidlyChangingMotionState.joint_position[d.index];return u!==void 0?u:void 0},startJogging:u=>a({joint:d.index,direction:u}),stopJogging:l})]},`joint-${d.index}`)})})}),t.jsx(he,{store:e}),t.jsx(q,{}),t.jsx(fe,{store:e}),n&&t.jsx(q,{}),n]})}),ct=W.externalizeComponent(S.observer(e=>{const n=S.useLocalObservable(()=>({joggingStore:null,loadingError:null}));return v.useEffect(()=>{let o=!1,i;async function a(){C.runInAction(()=>{n.loadingError=null,n.joggingStore=null});try{let l=e.store;if(!l){const d=await H.JoggerConnection.open(e.nova,e.motionGroupId,{cellId:e.cellId});if(o){d.dispose();return}try{l=await H.JoggingStore.loadFor(d)}catch(r){throw d.dispose(),r}if(i=l,o){l.dispose();return}}C.runInAction(()=>{n.joggingStore=l}),e.onSetup&&e.onSetup(l)}catch(l){if(o)return;C.runInAction(()=>{n.loadingError=l})}}return a(),()=>{o=!0,i==null||i.dispose()}},[e.store,e.nova,e.motionGroupId,e.cellId]),v.useEffect(()=>{const o=n.joggingStore;if(!(!o||!e.locked))return o.lock("external"),()=>o.unlock("external")},[n.joggingStore,e.locked]),t.jsx(b,{"data-testid":"jogging-panel","aria-label":"jogging-panel",sx:{maxWidth:"460px",minWidth:"320px",position:"relative",...e.sx},children:n.joggingStore?t.jsx(dt,{store:n.joggingStore,children:e.children}):t.jsx(ue,{message:"Loading jogging",error:n.loadingError})})})),dt=S.observer(({store:e,children:n})=>{const{t:o}=A.useTranslation();function i(){if(e.currentTab.id==="cartesian")return t.jsx(st,{store:e,children:n});if(e.currentTab.id==="joint")return t.jsx(lt,{store:e,children:n})}return t.jsxs(b,{flexGrow:1,sx:{overflow:"hidden"},children:[t.jsx(Ee,{"data-testid":"jogging-tabs","aria-label":"jogging-tabs",value:e.tabIndex,onChange:e.onTabChange,variant:"fullWidth",children:e.tabs.map(a=>{const l=a.label==="Cartesian"?o("Jogging.Cartesian.bt"):o("Jogging.Joints.bt"),d=a.label==="cartesian"?t.jsx(we,{fontSize:"small",sx:{mr:1}}):t.jsx(Me,{fontSize:"small",sx:{mr:1}});return t.jsx(Te,{"data-testid":`jogging-tab-${a.id}`,"aria-label":`jogging-tab-${a.id}`,label:e.showTabIcons?t.jsxs(b,{direction:"row",alignItems:"center",children:[d,l]}):l,id:`jogging-tab-${a.id}`,"aria-controls":`jogging-tab-${a.id}`},a.id)})}),t.jsx(b,{flexGrow:1,position:"relative",sx:{overflowY:"auto",overflowX:"hidden"},children:i()}),e.blocked&&t.jsx(Ye,{store:e})]})});function gt(){const e=window.location.href;return e.substring(0,e.indexOf("/",e.indexOf("//")+2))}function ut({baseUrl:e=gt(),...n}){return t.jsxs(qe,{"aria-labelledby":"no-motion-group-modal-title",open:!0,fullWidth:!0,sx:{"& .MuiModal-backdrop":{backdropFilter:"blur(10px)"},"& .MuiDialog-paper":{"::before":{content:'""',height:"8px",width:"100%",background:"linear-gradient(90deg, #FF0E65 0%, #47D3FF 100%)"},background:"#101629"}},children:[t.jsx(ze,{id:"no-motion-group-modal-title",children:"No motion group found"}),t.jsxs(Be,{sx:{marginTop:"3rem",marginBottom:"1.5rem",textAlign:"center"},children:[t.jsx(y,{color:"#fff",children:"Found no devices to connect to."}),t.jsx(y,{color:"#fff",children:"Please ensure a motion group has been created."})]}),t.jsx($e,{children:t.jsxs(b,{width:"100%",maxWidth:"300px",margin:"auto",marginBottom:"2rem",children:[t.jsx(Q,{href:`${e}/settings`,variant:"contained",sx:{borderRadius:"8px",width:"100%"},children:"Go to settings app"}),t.jsx(Q,{href:`${e}`,variant:"text",sx:{marginTop:"1rem",color:"#fff",textDecoration:"underline",fontSize:"0.75rem"},children:"Back to Homescreen"})]})})]})}const ae=1e-4,pt={a:0,d:0,alpha:0,theta:0,reverse_rotation_direction:!1};class X{constructor(n,o,i,a,l,d,r,g,p,j,u="cell"){this.controller=o,this.motionGroup=i,this.initialMotionState=a,this.motionStateSocket=l,this.isVirtual=d,this.tcps=r,this.description=g,this.initialControllerState=p,this.controllerStateSocket=j,this.cellId=u,this.connectedJoggingSocket=null,this.joggingVelocity=10,this.activationState="inactive",this.nova=G.createNovaClient(n),this.rapidlyChangingMotionState=a,this.controllerState=p,j.addEventListener("message",c=>{var m;const s=(m=_.tryParseJson(c.data))==null?void 0:m.result;s&&C.runInAction(()=>{this.controllerState=s})}),l.addEventListener("message",c=>{var m;const s=(m=_.tryParseJson(c.data))==null?void 0:m.result;if(!s)throw new Error(`Failed to get motion state for ${this.motionGroupId}: ${c.data}`);H.jointValuesUnchanged(this.rapidlyChangingMotionState.joint_position,s.joint_position,ae)||C.runInAction(()=>{this.rapidlyChangingMotionState.joint_position=s.joint_position}),H.tcpMotionEqual(this.rapidlyChangingMotionState,s,ae)||C.runInAction(()=>{this.rapidlyChangingMotionState.tcp_pose=s.tcp_pose}),s.tcp!==void 0&&this.rapidlyChangingMotionState.tcp!==s.tcp&&C.runInAction(()=>{this.rapidlyChangingMotionState.tcp=s.tcp}),this.rapidlyChangingMotionState.standstill!==s.standstill&&C.runInAction(()=>{this.rapidlyChangingMotionState.standstill=s.standstill})}),C.makeAutoObservable(this)}static async connectMultiple(n,o,i={}){const a=G.createNovaClient(n),l=i.cellId??G.cellIdOf(n);return Promise.all(o.map(d=>X.connect(a,d,{...i,cellId:l})))}static async connect(n,o,i={}){var I,J;const a=G.createNovaClient(n),l=i.cellId??G.cellIdOf(n)??"cell",[d,r]=o.split("@"),g=await a.api.controller.getCurrentRobotControllerState(l,r),p=g==null?void 0:g.motion_groups.find(k=>k.motion_group===o);if(!g||!p)throw new Error(`Controller ${r} or motion group ${o} not found`);const j=a.openReconnectingWebsocket(`/cells/${l}/controllers/${r}/motion-groups/${o}/state-stream`),u=await j.firstMessage(),c=(I=_.tryParseJson(u.data))==null?void 0:I.result;if(!c)throw new Error(`Unable to parse initial motion state message ${u.data}`);console.log(`Connected motion state websocket to motion group ${p.motion_group}. Initial state:
2
+ `,c);const m=(await a.api.controller.getRobotController(l,g.controller)).configuration.kind==="VirtualController",h=await a.api.motionGroup.getMotionGroupDescription(l,r,p.motion_group),w=Object.entries(h.tcps||{}).map(([k,R])=>({id:k,readable_name:R.name,position:R.pose.position,orientation:R.pose.orientation})),L=a.openReconnectingWebsocket(`/cells/${l}/controllers/${g.controller}/state-stream?response_rate=1000`),M=await L.firstMessage(),E=(J=_.tryParseJson(M.data))==null?void 0:J.result;if(!E)throw new Error(`Unable to parse initial controller state message ${M.data}`);return console.log(`Connected controller state websocket to controller ${g.controller}. Initial state:
3
+ `,E),new X(a,g,p,c,j,m,w,h,E,L,l)}get motionGroupId(){return this.motionGroup.motion_group}get controllerId(){return this.controller.controller}get modelFromController(){return this.description.motion_group_model}get joggingVelocityRads(){return this.joggingVelocity*Math.PI/180}get joints(){return this.initialMotionState.joint_position.map((n,o)=>({index:o}))}get dhParameters(){if(this.description.dh_parameters!==void 0)return this.description.dh_parameters.map(n=>({...pt,...n}))}get safetyZones(){return this.description.safety_zones}get mountingPosition(){var n,o,i;return this.description.mounting?[(((n=this.description.mounting.position)==null?void 0:n[0])||0)/1e3,(((o=this.description.mounting.position)==null?void 0:o[1])||0)/1e3,(((i=this.description.mounting.position)==null?void 0:i[2])||0)/1e3]:[0,0,0]}get mountingQuaternion(){var a,l,d,r,g,p;const n=new re.Vector3(((l=(a=this.description.mounting)==null?void 0:a.orientation)==null?void 0:l[0])||0,((r=(d=this.description.mounting)==null?void 0:d.orientation)==null?void 0:r[1])||0,((p=(g=this.description.mounting)==null?void 0:g.orientation)==null?void 0:p[2])||0),o=n.length(),i=n.normalize();return new re.Quaternion().setFromAxisAngle(i,o)}get isEstopActive(){return["SAFETY_STATE_ROBOT_EMERGENCY_STOP","SAFETY_STATE_DEVICE_EMERGENCY_STOP"].includes(this.controllerState.safety_state)}get isMoveableSafetyState(){return["SAFETY_STATE_NORMAL","SAFETY_STATE_REDUCED"].includes(this.controllerState.safety_state)}get isMoveableOperationMode(){return["OPERATION_MODE_AUTO","OPERATION_MODE_MANUAL","OPERATION_MODE_MANUAL_T1","OPERATION_MODE_MANUAL_T2"].includes(this.controllerState.operation_mode)}get canBeMoved(){return this.isMoveableSafetyState&&this.isMoveableOperationMode&&this.activationState==="active"}async deactivate(){if(this.activationState!=="active"){console.error("Tried to deactivate while already deactivating");return}C.runInAction(()=>{this.activationState="deactivating"});try{await this.nova.api.controller.setDefaultMode(this.cellId,this.controllerId,"ROBOT_SYSTEM_MODE_MONITOR"),C.runInAction(()=>{this.activationState="inactive"})}catch(n){throw C.runInAction(()=>{this.activationState="active"}),n}}async activate(){if(this.activationState!=="inactive"){console.error("Tried to activate while already activating");return}C.runInAction(()=>{this.activationState="activating"});try{await this.nova.api.controller.setDefaultMode(this.cellId,this.controllerId,"ROBOT_SYSTEM_MODE_CONTROL"),C.runInAction(()=>{this.activationState="active"})}catch(n){throw C.runInAction(()=>{this.activationState="inactive"}),n}}toggleActivation(){this.activationState==="inactive"?this.activate():this.activationState==="active"&&this.deactivate()}dispose(){this.motionStateSocket.close(),this.controllerStateSocket.close(),this.connectedJoggingSocket&&this.connectedJoggingSocket.close()}setJoggingVelocity(n){this.joggingVelocity=n}}exports.AppHeader=Ne;exports.ConnectedMotionGroup=X;exports.JoggingCartesianAxisControl=ee;exports.JoggingJointValueControl=ge;exports.JoggingPanel=ct;exports.LoadingCover=ue;exports.LoadingErrorMessage=pe;exports.NoMotionGroupModal=ut;exports.VelocitySlider=xe;exports.VelocitySliderLabel=ne;