@wandelbots/wandelbots-js-react-components 6.4.0-pr.revamp.667.4ee5f82 → 6.4.0-pr.revamp.667.58dae5c
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 +33 -176
- package/dist/3d.cjs +1 -1
- package/dist/3d.d.ts +3 -2
- package/dist/3d.js +35 -31
- package/dist/CurrentPose/index.js +1 -1
- package/dist/CurrentPoseBar/index.js +1 -1
- package/dist/RobotControl/index.cjs +1 -1
- package/dist/RobotControl/index.js +1 -1
- package/dist/RobotControlPanel/index.js +1 -1
- package/dist/RobotHeader/index.js +1 -1
- package/dist/RobotScene/index.cjs +1 -1
- package/dist/RobotScene/index.js +3 -3
- package/dist/RobotView/index.cjs +1 -1
- package/dist/RobotView/index.js +1 -1
- package/dist/chunks/{ConnectedMotionGroup-CjhZTmlT.js → ConnectedMotionGroup-B8GUihu0.js} +1 -1
- package/dist/chunks/{ConnectedMotionGroup-770Xppk7.cjs → ConnectedMotionGroup-Df8Igvna.cjs} +1 -1
- package/dist/chunks/{CurrentPose-jTdJrjYe.js → CurrentPose-N5MWQHi8.js} +1 -1
- package/dist/chunks/{CurrentPoseBar--HkZBGnN.js → CurrentPoseBar-DGW1vpUW.js} +10 -10
- package/dist/chunks/{Pose3-DWxfC6Dj.js → Pose3-B_fLR-Wv.js} +2 -1
- package/dist/chunks/Pose3-Ch4xVeXV.cjs +1 -0
- package/dist/chunks/{Robot-DzVgWIyl.js → Robot-DBZdSKsG.js} +5 -5
- package/dist/chunks/{Robot-BI3OpLBC.cjs → Robot-DIJbjjSt.cjs} +1 -1
- package/dist/chunks/{RobotActivation-CXUp6Szs.js → RobotActivation-D5SPSBED.js} +0 -1
- package/dist/chunks/{RobotControl-Un5D1r8T.js → RobotControl-BdJ7RAAo.js} +2 -2
- package/dist/chunks/{RobotControl-Do-oagek.cjs → RobotControl-CscCNoSM.cjs} +1 -1
- package/dist/chunks/{RobotControlPanel-CxTEIelh.js → RobotControlPanel-D5ke3Ntx.js} +1 -1
- package/dist/chunks/{RobotScene-C1DNfxXU.js → RobotScene-DWFKwcNM.js} +112 -103
- package/dist/chunks/RobotScene-Dc7UpxxA.cjs +1 -0
- package/dist/chunks/{RobotView-KFlt_Isi.cjs → RobotView-BemOONOj.cjs} +1 -1
- package/dist/chunks/{RobotView-Cx_eOS9N.js → RobotView-CfOUuvEc.js} +1 -1
- package/dist/chunks/{loadRobotSession-IuZ-zs8x.js → loadRobotSession-DWixPw7W.js} +38 -81
- package/dist/chunks/loadRobotSession-qoLKP8Hu.cjs +1 -0
- package/dist/chunks/{poseText-BxG4Caa-.js → poseText-CX7mvWIB.js} +4 -4
- package/dist/chunks/{robotActivationOf-SqnXGdFY.js → robotActivationOf-CY-F1A3W.js} +1 -1
- package/dist/components/VelocitySlider.d.ts +1 -14
- package/dist/components/connectionWarning/ConnectionWarning.d.ts +1 -1
- package/dist/components/connectionWarning/connectionWarningOf.d.ts +1 -8
- package/dist/components/jogging/JoggingCartesianAxisControl.d.ts +1 -7
- package/dist/components/jogging/JoggingCartesianTab.d.ts +0 -6
- package/dist/components/jogging/JoggingJointTab.d.ts +0 -5
- package/dist/components/jogging/JoggingJointValueControl.d.ts +1 -7
- package/dist/components/jogging/JoggingPanel.d.ts +0 -11
- package/dist/components/jogging/JoggingStore.d.ts +8 -85
- package/dist/components/jogging/joggingColors.d.ts +0 -6
- package/dist/components/robotHeader/robotActivationOf.d.ts +0 -5
- package/dist/components/robotHeader/robotSafetyOf.d.ts +1 -8
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +5 -5
- package/dist/core.js +71 -64
- package/dist/index.cjs +1 -1
- package/dist/index.js +111 -100
- package/dist/lib/ConnectedMotionGroup.d.ts +0 -11
- package/dist/lib/ControllerStateStream.d.ts +8 -3
- package/dist/lib/MotionStreamConnection.d.ts +2 -3
- package/dist/lib/TrajectoryExecutionStore.d.ts +1 -0
- package/dist/lib/controllerStateSource.d.ts +5 -6
- package/dist/lib/robotSession/RobotActivation.d.ts +13 -0
- package/dist/lib/robotSession/loadRobotSession.d.ts +1 -1
- package/dist/session.cjs +1 -1
- package/dist/session.d.ts +5 -5
- package/dist/session.js +33 -26
- package/package.json +1 -22
- package/dist/chunks/Pose3-BfBNPRDM.cjs +0 -1
- package/dist/chunks/RobotScene-hUDf_S6f.cjs +0 -1
- package/dist/chunks/loadRobotSession-BRuiCc0r.cjs +0 -1
package/README.md
CHANGED
|
@@ -17,13 +17,11 @@ 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
|
-
|
|
22
20
|
The 3D parts need three.js and React Three Fiber in addition. `/core` has the parts without 3D:
|
|
23
21
|
|
|
24
22
|
```typescript
|
|
25
23
|
import {
|
|
26
|
-
|
|
24
|
+
JoggingPanel,
|
|
27
25
|
SafetyBar,
|
|
28
26
|
} from "@wandelbots/wandelbots-js-react-components/core"
|
|
29
27
|
```
|
|
@@ -70,23 +68,15 @@ Browse the full icon set at https://wandelbotsgmbh.github.io/nova-design-system/
|
|
|
70
68
|
**Available Entry Points:**
|
|
71
69
|
|
|
72
70
|
- **`.`** (Main) — All components. Requires the peer dependencies of `/core` and `/3d`.
|
|
73
|
-
- **`/core`** — The parts without 3D (jogging, `
|
|
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.
|
|
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.
|
|
75
73
|
- **`/3d`** — The 3D parts (`Robot`, `MotionGroupVisualizer`, `SafetyZonesRenderer`, …). Requires in addition three, three-stdlib, @react-three/fiber and @react-three/drei.
|
|
76
|
-
- **`/nats`** — A robot's live controller state over NOVA's NATS server (`natsControllerStateSource`, `natsUrlOf`)
|
|
77
|
-
- **`/SafetyBar`** — Only `SafetyBar` (also as the default export)
|
|
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).
|
|
78
76
|
- **`/JoggingGizmo`** — Only `JoggingGizmo` (also as the default export) and `JoggingGizmoOrientation`. Requires in addition three and @react-three/fiber.
|
|
79
77
|
- **`/JoggingButtons`** — Only `JoggingButtons` (also as the default export). No 3D packages needed.
|
|
80
78
|
- **`/JoggingJointSlider`** — Only `JoggingJointSlider` (also as the default export). No 3D packages needed.
|
|
81
79
|
- **`/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`.
|
|
90
80
|
|
|
91
81
|
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:
|
|
92
82
|
|
|
@@ -98,49 +88,32 @@ import JoggingJointSlider from "@wandelbots/wandelbots-js-react-components/Joggi
|
|
|
98
88
|
|
|
99
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`.
|
|
100
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.
|
|
101
|
-
- **An app without React**, or with a UI of its own, uses `/session` alone (and `/nats`). Of the peer dependencies it
|
|
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`:
|
|
102
92
|
|
|
103
93
|
```typescript
|
|
104
|
-
import { autorun } from "mobx"
|
|
105
94
|
import { loadRobotSession } from "@wandelbots/wandelbots-js-react-components/session"
|
|
106
95
|
|
|
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
|
|
96
|
+
const load = loadRobotSession("https://my-instance.wandelbots.io", "0@ur5e")
|
|
111
97
|
const session = await load.ready
|
|
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()
|
|
98
|
+
console.log(session.state.displayedTcpPose)
|
|
124
99
|
load.dispose()
|
|
125
100
|
```
|
|
126
101
|
|
|
127
102
|
### Peer dependencies
|
|
128
103
|
|
|
129
|
-
| Package | Version |
|
|
130
|
-
| --- | --- |
|
|
131
|
-
| `
|
|
132
|
-
|
|
|
133
|
-
| `@
|
|
134
|
-
| `@
|
|
135
|
-
|
|
|
136
|
-
| `mobx-react-lite` | ^4.1.0 |
|
|
137
|
-
| `three`
|
|
138
|
-
|
|
|
139
|
-
|
|
|
140
|
-
| `@react-three/drei`
|
|
141
|
-
| `nats.ws` | ^1.30.3 |
|
|
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.
|
|
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 |
|
|
144
117
|
|
|
145
118
|
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.
|
|
146
119
|
|
|
@@ -225,40 +198,6 @@ What changes besides the names:
|
|
|
225
198
|
| `dispose()` | `load.dispose()`, or `session.dispose()` |
|
|
226
199
|
| `<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`). |
|
|
227
200
|
|
|
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
|
-
|
|
262
201
|
### 4.x Core Changes
|
|
263
202
|
|
|
264
203
|
Robot data is now fetched from a running nova instance. This eliminates the need of shipping every react application with the robot data attached.
|
|
@@ -291,9 +230,18 @@ Breaking changes for each major version are documented in the [GitHub Releases](
|
|
|
291
230
|
|
|
292
231
|
Manual robot control interfaces.
|
|
293
232
|
|
|
294
|
-
**JoggingPanel**
|
|
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**
|
|
295
240
|
|
|
296
|
-
**
|
|
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.
|
|
297
245
|
|
|
298
246
|
**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.
|
|
299
247
|
|
|
@@ -430,97 +378,6 @@ const orientation = useRef<Quaternion | null>(null)
|
|
|
430
378
|
/>
|
|
431
379
|
```
|
|
432
380
|
|
|
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
|
-
|
|
524
381
|
### 3D Visualization & Robotics
|
|
525
382
|
|
|
526
383
|
3D components for robot visualization. They render inside the `<Canvas>` of React Three Fiber.
|
|
@@ -569,7 +426,7 @@ Safety components for production environments.
|
|
|
569
426
|
|
|
570
427
|
### Logic
|
|
571
428
|
|
|
572
|
-
- **loadRobotSession** and **RobotSession** - A robot of a cell, loaded and connected: its description, live state, safety, activation, jogging and Move to
|
|
429
|
+
- **loadRobotSession** and **RobotSession** - A robot of a cell, loaded and connected: its description, live state, safety, activation, jogging and Move to
|
|
573
430
|
- **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`)
|
|
574
431
|
- **ConnectedMotionGroup** (deprecated, see [From ConnectedMotionGroup to RobotSession](#from-connectedmotiongroup-to-robotsession)) - A motion group with its live motion state, safety state and operation mode
|
|
575
432
|
- **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-
|
|
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;
|
package/dist/3d.d.ts
CHANGED
|
@@ -20,11 +20,12 @@ 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 {
|
|
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";
|
|
24
25
|
export { type RobotModelSource, robotModelOf, } from "./components/robots/robotModelSource";
|
|
25
26
|
export * from "./components/robots/SupportedLinearAxis";
|
|
26
27
|
export * from "./components/robots/SupportedRobot";
|
|
27
28
|
export { ValueInterpolator, type InterpolationOptions, } from "./components/utils/interpolation";
|
|
28
29
|
export * from "./components/utils/useSmoothedMotionState";
|
|
29
30
|
export { Pose3 } from "./lib/Pose3";
|
|
30
|
-
export { parseRotationToQuaternion } from "./lib/rotation";
|
|
31
|
+
export { parseRotationToQuaternion, quaternionToRotationVector, } from "./lib/rotation";
|
package/dist/3d.js
CHANGED
|
@@ -1,44 +1,48 @@
|
|
|
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
|
|
3
|
-
import { J as
|
|
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";
|
|
4
4
|
import { J as V } from "./chunks/JoggingGizmoOrientation-Dzzz2gEz.js";
|
|
5
|
-
import { R as
|
|
6
|
-
import { R as
|
|
7
|
-
import { R as
|
|
8
|
-
import { V as
|
|
9
|
-
import { P as
|
|
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";
|
|
10
10
|
export {
|
|
11
11
|
a as CollisionSceneRenderer,
|
|
12
12
|
p as FLANGE_NODE_SUFFIX,
|
|
13
|
-
R as
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
R as JOINT_NODE_NAME,
|
|
14
|
+
l as JOINT_REST_SUFFIX,
|
|
15
|
+
u as JoggingAxes,
|
|
16
|
+
N as JoggingGizmo,
|
|
16
17
|
V as JoggingGizmoOrientation,
|
|
17
18
|
t as JointLimitGizmo,
|
|
18
19
|
r as LinearAxis,
|
|
19
|
-
|
|
20
|
-
m as
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
x as MODEL_ROTATION,
|
|
21
|
+
m as MotionGroupVisualizer,
|
|
22
|
+
S as MotionGroupVisualizerExact,
|
|
23
|
+
y as Pose3,
|
|
24
|
+
d as PresetEnvironment,
|
|
23
25
|
s as Robot,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
D as RobotCanvas,
|
|
27
|
+
z as RobotControl,
|
|
28
|
+
C as RobotControlPanel,
|
|
27
29
|
f as RobotScene,
|
|
28
30
|
b as RobotSceneView,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
U as RobotView,
|
|
32
|
+
c as SafetyZonesRenderer,
|
|
33
|
+
g as SupportedLinearAxis,
|
|
34
|
+
E as SupportedLinearAxisExact,
|
|
35
|
+
J as SupportedRobot,
|
|
36
|
+
O as SupportedRobotExact,
|
|
35
37
|
n as TrajectoryRenderer,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
k as ValueInterpolator,
|
|
39
|
+
M as defaultGetModel,
|
|
40
|
+
T as jointIndexOf,
|
|
39
41
|
X as parseRotationToQuaternion,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
Q as quaternionToRotationVector,
|
|
43
|
+
A as revokeAllModelUrls,
|
|
44
|
+
G as robotModelOf,
|
|
45
|
+
j as useRobotControlProps,
|
|
46
|
+
I as useRobotSceneProps,
|
|
47
|
+
q as useSmoothedMotionState
|
|
44
48
|
};
|
|
@@ -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-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,4 +1,4 @@
|
|
|
1
|
-
import { C as n, R as r, c as t, R as e, r as f } from "../chunks/robotActivationOf-
|
|
1
|
+
import { C as n, R as r, c as t, R as e, r as f } from "../chunks/robotActivationOf-CY-F1A3W.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-
|
|
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;
|
package/dist/RobotScene/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { R as
|
|
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";
|
|
3
3
|
export {
|
|
4
4
|
s as JoggingAxes,
|
|
5
5
|
a as RobotScene,
|
|
6
6
|
t as RobotSceneView,
|
|
7
|
-
|
|
7
|
+
n as RobotSessionProvider,
|
|
8
8
|
R as default,
|
|
9
9
|
r as useRobotSceneProps,
|
|
10
10
|
i as useRobotSession
|
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-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;
|
package/dist/RobotView/index.js
CHANGED
|
@@ -20,7 +20,7 @@ import Rt from "@mui/material/Tab";
|
|
|
20
20
|
import _t from "@mui/material/Tabs";
|
|
21
21
|
import { runInAction as w, makeAutoObservable as Pt } from "mobx";
|
|
22
22
|
import { useTranslation as _ } from "react-i18next";
|
|
23
|
-
import { O as Ot, J as At, a as Vt, n as Dt, t as Lt } from "./loadRobotSession-
|
|
23
|
+
import { O as Ot, J as At, a as Vt, n as Dt, t as Lt } from "./loadRobotSession-DWixPw7W.js";
|
|
24
24
|
import mt from "@mui/material/CircularProgress";
|
|
25
25
|
import { capitalize as $t } from "@mui/material/utils";
|
|
26
26
|
import { throttle as Bt, lowerFirst as zt, isEqual as Ft, isNumber as Nt } from "lodash-es";
|