@wandelbots/wandelbots-js-react-components 6.4.0-pr.revamp.667.96fdf15 → 6.4.0-pr.revamp.667.a961def
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -9
- package/dist/3d.cjs +1 -1
- package/dist/3d.js +8 -8
- package/dist/CurrentPose/index.cjs +1 -1
- package/dist/CurrentPose/index.js +1 -1
- package/dist/CurrentPoseBar/index.cjs +1 -1
- package/dist/CurrentPoseBar/index.js +1 -1
- package/dist/JoggingButtons/index.cjs +1 -1
- package/dist/JoggingButtons/index.js +1 -1
- package/dist/JoggingGizmo/index.cjs +1 -1
- package/dist/JoggingGizmo/index.js +2 -2
- package/dist/JoggingJointSlider/index.cjs +1 -1
- package/dist/JoggingJointSlider/index.js +1 -1
- package/dist/RobotControl/index.cjs +1 -1
- package/dist/RobotControl/index.js +1 -1
- package/dist/RobotControlPanel/index.cjs +1 -1
- package/dist/RobotControlPanel/index.js +1 -1
- package/dist/RobotHeader/index.cjs +1 -1
- package/dist/RobotHeader/index.js +2 -2
- package/dist/RobotScene/index.cjs +1 -1
- package/dist/RobotScene/index.js +1 -1
- package/dist/RobotView/index.cjs +1 -1
- package/dist/RobotView/index.js +1 -1
- package/dist/SafetyBar/index.cjs +1 -1
- package/dist/SafetyBar/index.js +1 -1
- package/dist/chunks/ConnectedMotionGroup-CV-9JcMR.cjs +3 -0
- package/dist/chunks/ConnectedMotionGroup-DRZePyKr.js +1824 -0
- package/dist/chunks/{CurrentPose-dHc4WUET.cjs → CurrentPose-B2k1YoBx.cjs} +1 -1
- package/dist/chunks/{CurrentPose-DW2uqL-R.js → CurrentPose-CMkPnaXN.js} +2 -2
- package/dist/chunks/CurrentPoseBar-C4wB482_.cjs +1 -0
- package/dist/chunks/{CurrentPoseBar-CMgxSmIo.js → CurrentPoseBar-GhVif6kH.js} +9 -8
- package/dist/chunks/{JoggingButtons-DYRL_wre.cjs → JoggingButtons-CDs_NWPT.cjs} +1 -1
- package/dist/chunks/{JoggingButtons-BJX63dBt.js → JoggingButtons-dR1m8I9M.js} +2 -2
- package/dist/chunks/JoggingGizmo-B84rMNKl.cjs +1 -0
- package/dist/chunks/{JoggingGizmo-CDdItWpT.js → JoggingGizmo-CZagy8VY.js} +276 -260
- package/dist/chunks/{JoggingGizmoOrientation-DwGhxKo3.cjs → JoggingGizmoOrientation-BrI3aOMk.cjs} +1 -1
- package/dist/chunks/{JoggingGizmoOrientation-BeD7eJ9t.js → JoggingGizmoOrientation-C0Ip0s33.js} +1 -1
- package/dist/chunks/JoggingJointSlider-DYjAzQZq.js +378 -0
- package/dist/chunks/JoggingJointSlider-xz725ItY.cjs +1 -0
- package/dist/chunks/JoggingRefusedError-2q4x_fDF.cjs +1 -0
- package/dist/chunks/JoggingRefusedError-M954yLQO.js +23 -0
- package/dist/chunks/PoseTransformer-C_EfofnJ.cjs +1 -0
- package/dist/chunks/PoseTransformer-MLAm4_Ad.js +364 -0
- package/dist/chunks/{Robot-BCPv4zBP.js → Robot-B1j3VKwk.js} +1 -1
- package/dist/chunks/{Robot-CA2P_Sgf.cjs → Robot-v8trFpVT.cjs} +1 -1
- package/dist/chunks/RobotActivation-Bb0oNSBN.cjs +1 -0
- package/dist/chunks/RobotActivation-C0rrwpQZ.js +115 -0
- package/dist/chunks/RobotControl-C7c6MWyL.js +282 -0
- package/dist/chunks/RobotControl-CD9PKmrE.cjs +1 -0
- package/dist/chunks/RobotControlPanel-69F3kOBc.cjs +1 -0
- package/dist/chunks/{RobotControlPanel-DFz_c0p9.js → RobotControlPanel-6HBz7oke.js} +29 -28
- package/dist/chunks/{RobotScene-BvFIq4fY.js → RobotScene-CldpfxRT.js} +381 -356
- package/dist/chunks/RobotScene-ztJZ4EKT.cjs +1 -0
- package/dist/chunks/{RobotView-CoQ63Yli.js → RobotView-BTL3FAIE.js} +2 -2
- package/dist/chunks/{RobotView-CDsmQESS.cjs → RobotView-wketM8bf.cjs} +1 -1
- package/dist/chunks/externalizeComponent-BW1UV6Gh.cjs +2 -0
- package/dist/chunks/{externalizeComponent-BiXWFiD7.js → externalizeComponent-TgclPxwg.js} +16 -8
- package/dist/chunks/holdSafety-Cbej6-Kc.js +62 -0
- package/dist/chunks/holdSafety-TeMXlYQe.cjs +1 -0
- package/dist/chunks/joggingColors-Cqpfuw4G.cjs +1 -0
- package/dist/chunks/joggingColors-sb6IFdj2.js +133 -0
- package/dist/chunks/json-3cqBD7UQ.js +18 -0
- package/dist/chunks/json-Bd6uGfgP.cjs +1 -0
- package/dist/chunks/loadRobotSession-Br55rLAm.cjs +1 -0
- package/dist/chunks/loadRobotSession-CbIAb7KE.js +2721 -0
- package/dist/chunks/poseText-BXUaQWnK.cjs +1 -0
- package/dist/chunks/poseText-pg4cxE8R.js +41 -0
- package/dist/chunks/robotActivationOf-BKoP11GA.js +368 -0
- package/dist/chunks/robotActivationOf-vhmAEc3e.cjs +1 -0
- package/dist/chunks/{robotSafetyOf-99L9ww63.js → robotSafetyOf-BmZMcgc_.js} +2 -2
- package/dist/chunks/robotSafetyOf-CZBuhHgO.cjs +1 -0
- package/dist/chunks/useEveryFrame-D04ygIe7.js +116 -0
- package/dist/chunks/useEveryFrame-NeKiPXY-.cjs +1 -0
- package/dist/chunks/useSmoothedMotionState-B9WO73k0.cjs +1 -0
- package/dist/chunks/useSmoothedMotionState-BSSV8aZN.js +202 -0
- package/dist/components/jogging/JoggingButtons.d.ts +3 -1
- package/dist/components/jogging/JoggingRefusedError.d.ts +19 -0
- package/dist/components/jogging/JoggingStore.d.ts +98 -3
- package/dist/components/jogging/gizmo/JoggingGizmo.d.ts +6 -3
- package/dist/components/jogging/gizmo/RotationHandles.d.ts +3 -3
- package/dist/components/jogging/gizmo/gizmoShared.d.ts +19 -9
- package/dist/components/jogging/holdSafety.d.ts +51 -13
- package/dist/components/jogging/joint/JoggingJointSlider.d.ts +9 -5
- package/dist/components/jogging/joint/useJointJogHold.d.ts +10 -15
- package/dist/components/jogging/useHold.d.ts +17 -13
- package/dist/components/jogging/useJogControls.d.ts +2 -3
- package/dist/components/robotControl/HoldToMoveButton.d.ts +8 -7
- package/dist/components/robotControl/useRobotControlProps.d.ts +6 -0
- package/dist/components/utils/converters.d.ts +0 -2
- package/dist/components/utils/json.d.ts +4 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +1 -0
- package/dist/core.js +78 -73
- package/dist/index.cjs +1 -1
- package/dist/index.js +107 -102
- package/dist/lib/incrementalCartesianMotion.d.ts +2 -2
- package/dist/lib/poseMath.d.ts +51 -0
- package/dist/lib/robotSession/RobotActivation.d.ts +13 -2
- package/dist/lib/robotSession/RobotSession.d.ts +19 -1
- package/dist/nats.cjs +1 -1
- package/dist/nats.js +1 -1
- package/dist/session.cjs +1 -0
- package/dist/session.d.ts +22 -0
- package/dist/session.js +44 -0
- package/package.json +6 -1
- package/dist/chunks/CurrentPoseBar-BeSHwgig.cjs +0 -1
- package/dist/chunks/JoggingGizmo-DCrl2K-_.cjs +0 -1
- package/dist/chunks/JoggingJointSlider-BVFjEQjw.js +0 -406
- package/dist/chunks/JoggingJointSlider-CDiha2Yt.cjs +0 -1
- package/dist/chunks/PoseTransformer-dP4nzrPG.cjs +0 -1
- package/dist/chunks/PoseTransformer-tafab65c.js +0 -454
- package/dist/chunks/RobotControl-BoDDKYfx.cjs +0 -1
- package/dist/chunks/RobotControl-CaEwd0li.js +0 -286
- package/dist/chunks/RobotControlPanel-Ci0S6gMq.cjs +0 -1
- package/dist/chunks/RobotScene-CfVWmw96.cjs +0 -1
- package/dist/chunks/converters-BsXgcxCW.cjs +0 -1
- package/dist/chunks/converters-D9KpJ2HD.js +0 -47
- package/dist/chunks/externalizeComponent-DZTBO-WF.cjs +0 -2
- package/dist/chunks/holdSafety-BtoZ5We3.cjs +0 -1
- package/dist/chunks/holdSafety-Di1GZAWg.js +0 -37
- package/dist/chunks/joggingColors-CuT5u0H8.js +0 -135
- package/dist/chunks/joggingColors-ZDc_2UCp.cjs +0 -1
- package/dist/chunks/loadRobotSession-BVHaTArk.js +0 -4389
- package/dist/chunks/loadRobotSession-qBnF6wdH.cjs +0 -3
- package/dist/chunks/robotActivationOf-BA4cAhGx.js +0 -477
- package/dist/chunks/robotActivationOf-BkIEg_Wq.cjs +0 -1
- package/dist/chunks/robotSafetyOf-BJj1VuJI.cjs +0 -1
- package/dist/chunks/useEveryFrame-CHxg25f4.cjs +0 -1
- package/dist/chunks/useEveryFrame-DAuNawGP.js +0 -155
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ pnpm add @wandelbots/wandelbots-js-react-components \
|
|
|
17
17
|
@wandelbots/mui mobx mobx-react-lite
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
The 3D parts need three.js and React Three Fiber in addition.
|
|
20
|
+
The 3D parts need three.js and React Three Fiber in addition. `/core` has the parts without 3D:
|
|
21
21
|
|
|
22
22
|
```typescript
|
|
23
23
|
import {
|
|
@@ -41,6 +41,8 @@ pnpm add three three-stdlib @react-three/fiber @react-three/drei
|
|
|
41
41
|
|
|
42
42
|
You can also import from the top-level package, but then you'll need to provide all optional dependencies.
|
|
43
43
|
|
|
44
|
+
An app that installs no three.js imports from `/session` and from the entry points of single components instead of `/core`, see [Without three.js or without React](#without-threejs-or-without-react).
|
|
45
|
+
|
|
44
46
|
The parts use the theme of your app. Create it with `createNovaMuiTheme` of `@wandelbots/mui`:
|
|
45
47
|
|
|
46
48
|
```tsx
|
|
@@ -66,7 +68,8 @@ Browse the full icon set at https://wandelbotsgmbh.github.io/nova-design-system/
|
|
|
66
68
|
**Available Entry Points:**
|
|
67
69
|
|
|
68
70
|
- **`.`** (Main) — All components. Requires the peer dependencies of `/core` and `/3d`.
|
|
69
|
-
- **`/core`** — The parts without 3D (jogging, `SafetyBar`, `AppHeader`, `LoadingCover`, `NoMotionGroupModal`), the NOVA connections and `JoggingStore`, the motion state helpers and `i18n`.
|
|
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.
|
|
70
73
|
- **`/3d`** — The 3D parts (`Robot`, `MotionGroupVisualizer`, `SafetyZonesRenderer`, …). Requires in addition three, three-stdlib, @react-three/fiber and @react-three/drei.
|
|
71
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.
|
|
72
75
|
- **`/SafetyBar`** — Only `SafetyBar` (also as the default export).
|
|
@@ -81,6 +84,21 @@ A component's own entry point brings only what that component needs, e.g. `/Jogg
|
|
|
81
84
|
import JoggingJointSlider from "@wandelbots/wandelbots-js-react-components/JoggingJointSlider"
|
|
82
85
|
```
|
|
83
86
|
|
|
87
|
+
### Without three.js or without React
|
|
88
|
+
|
|
89
|
+
- **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
|
+
- **`/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`:
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
import { loadRobotSession } from "@wandelbots/wandelbots-js-react-components/session"
|
|
95
|
+
|
|
96
|
+
const load = loadRobotSession("https://my-instance.wandelbots.io", "0@ur5e")
|
|
97
|
+
const session = await load.ready
|
|
98
|
+
console.log(session.state.displayedTcpPose)
|
|
99
|
+
load.dispose()
|
|
100
|
+
```
|
|
101
|
+
|
|
84
102
|
### Peer dependencies
|
|
85
103
|
|
|
86
104
|
| Package | Version |
|
|
@@ -91,7 +109,7 @@ import JoggingJointSlider from "@wandelbots/wandelbots-js-react-components/Joggi
|
|
|
91
109
|
| `@wandelbots/mui` | ^2 |
|
|
92
110
|
| `mobx` | ^6.13.6 |
|
|
93
111
|
| `mobx-react-lite` | ^4.1.0 |
|
|
94
|
-
| `three` (only `/3d`, `/JoggingGizmo`, `/RobotControlPanel`) | >=0.182 |
|
|
112
|
+
| `three` (only `/3d`, `/JoggingGizmo`, `/RobotControlPanel`, and `/core` until `ConnectedMotionGroup` is removed) | >=0.182 |
|
|
95
113
|
| `three-stdlib` (only `/3d`) | >=2 |
|
|
96
114
|
| `@react-three/fiber` (only `/3d`, `/JoggingGizmo`, `/RobotControlPanel`) | ^9 |
|
|
97
115
|
| `@react-three/drei` (only `/3d`) | ^10 |
|
|
@@ -152,7 +170,7 @@ load.dispose()
|
|
|
152
170
|
What changes besides the names:
|
|
153
171
|
|
|
154
172
|
- **Loading:** `loadRobotSession` returns at once. `load.state` ("loading", "ready", "failed") and `load.progress` tell how far it is, `load.retry()` loads again after a failure, `await load.ready` gives the session. A failed step is retried on its own, after 1 and 2 seconds unless `retryDelaysMs` says otherwise.
|
|
155
|
-
- **Jogging comes with it:** `session.jogging` is the robot's `JoggingStore`. An app no longer opens it with `JoggerConnection.open` and `JoggingStore.loadFor`.
|
|
173
|
+
- **Jogging comes with it:** `session.jogging` is the robot's `JoggingStore`. An app no longer opens it with `JoggerConnection.open` and `JoggingStore.loadFor`. It starts no jog while the robot may not move (`safety.canBeMoved` is false, so also while the robot is activating): the start rejects with a `JoggingRefusedError`.
|
|
156
174
|
- **Nothing happens unasked:** without `storage` the jogging settings are not kept (pass `localStorage` to keep them), and a virtual robot is activated only with `autoActivateVirtual: true`.
|
|
157
175
|
- **Errors:** what the app calls rejects (`session.activation.activate()` with a `RobotModeChangeError`); what fails in the background (a jog, a message of the live state) goes to `onError`.
|
|
158
176
|
- **Several robots:** load one session per robot instead of `ConnectedMotionGroup.connectMultiple`.
|
|
@@ -222,7 +240,7 @@ Manual robot control interfaces.
|
|
|
222
240
|
- **JoggingCartesianAxisControl** - Single-axis cartesian movement
|
|
223
241
|
- **JoggingJointValueControl** - Individual joint controls
|
|
224
242
|
- **VelocitySlider** (and **VelocitySliderLabel**) - Speed adjustment interface
|
|
225
|
-
- **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.
|
|
243
|
+
- **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), it starts no jog: the start rejects with a `JoggingRefusedError`, whose `reason.code` says why.
|
|
226
244
|
|
|
227
245
|
**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.
|
|
228
246
|
|
|
@@ -231,7 +249,9 @@ Manual robot control interfaces.
|
|
|
231
249
|
- `frameQuaternion` of `JoggingGizmo` is the frame the gizmo jogs along, in NOVA's coordinates: by default NOVA's world frame. The app gives it to the gizmo where it picks the frame, e.g. "Move along the axes of: Tool". Only the camera's view comes from the 3D scene. A frame that turns, such as the tool's, can be a function: the gizmo calls it every animation frame.
|
|
232
250
|
- `motion` is `"translate"` (arrows, the default) or `"rotate"`: a circle about each axis with an arc per direction, whose arrowhead shows the way it turns (`+` counterclockwise seen from the tip of the axis). The handles are named as the jog buttons: "Jog X+", or "Jog Rx+" when rotating. A jog that runs when `motion` changes stops.
|
|
233
251
|
- The gizmo moves nothing itself: `onJogStart(axis, direction)` and `onJogStop` leave that to the app, in the frame it jogs in. The app knows its `motion`, so it knows whether to move along the axis or turn about it.
|
|
234
|
-
- A press jogs along the arrow drawn where it lands. Where a press could not tell two handles apart, it jogs neither: an arrow that points (almost) at or away from the viewer, or the farther of two arrowheads drawn over each other.
|
|
252
|
+
- A press jogs along the arrow drawn where it lands. Where a press could not tell two handles apart, it jogs neither: an arrow that points (almost) at or away from the viewer, or the farther of two arrowheads drawn over each other. To jog with such a handle, orbit the view, or use `JoggingButtons`.
|
|
253
|
+
- A jog runs while a pointer holds a handle. It stops when the pointer is let go, wherever that happens, and when the pointer leaves the handle (the bar along its arrow, or the band along its arc and its arrowhead), as RobotPad's jog buttons do. A pointer that comes back without a new press jogs nothing.
|
|
254
|
+
- Only a pointer jogs. A handle is a named button, so the keyboard's focus reaches it, but Space or Enter on it start nothing.
|
|
235
255
|
- When rotating, a press turns the way the arc drawn there points: an arc is grabbed anywhere along it, an arrowhead above everything else. Where two arcs cross, the one drawn nearer there takes the press. An axis seen (almost) edge on, whose arcs lie over each other, takes no press.
|
|
236
256
|
|
|
237
257
|
```tsx
|
|
@@ -255,7 +275,7 @@ const orientation = useRef<Quaternion | null>(null)
|
|
|
255
275
|
/>
|
|
256
276
|
```
|
|
257
277
|
|
|
258
|
-
**JoggingButtons** (from `/core` or `/JoggingButtons`) - Jogging by buttons: a row per axis with a minus and a plus button, held to jog (X-, X+; or Rx-, Rx+ when `motion` is `"rotate"`). It takes the same props as `JoggingGizmo` (`JogControlsProps`: `motion`, `onJogStart`, `onJogStop`, `activeHandle`, `disabled`), so an app wires both the same way and can offer both. Unlike the gizmo, the buttons do not turn with the 3D view: X+ is X+ of the jog frame, wherever the camera looks from. They draw nothing in 3D, so they need no `<Canvas>` and no `JoggingGizmoOrientation`.
|
|
278
|
+
**JoggingButtons** (from `/core` or `/JoggingButtons`) - Jogging by buttons: a row per axis with a minus and a plus button, held to jog (X-, X+; or Rx-, Rx+ when `motion` is `"rotate"`). It takes the same props as `JoggingGizmo` (`JogControlsProps`: `motion`, `onJogStart`, `onJogStop`, `activeHandle`, `disabled`), so an app wires both the same way and can offer both. Unlike the gizmo, the buttons do not turn with the 3D view: X+ is X+ of the jog frame, wherever the camera looks from. They draw nothing in 3D, so they need no `<Canvas>` and no `JoggingGizmoOrientation`. As with the gizmo, a jog stops when the pointer is let go or leaves the button, and only a pointer jogs: the keyboard's focus reaches a button, but Space or Enter on it start nothing.
|
|
259
279
|
|
|
260
280
|
```tsx
|
|
261
281
|
<JoggingButtons
|
|
@@ -269,7 +289,7 @@ const orientation = useRef<Quaternion | null>(null)
|
|
|
269
289
|
/>
|
|
270
290
|
```
|
|
271
291
|
|
|
272
|
-
**JoggingJointSlider** (from `/core` or `/JoggingJointSlider`) - One joint as a slider across its limits, with the thumb at the joint's value and the limits below; an app shows one per joint. Hover the track to see the goal under the pointer, and press there to jog the joint toward it: it stops when it gets there
|
|
292
|
+
**JoggingJointSlider** (from `/core` or `/JoggingJointSlider`) - One joint as a slider across its limits, with the thumb at the joint's value and the limits below; an app shows one per joint. Hover the track to see the goal under the pointer, and press there to jog the joint toward it: it stops when it gets there, when the slider is let go, wherever that happens, or when the pointer leaves the slider (it may stray 8 px off it, so a drag to a limit can overshoot the end of the track). While held, the goal follows the pointer, and the joint turns around when the goal passes it. Only a pointer jogs: the keyboard's focus reaches the slider, which says the joint's value, but an arrow key on it moves nothing.
|
|
273
293
|
|
|
274
294
|
- `value`, `min` and `max` are in NOVA's units: radians, or mm with `linear`. A revolute joint with one limit spans one turn from it, and without limits the turn it stands in. A linear axis needs both limits to be jogged with the slider; without them it only shows its value. `angleUnit` shows degrees (default) or radians.
|
|
275
295
|
- `onJogStart(direction)` and `onJogStop` leave the jogging to the app, as for `JoggingGizmo` and `JoggingButtons`. One press can bring several starts and stops, always in turn: the joint stops at the goal, and starts again when the goal moves on. When the goal passes the joint, `onJogStop` and the `onJogStart` of the other way come in the same event: an app with asynchronous jog commands must apply them in that order, and must not tear down its jogging connection on that stop.
|
|
@@ -313,7 +333,7 @@ const [active, setActive] = useState<number | null>(null)
|
|
|
313
333
|
- `disabled` turns off every control: nothing may move. `jogDisabled` turns off only the jogging of Translate, Rotate and Joint, e.g. while a trajectory moves the robot; Move to stays usable, so a move of its own does not end when the app locks jogging during it.
|
|
314
334
|
- The panel keeps its tab, jog mode and step size itself. An app that keeps them in its own store (to remember them, or because its jogging depends on them) gives `tab`, `jogMode` and `increments.step`, and gets `onTabChange`, `onJogModeChange` and `increments.onStepChange`; each also works alone, to follow a choice without keeping it.
|
|
315
335
|
- `joints` gives the Joint tab: the joints' values and limits (rad, or mm with `linear`), their names, the joint velocity, and `onJogStart(index, direction)` and `onJogStop`. The panel jogs one joint at a time; the turn-around of a slider brings `onJogStop` and `onJogStart` in the same event, as described for `JoggingJointSlider`. Without `joints`, there is no Joint tab.
|
|
316
|
-
- `moveTo` gives the Move to tab. It works as RobotPad's pose field: the coordinates `(x, y, z, rx, ry, rz)` (mm, rotation vector in rad: the format RobotPad copies and pastes) show the TCP's current pose (`getCurrentPose`, read every animation frame), with Copy and Edit pose, and Move to, off until a pose is the target. Edit pose, or a click on the field, makes it editable; Save pose edit (Enter) makes the typed pose the target (`onTargetChange(pose)`): the app plans the move and loads it, and reports `state` (`"planning"`, `"planned"`, `"moving"`, `"stopping"` or `"idle"`, as RobotPad's trajectory) and an `error` (e.g. out of reach). Then Reset shows. Held for 200 ms while `"planned"`, Move to calls `onMoveStart(pose)
|
|
336
|
+
- `moveTo` gives the Move to tab. It works as RobotPad's pose field: the coordinates `(x, y, z, rx, ry, rz)` (mm, rotation vector in rad: the format RobotPad copies and pastes) show the TCP's current pose (`getCurrentPose`, read every animation frame), with Copy and Edit pose, and Move to, off until a pose is the target. Edit pose, or a click on the field, makes it editable; Save pose edit (Enter) makes the typed pose the target (`onTargetChange(pose)`): the app plans the move and loads it, and reports `state` (`"planning"`, `"planned"`, `"moving"`, `"stopping"` or `"idle"`, as RobotPad's trajectory) and an `error` (e.g. out of reach). Then Reset shows. Held with a pointer for 200 ms while `"planned"`, Move to calls `onMoveStart(pose)`; the release, or the pointer leaving the button, calls `onMoveStop`: the app starts and pauses its trajectory (the keyboard starts no move); the button says Moving… and Stopping…. At the target (within 0.5 mm and 0.01 rad) it turns off; once the move no longer runs, the field shows the current pose again (`onTargetChange(null)`), as do Reset, another tab and another TCP or frame (a held move gets its `onMoveStop` first). While another pose is typed, Move to stays off. `frame` is the "Relative to" select. It moves with `velocity.translate`. Without `moveTo`, there is no Move to tab.
|
|
317
337
|
|
|
318
338
|
```tsx
|
|
319
339
|
const orientation = useRef<Quaternion | null>(null)
|
package/dist/3d.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/Robot-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/Robot-v8trFpVT.cjs"),o=require("./chunks/RobotScene-ztJZ4EKT.cjs"),a=require("./chunks/JoggingGizmo-B84rMNKl.cjs"),s=require("./chunks/JoggingGizmoOrientation-BrI3aOMk.cjs"),u=require("./chunks/RobotControlPanel-69F3kOBc.cjs"),r=require("./chunks/RobotControl-CD9PKmrE.cjs"),n=require("./chunks/RobotView-wketM8bf.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;
|
package/dist/3d.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { C as a, J as t, L as r, R as s, T as n } from "./chunks/Robot-
|
|
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-
|
|
3
|
-
import { J as N } from "./chunks/JoggingGizmo-
|
|
4
|
-
import { J as V } from "./chunks/JoggingGizmoOrientation-
|
|
5
|
-
import { R as C } from "./chunks/RobotControlPanel-
|
|
6
|
-
import { R as z, u as j } from "./chunks/RobotControl-
|
|
7
|
-
import { R as D, a as U } from "./chunks/RobotView-
|
|
8
|
-
import { V as k, a as q } from "./chunks/
|
|
1
|
+
import { C as a, J as t, L as r, R as s, T as n } from "./chunks/Robot-B1j3VKwk.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-CldpfxRT.js";
|
|
3
|
+
import { J as N } from "./chunks/JoggingGizmo-CZagy8VY.js";
|
|
4
|
+
import { J as V } from "./chunks/JoggingGizmoOrientation-C0Ip0s33.js";
|
|
5
|
+
import { R as C } from "./chunks/RobotControlPanel-6HBz7oke.js";
|
|
6
|
+
import { R as z, u as j } from "./chunks/RobotControl-C7c6MWyL.js";
|
|
7
|
+
import { R as D, a as U } from "./chunks/RobotView-BTL3FAIE.js";
|
|
8
|
+
import { V as k, a as q } from "./chunks/useSmoothedMotionState-BSSV8aZN.js";
|
|
9
9
|
import { P as y, p as X, q as Q } from "./chunks/Pose3-B_fLR-Wv.js";
|
|
10
10
|
export {
|
|
11
11
|
a as CollisionSceneRenderer,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../chunks/CurrentPose-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../chunks/CurrentPose-B2k1YoBx.cjs"),o=require("../chunks/RobotSessionProvider--AekyPqD.cjs");exports.CurrentPose=e.CurrentPose;exports.default=e.CurrentPose;exports.useCurrentPoseProps=e.useCurrentPoseProps;exports.RobotSessionProvider=o.RobotSessionProvider;exports.useRobotSession=o.useRobotSession;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../chunks/CurrentPoseBar-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../chunks/CurrentPoseBar-C4wB482_.cjs");exports.CurrentPoseBar=e.CurrentPoseBar;exports.default=e.CurrentPoseBar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../chunks/JoggingButtons-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../chunks/JoggingButtons-CDs_NWPT.cjs");exports.JoggingButtons=t.JoggingButtons;exports.default=t.JoggingButtons;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../chunks/JoggingGizmo-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../chunks/JoggingGizmo-B84rMNKl.cjs"),o=require("../chunks/JoggingGizmoOrientation-BrI3aOMk.cjs");exports.JoggingGizmo=i.JoggingGizmo;exports.default=i.JoggingGizmo;exports.JoggingGizmoOrientation=o.JoggingGizmoOrientation;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { J as i, J as a } from "../chunks/JoggingGizmo-
|
|
2
|
-
import { J as t } from "../chunks/JoggingGizmoOrientation-
|
|
1
|
+
import { J as i, J as a } from "../chunks/JoggingGizmo-CZagy8VY.js";
|
|
2
|
+
import { J as t } from "../chunks/JoggingGizmoOrientation-C0Ip0s33.js";
|
|
3
3
|
export {
|
|
4
4
|
i as JoggingGizmo,
|
|
5
5
|
t as JoggingGizmoOrientation,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../chunks/JoggingJointSlider-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../chunks/JoggingJointSlider-xz725ItY.cjs");exports.JoggingJointSlider=e.JoggingJointSlider;exports.default=e.JoggingJointSlider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../chunks/RobotControl-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../chunks/RobotControl-CD9PKmrE.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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../chunks/RobotControlPanel-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../chunks/RobotControlPanel-69F3kOBc.cjs");exports.RobotControlPanel=o.RobotControlPanel;exports.default=o.RobotControlPanel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../chunks/robotActivationOf-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../chunks/robotActivationOf-vhmAEc3e.cjs"),t=require("../chunks/robotSafetyOf-CZBuhHgO.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,5 +1,5 @@
|
|
|
1
|
-
import { C as n,
|
|
2
|
-
import { r as s } from "../chunks/robotSafetyOf-
|
|
1
|
+
import { C as n, R as r, c as t, R as e, r as f } from "../chunks/robotActivationOf-BKoP11GA.js";
|
|
2
|
+
import { r as s } from "../chunks/robotSafetyOf-BmZMcgc_.js";
|
|
3
3
|
export {
|
|
4
4
|
n as ConnectionWarning,
|
|
5
5
|
r as RobotHeader,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../chunks/RobotScene-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../chunks/RobotScene-ztJZ4EKT.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;
|
package/dist/RobotScene/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as s, R as a, e as t, R, u as r } from "../chunks/RobotScene-
|
|
1
|
+
import { b as s, R as a, e as t, R, u as r } from "../chunks/RobotScene-CldpfxRT.js";
|
|
2
2
|
import { R as n, u as i } from "../chunks/RobotSessionProvider-TVaKGzqa.js";
|
|
3
3
|
export {
|
|
4
4
|
s as JoggingAxes,
|
package/dist/RobotView/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../chunks/RobotView-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../chunks/RobotView-wketM8bf.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;
|
package/dist/RobotView/index.js
CHANGED
package/dist/SafetyBar/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../chunks/robotSafetyOf-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../chunks/robotSafetyOf-CZBuhHgO.cjs");exports.SafetyBar=e.SafetyBar;exports.default=e.SafetyBar;exports.robotSafetyOf=e.robotSafetyOf;
|
package/dist/SafetyBar/index.js
CHANGED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),fe=require("@mui/material/AppBar"),ae=require("@mui/material/Backdrop"),O=require("@mui/material/Box"),be=require("@mui/material/Menu"),q=require("@mui/material/MenuItem"),ve=require("@mui/material/Toolbar"),y=require("@mui/material/Typography"),je=require("@wandelbots/design-tokens"),ye=require("@wandelbots/icons/ExpandMoreFilled"),Ce=require("@wandelbots/mui"),S=require("mobx-react-lite"),v=require("react"),W=require("./externalizeComponent-BW1UV6Gh.cjs"),Se=require("@mui/icons-material/OpenWith"),we=require("@mui/icons-material/Share"),b=require("@mui/material/Stack"),Me=require("@mui/material/Tab"),Te=require("@mui/material/Tabs"),C=require("mobx"),A=require("react-i18next"),H=require("./loadRobotSession-Br55rLAm.cjs"),se=require("@mui/material/CircularProgress"),Ee=require("@mui/material/utils"),Ie=require("lodash-es"),Je=require("./robotSafetyOf-CZBuhHgO.cjs"),ke=require("@mui/material/Alert"),Re=require("@mui/material/AlertTitle"),K=require("@mui/material/Button"),V=require("@mui/material/styles"),D=require("@mui/material/Divider"),oe=require("@mui/material/ToggleButton"),_=require("@wandelbots/nova-js"),Z=require("@mui/material/IconButton"),ee=require("./useSmoothedMotionState-B9WO73k0.cjs"),$=require("./joggingColors-Cqpfuw4G.cjs"),_e=require("lodash-es/isEqual.js"),Ae=require("@mui/material/InputAdornment"),Pe=require("@mui/material/FormControl"),Oe=require("@mui/material/InputLabel"),Ve=require("@mui/material/Select"),Le=require("@mui/material/ToggleButtonGroup"),le=require("@mui/material/Slider"),qe=require("lodash-es/isNumber.js"),U=require("@wandelbots/nova-js/v2"),De=require("@mui/icons-material/ChevronLeft"),$e=require("@mui/icons-material/ChevronRight"),Be=require("lodash-es/throttle.js"),ze=require("@mui/material/Dialog"),Fe=require("@mui/material/DialogActions"),Ne=require("@mui/material/DialogContent"),Ge=require("@mui/material/DialogTitle"),He=require("three"),G=require("./PoseTransformer-C_EfofnJ.cjs");function ce(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=ce(v),ie=ce(He),We=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(fe,{position:"static",sx:{boxShadow:"none",backgroundImage:"none","& .MuiAppBar-root":{backgroundImage:"none",backgroundColor:"transparent"},...d},children:t.jsxs(ve,{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(Ce.RoundedIconButton,{icon:t.jsx(ye.ExpandMoreFilled,{size:20}),ariaLabel:"switch app","aria-controls":"app-menu","aria-haspopup":"true",onClick:j,disabled:l,sx:{ml:1}})]})]})}),t.jsx(ae,{open:p,onClick:u,sx:{backdropFilter:"blur(4px)",backgroundColor:je.ZeroGravityComponentsBackdropFill,zIndex:s=>s.zIndex.modal-1}}),t.jsx(be,{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(q,{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))})]})})),Ue=({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"}))),Ye=v.forwardRef(Ue),Ze=({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"})))),Xe=v.forwardRef(Ze),Q=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;ee.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(Ye,{})}),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(Xe,{})})]})})),de=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,ne;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=Be(()=>{const x=a?h(l()):l();(x===void 0||p===void 0||Math.abs(p-x)>1e-9)&&j(x)},50);ee.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(De,{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(le,{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:(ne=u.palette.backgroundPaperElevation)==null?void 0:ne[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($e,{sx:{pointerEvents:"none",color:$.jointArrowColor}})})]})})),ge=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(ue,{loadingMessage:e.message,error:e.error}):t.jsxs(t.Fragment,{children:[t.jsx(se,{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..."})]})})},ue=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 ${Ie.lowerFirst(Ee.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})]})},Ke=S.observer(({store:e})=>{const{t:n}=A.useTranslation();return t.jsx(ae,{"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(K,{variant:"contained",color:"secondary",onClick:()=>e.unblock(),children:n("Jogging.Blocked.Reenable.bt")})]})})}),Qe=({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"})),et=v.forwardRef(Qe),tt=({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"})),nt=v.forwardRef(tt),ot=({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"})),it=v.forwardRef(ot),rt=({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"})),at=v.forwardRef(rt),pe=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);ee.useAnimationFrame(()=>{const d=e.jogger.motionStream.rapidlyChangingMotionState.joint_limit_reached.limit_reached;_e(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(", ")})})})}),st=V.styled(Pe)(({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(st,{fullWidth:!0,variant:"filled",children:[t.jsx(Oe,{id:n.labelId,children:e}),t.jsx(Ve,{...n})]})}const lt=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(q,{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(Ae,{position:"end",children:t.jsx(se,{size:16})}):void 0,children:e.tcps.map(r=>t.jsx(q,{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(q,{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(q,{value:"continuous",children:o("Jogging.Increment.Continuous.dd")},"continuous"),e.discreteIncrementOptions.map(r=>t.jsx(q,{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))})}),ct=V.styled(Le)(({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"}}}}}),he=W.externalizeComponent(S.observer(e=>{const{store:n}=e,{t:o}=A.useTranslation();function i(a,l){l===e.velocity||!qe(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(le,{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(te,{value:e.velocity.toString()}))]})}));function te({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 xe=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(he,{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(te,{value:i(a,n),sx:{minWidth:"111px",span:{transform:"translateY(-1.5px)"}}})})}),me=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`)})]})}),dt=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(et,{}),colors:$.cartesianAxisColors.X},{id:"y",icon:t.jsx(nt,{}),colors:$.cartesianAxisColors.Y},{id:"z",icon:t.jsx(it,{}),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(lt,{store:e,useDegree:e.selectedCartesianMotionType==="rotate"}),t.jsx(xe,{store:e,useDegree:e.selectedCartesianMotionType==="rotate"}),t.jsx(D,{})]}),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(ct,{value:e.selectedCartesianMotionType,onChange:l,exclusive:!0,"aria-label":o("Jogging.Cartesian.MotionType.lb"),sx:{justifyContent:"center"},children:[t.jsx(oe,{value:"translate",children:o("Jogging.Cartesian.Translation.bt")}),t.jsx(oe,{value:"rotate",children:o("Jogging.Cartesian.Rotation.bt")})]}),e.selectedCartesianMotionType==="translate"&&p.map(c=>{var s,m;return t.jsx(Q,{"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(Q,{"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(at,{}),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(pe,{store:e}),t.jsx(D,{}),t.jsx(me,{store:e}),n&&t.jsx(D,{}),n]})}),gt=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(xe,{store:e,useDegree:e.jointType===U.JointTypeEnum.RevoluteJoint}),t.jsx(D,{}),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(de,{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(pe,{store:e}),t.jsx(D,{}),t.jsx(me,{store:e}),n&&t.jsx(D,{}),n]})}),ut=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;o&&(e.locked?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(pt,{store:n.joggingStore,children:e.children}):t.jsx(ge,{message:"Loading jogging",error:n.loadingError})})})),pt=S.observer(({store:e,children:n})=>{const{t:o}=A.useTranslation();function i(){if(e.currentTab.id==="cartesian")return t.jsx(dt,{store:e,children:n});if(e.currentTab.id==="joint")return t.jsx(gt,{store:e,children:n})}return t.jsxs(b,{flexGrow:1,sx:{overflow:"hidden"},children:[t.jsx(Te,{"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(Se,{fontSize:"small",sx:{mr:1}}):t.jsx(we,{fontSize:"small",sx:{mr:1}});return t.jsx(Me,{"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(Ke,{store:e})]})});function ht(){const e=window.location.href;return e.substring(0,e.indexOf("/",e.indexOf("//")+2))}function xt({baseUrl:e=ht(),...n}){return t.jsxs(ze,{"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(Ge,{id:"no-motion-group-modal-title",children:"No motion group found"}),t.jsxs(Ne,{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(Fe,{children:t.jsxs(b,{width:"100%",maxWidth:"300px",margin:"auto",marginBottom:"2rem",children:[t.jsx(K,{href:`${e}/settings`,variant:"contained",sx:{borderRadius:"8px",width:"100%"},children:"Go to settings app"}),t.jsx(K,{href:`${e}`,variant:"text",sx:{marginTop:"1rem",color:"#fff",textDecoration:"underline",fontSize:"0.75rem"},children:"Back to Homescreen"})]})})]})}const re=1e-4,mt={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,re)||C.runInAction(()=>{this.rapidlyChangingMotionState.joint_position=s.joint_position}),H.tcpMotionEqual(this.rapidlyChangingMotionState,s,re)||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=>({...mt,...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 ie.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 ie.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=We;exports.ConnectedMotionGroup=X;exports.JoggingCartesianAxisControl=Q;exports.JoggingJointValueControl=de;exports.JoggingPanel=ut;exports.LoadingCover=ge;exports.LoadingErrorMessage=ue;exports.NoMotionGroupModal=xt;exports.VelocitySlider=he;exports.VelocitySliderLabel=te;
|