@wandelbots/wandelbots-js-react-components 6.4.0-pr.feat-robot-scene.675.88221e7 → 6.4.0-pr.feat-robot-session.672.4c8affa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/README.md +37 -346
  2. package/dist/3d.cjs +1 -1
  3. package/dist/3d.d.ts +1 -11
  4. package/dist/3d.js +19 -38
  5. package/dist/CurrentPoseBar/index.cjs +1 -1
  6. package/dist/CurrentPoseBar/index.js +1 -1
  7. package/dist/JoggingButtons/index.cjs +1 -1
  8. package/dist/JoggingButtons/index.js +1 -1
  9. package/dist/JoggingGizmo/index.cjs +1 -1
  10. package/dist/JoggingGizmo/index.js +4 -5
  11. package/dist/JoggingJointSlider/index.cjs +1 -1
  12. package/dist/JoggingJointSlider/index.js +1 -1
  13. package/dist/SafetyBar/IndicatorWithExplanation.d.ts +1 -12
  14. package/dist/SafetyBar/SafetyBar.d.ts +1 -15
  15. package/dist/SafetyBar/index.cjs +1 -1
  16. package/dist/SafetyBar/index.js +1 -1
  17. package/dist/chunks/ConnectedMotionGroup-B0Uwa4bj.cjs +3 -0
  18. package/dist/chunks/{ConnectedMotionGroup-w7OdiMx3.js → ConnectedMotionGroup-DqNrk4EC.js} +6 -6
  19. package/dist/chunks/CurrentPoseBar-Cbz4AO36.cjs +1 -0
  20. package/dist/chunks/CurrentPoseBar-CpwvWpEY.js +619 -0
  21. package/dist/chunks/{JoggingButtons-BOhdgvmu.js → JoggingButtons-i8FdMpCx.js} +2 -2
  22. package/dist/chunks/{JoggingButtons-DVneahs7.cjs → JoggingButtons-paQCBXf4.cjs} +1 -1
  23. package/dist/chunks/JoggingGizmoOrientation-CKZeLcMp.js +893 -0
  24. package/dist/chunks/JoggingGizmoOrientation-EPtBeAun.cjs +1 -0
  25. package/dist/chunks/{JoggingJointSlider-CEPotMXL.js → JoggingJointSlider-DQhJOmcc.js} +1 -1
  26. package/dist/chunks/{JoggingJointSlider-Dxx25dRP.cjs → JoggingJointSlider-YcEBMgF1.cjs} +1 -1
  27. package/dist/chunks/Pose3-Ci1bxEvz.js +1373 -0
  28. package/dist/chunks/Pose3-DwMOSTKO.cjs +1 -0
  29. package/dist/chunks/{SafetyBar-CuiBrASn.js → SafetyBar-CPrW4dgw.js} +210 -248
  30. package/dist/chunks/SafetyBar-DhbaN3R5.cjs +1 -0
  31. package/dist/chunks/{externalizeComponent-DoU__DJr.js → externalizeComponent-7OVHUIUh.js} +53 -175
  32. package/dist/chunks/externalizeComponent-B0n_tR3v.cjs +2 -0
  33. package/dist/chunks/{joggingColors-sb6IFdj2.js → joggingColors-BKRoSGQu.js} +1 -2
  34. package/dist/chunks/joggingColors-BkPm75Hr.cjs +1 -0
  35. package/dist/chunks/{loadRobotSession-idr-T7pU.js → loadRobotSession-Bt1-Brjp.js} +1076 -596
  36. package/dist/chunks/loadRobotSession-DHVuK_pj.cjs +1 -0
  37. package/dist/chunks/novaConnection-BTSIgWd1.cjs +1 -0
  38. package/dist/chunks/novaConnection-J6_ohIQ0.js +14 -0
  39. package/dist/chunks/poseText-BXUaQWnK.cjs +1 -0
  40. package/dist/chunks/poseText-CtdXIeT_.js +41 -0
  41. package/dist/chunks/{hooks-BWoeBWLV.js → useSmoothedMotionState-C_Vo0py0.js} +93 -49
  42. package/dist/chunks/useSmoothedMotionState-Ce9NjwBu.cjs +1 -0
  43. package/dist/components/VelocitySlider.d.ts +0 -8
  44. package/dist/components/jogging/JoggingCartesianTab.d.ts +0 -3
  45. package/dist/components/jogging/JoggingJointTab.d.ts +0 -2
  46. package/dist/components/jogging/JoggingPanel.d.ts +0 -10
  47. package/dist/components/jogging/JoggingStore.d.ts +0 -46
  48. package/dist/components/robots/DHRobot.d.ts +1 -1
  49. package/dist/components/robots/GenericRobot.d.ts +1 -16
  50. package/dist/components/robots/LinearAxis.d.ts +11 -15
  51. package/dist/components/robots/LinearAxisAnimator.d.ts +1 -1
  52. package/dist/components/robots/MotionGroupVisualizer.d.ts +4 -6
  53. package/dist/components/robots/Robot.d.ts +9 -29
  54. package/dist/components/robots/SupportedLinearAxis.d.ts +7 -29
  55. package/dist/components/robots/SupportedRobot.d.ts +8 -35
  56. package/dist/components/robots/ghostStyle.d.ts +1 -30
  57. package/dist/components/robots/robotModelLogic.d.ts +6 -138
  58. package/dist/core.cjs +1 -1
  59. package/dist/core.d.ts +1 -5
  60. package/dist/core.js +54 -64
  61. package/dist/index.cjs +1 -1
  62. package/dist/index.js +75 -103
  63. package/dist/lib/ConnectedMotionGroup.d.ts +0 -12
  64. package/dist/lib/motionStateUpdate.d.ts +0 -17
  65. package/dist/session.cjs +1 -1
  66. package/dist/session.js +27 -30
  67. package/package.json +1 -2
  68. package/dist/CurrentPose/index.cjs +0 -1
  69. package/dist/CurrentPose/index.d.ts +0 -1
  70. package/dist/CurrentPose/index.js +0 -5
  71. package/dist/RobotControl/index.cjs +0 -1
  72. package/dist/RobotControl/index.d.ts +0 -2
  73. package/dist/RobotControl/index.js +0 -5
  74. package/dist/RobotControlPanel/index.cjs +0 -1
  75. package/dist/RobotControlPanel/index.d.ts +0 -2
  76. package/dist/RobotControlPanel/index.js +0 -5
  77. package/dist/RobotHeader/index.cjs +0 -1
  78. package/dist/RobotHeader/index.d.ts +0 -6
  79. package/dist/RobotHeader/index.js +0 -9
  80. package/dist/RobotScene/index.cjs +0 -1
  81. package/dist/RobotScene/index.d.ts +0 -4
  82. package/dist/RobotScene/index.js +0 -9
  83. package/dist/RobotView/index.cjs +0 -1
  84. package/dist/RobotView/index.d.ts +0 -3
  85. package/dist/RobotView/index.js +0 -6
  86. package/dist/SafetyBar/robotSafetyOf.d.ts +0 -1
  87. package/dist/chunks/ConnectedMotionGroup-DMzW69_n.cjs +0 -3
  88. package/dist/chunks/CurrentPose-Bf6p3Y83.cjs +0 -1
  89. package/dist/chunks/CurrentPose-BqyOJGLL.js +0 -50
  90. package/dist/chunks/CurrentPoseBar-96iSC6JW.js +0 -506
  91. package/dist/chunks/CurrentPoseBar-LN0MK4R_.cjs +0 -1
  92. package/dist/chunks/JoggingGizmo-BqnY-JZT.cjs +0 -1
  93. package/dist/chunks/JoggingGizmo-DoVq4iZb.js +0 -847
  94. package/dist/chunks/JoggingGizmoOrientation-BHt8MuHf.js +0 -14
  95. package/dist/chunks/JoggingGizmoOrientation-D3fbTbDf.cjs +0 -1
  96. package/dist/chunks/JoggingRefusedError-C4D8_YR_.js +0 -38
  97. package/dist/chunks/JoggingRefusedError-DqyrfUcc.cjs +0 -1
  98. package/dist/chunks/Pose3-BfBNPRDM.cjs +0 -1
  99. package/dist/chunks/Pose3-DWxfC6Dj.js +0 -79
  100. package/dist/chunks/PoseTransformer-2QIzECOZ.cjs +0 -1
  101. package/dist/chunks/PoseTransformer-CmuoS76S.js +0 -364
  102. package/dist/chunks/Robot-But1JxcI.js +0 -432
  103. package/dist/chunks/Robot-DaAL3bVX.cjs +0 -1
  104. package/dist/chunks/RobotActivation-CRVxXvlx.cjs +0 -1
  105. package/dist/chunks/RobotActivation-oR-8Y0iq.js +0 -143
  106. package/dist/chunks/RobotControl-BaQWkrR0.js +0 -330
  107. package/dist/chunks/RobotControl-DP50NDAf.cjs +0 -1
  108. package/dist/chunks/RobotControlPanel-BJknCtcC.cjs +0 -1
  109. package/dist/chunks/RobotControlPanel-CIcZkb7P.js +0 -1029
  110. package/dist/chunks/RobotGhost-5gdj8868.js +0 -55
  111. package/dist/chunks/RobotGhost-b-zIDwlm.cjs +0 -1
  112. package/dist/chunks/RobotHeader-7MA3sT-Y.cjs +0 -1
  113. package/dist/chunks/RobotHeader-CHnBRjsS.js +0 -392
  114. package/dist/chunks/RobotScene-CcVH_l3C.cjs +0 -1
  115. package/dist/chunks/RobotScene-WOR5cyaY.js +0 -1287
  116. package/dist/chunks/RobotView-BjqL3Z0t.cjs +0 -1
  117. package/dist/chunks/RobotView-DNKTyc5I.js +0 -157
  118. package/dist/chunks/SafetyBar-Cb6qHLB6.cjs +0 -1
  119. package/dist/chunks/SmallSelect-BdD9uLKK.js +0 -52
  120. package/dist/chunks/SmallSelect-Dcsd7_6_.cjs +0 -1
  121. package/dist/chunks/coordSystemLabel-BThpFG9n.cjs +0 -1
  122. package/dist/chunks/coordSystemLabel-Bfy9MUsV.js +0 -6
  123. package/dist/chunks/externalizeComponent-CFjD3foU.cjs +0 -2
  124. package/dist/chunks/hooks-BXe2bNMo.cjs +0 -1
  125. package/dist/chunks/joggingColors-Cqpfuw4G.cjs +0 -1
  126. package/dist/chunks/loadRobotSession-BzY9H3F8.cjs +0 -1
  127. package/dist/chunks/poseText-BxG4Caa-.js +0 -48
  128. package/dist/chunks/poseText-CwplkbDM.cjs +0 -1
  129. package/dist/chunks/useEveryFrame-D04ygIe7.js +0 -116
  130. package/dist/chunks/useEveryFrame-NeKiPXY-.cjs +0 -1
  131. package/dist/chunks/useSmoothedMotionState-CCXmMZ0S.cjs +0 -1
  132. package/dist/chunks/useSmoothedMotionState-CELh-YJa.js +0 -50
  133. package/dist/chunks/useWebGLRenderer-BozrbZz-.js +0 -45
  134. package/dist/chunks/useWebGLRenderer-CtddVDDb.cjs +0 -1
  135. package/dist/components/connectionWarning/ConnectionWarning.d.ts +0 -34
  136. package/dist/components/connectionWarning/connectionWarningOf.d.ts +0 -1
  137. package/dist/components/connectionWarning/timeAgo.d.ts +0 -5
  138. package/dist/components/currentPoseBar/CurrentPose.d.ts +0 -19
  139. package/dist/components/currentPoseBar/useCurrentPoseProps.d.ts +0 -1
  140. package/dist/components/jogging/coordSystemLabel.d.ts +0 -7
  141. package/dist/components/robotControl/CartesianJogTab.d.ts +0 -32
  142. package/dist/components/robotControl/HoldToMoveButton.d.ts +0 -26
  143. package/dist/components/robotControl/JogArea.d.ts +0 -28
  144. package/dist/components/robotControl/JogDisabledReason.d.ts +0 -15
  145. package/dist/components/robotControl/JogModeToggle.d.ts +0 -8
  146. package/dist/components/robotControl/JointJogTab.d.ts +0 -19
  147. package/dist/components/robotControl/MoveToTab.d.ts +0 -41
  148. package/dist/components/robotControl/PoseField.d.ts +0 -23
  149. package/dist/components/robotControl/RobotControl.d.ts +0 -33
  150. package/dist/components/robotControl/RobotControlPanel.d.ts +0 -257
  151. package/dist/components/robotControl/Section.d.ts +0 -5
  152. package/dist/components/robotControl/VelocityRow.d.ts +0 -20
  153. package/dist/components/robotControl/atPose.d.ts +0 -14
  154. package/dist/components/robotControl/units.d.ts +0 -24
  155. package/dist/components/robotControl/useRobotControlProps.d.ts +0 -11
  156. package/dist/components/robotControl/velocityText.d.ts +0 -18
  157. package/dist/components/robotHeader/ActivationSwitch.d.ts +0 -18
  158. package/dist/components/robotHeader/AppNavigation.d.ts +0 -15
  159. package/dist/components/robotHeader/RobotHeader.d.ts +0 -62
  160. package/dist/components/robotHeader/robotActivationOf.d.ts +0 -1
  161. package/dist/components/robotScene/JoggingAxes.d.ts +0 -38
  162. package/dist/components/robotScene/RobotGhost.d.ts +0 -56
  163. package/dist/components/robotScene/RobotScene.d.ts +0 -32
  164. package/dist/components/robotScene/RobotSceneView.d.ts +0 -53
  165. package/dist/components/robotScene/useRobotSceneProps.d.ts +0 -1
  166. package/dist/components/robotView/RobotCanvas.d.ts +0 -42
  167. package/dist/components/robotView/RobotView.d.ts +0 -22
  168. package/dist/components/robotView/WebGLUnavailable.d.ts +0 -5
  169. package/dist/components/robots/modelRotation.d.ts +0 -14
  170. package/dist/components/robots/robotModelSource.d.ts +0 -41
  171. package/dist/components/robots/useFrameSmoothedMotionState.d.ts +0 -25
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
- The 3D parts need three.js and React Three Fiber in addition. `/core` has the parts without 3D:
20
+ The 3D parts need three.js and React Three Fiber in addition. If you don't need 3D rendering in your application, always import from `/core`.
23
21
 
24
22
  ```typescript
25
23
  import {
26
- JoggingButtons,
24
+ JoggingPanel,
27
25
  SafetyBar,
28
26
  } from "@wandelbots/wandelbots-js-react-components/core"
29
27
  ```
@@ -43,9 +41,7 @@ pnpm add three three-stdlib @react-three/fiber @react-three/drei
43
41
 
44
42
  You can also import from the top-level package, but then you'll need to provide all optional dependencies.
45
43
 
46
- 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).
47
-
48
- The parts use the theme of your app. Without the Nova theme the simple parts still work, in the default colours of MUI; only `SafetyBar`, and `RobotHeader`, which shows it, still need it. For the Nova look, create the theme with `createNovaMuiTheme` of `@wandelbots/mui`:
44
+ The parts use the theme of your app. Without the Nova theme the simple parts still work, in the default colours of MUI; only `SafetyBar` still needs it. For the Nova look, create the theme with `createNovaMuiTheme` of `@wandelbots/mui`:
49
45
 
50
46
  ```tsx
51
47
  import { ThemeProvider } from "@mui/material/styles"
@@ -70,23 +66,15 @@ Browse the full icon set at https://wandelbotsgmbh.github.io/nova-design-system/
70
66
  **Available Entry Points:**
71
67
 
72
68
  - **`.`** (Main) — All components. Requires the peer dependencies of `/core` and `/3d`.
73
- - **`/core`** — The parts without 3D (jogging, `RobotHeader`, `CurrentPose`, `SafetyBar`, `AppHeader`, `LoadingCover`, `NoMotionGroupModal`), everything of `/session` (the robot session, `JoggingStore`, the NOVA connections, the motion state helpers), the deprecated `ConnectedMotionGroup` and `i18n`. Draws nothing in 3D, but still needs three.js installed (see [Without three.js or without React](#without-threejs-or-without-react)).
74
- - **`/session`** (beta) — 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.
69
+ - **`/core`** — The parts without 3D (jogging, `SafetyBar`, `AppHeader`, `LoadingCover`, `NoMotionGroupModal`), the NOVA connections and `JoggingStore`, the motion state helpers and `i18n`. It also exports everything of `/session`.
75
70
  - **`/3d`** — The 3D parts (`Robot`, `MotionGroupVisualizer`, `SafetyZonesRenderer`, …). Requires in addition three, three-stdlib, @react-three/fiber and @react-three/drei.
71
+ - **`/session`** (beta) — 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 and the pose math on plain numbers. It loads no React, no MUI and no three.js, and needs only `mobx`.
76
72
  - **`/nats`** — A robot's live controller state over NOVA's NATS server (`natsControllerStateSource`, `natsUrlOf`): the `stateSource` of `loadRobotSession` instead of NOVA's websocket. Requires in addition nats.ws; no other entry point loads it.
77
- - **`/SafetyBar`** — Only `SafetyBar` (also as the default export), also for a robot session (`session`).
73
+ - **`/SafetyBar`** — Only `SafetyBar` (also as the default export).
78
74
  - **`/JoggingGizmo`** — Only `JoggingGizmo` (also as the default export) and `JoggingGizmoOrientation`. Requires in addition three and @react-three/fiber.
79
75
  - **`/JoggingButtons`** — Only `JoggingButtons` (also as the default export). No 3D packages needed.
80
76
  - **`/JoggingJointSlider`** — Only `JoggingJointSlider` (also as the default export). No 3D packages needed.
81
- - **`/RobotControlPanel`** — The whole Robot control panel, `RobotControlPanel` (also as the default export). It shows the jog gizmo, so it requires in addition three and @react-three/fiber, as `/JoggingGizmo` does.
82
- - **`/RobotControl`** — `RobotControl` (also as the default export), the Robot control panel of a robot session. 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`, `JoggingAxes` and `RobotGhost`. 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. No 3D packages needed.
86
77
  - **`/CurrentPoseBar`** — Only `CurrentPoseBar` (also as the default export). No 3D packages needed.
87
- - **`/RobotHeader`** — `RobotHeader` (also as the default export), and its parts for an app's own header: `SafetyBar`, `ActivationSwitch` and `ConnectionWarning`. No 3D packages needed.
88
-
89
- Each part of a robot session (`RobotControl`, `RobotView`, `RobotScene`, `CurrentPose`, and `RobotHeader` with its parts) takes its robot as `session` and follows it by itself: the app passes the session, nothing else. Several robots on a page: each part gets its own.
90
78
 
91
79
  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
80
 
@@ -96,7 +84,7 @@ import JoggingJointSlider from "@wandelbots/wandelbots-js-react-components/Joggi
96
84
 
97
85
  ### The simple parts on their own
98
86
 
99
- `JoggingGizmo`, `JoggingButtons`, `JoggingJointSlider`, `CurrentPoseBar`, `SafetyBar` and `RobotControlPanel`, which is built from them, take plain props and report through callbacks: no store, no provider and no i18n setup of the app. The app keeps its own connection to the robot and moves it in `onJogStart` and `onJogStop`. While a control is held the robot moves; it stops when the control is let go, when the pointer leaves it, when the window loses focus or the tab is hidden, on any key, and when the part becomes disabled or unmounts. The keyboard starts no motion.
87
+ `JoggingGizmo`, `JoggingButtons`, `JoggingJointSlider`, `CurrentPoseBar` and `SafetyBar` take plain props and report through callbacks: no store, no provider and no i18n setup of the app. The app keeps its own connection to the robot and moves it in `onJogStart` and `onJogStop`. While a control is held the robot moves; it stops when the control is let go, when the pointer leaves it, when the window loses focus or the tab is hidden, on any key, and when the part becomes disabled or unmounts. The keyboard starts no motion.
100
88
 
101
89
  What each one loads, besides `react` and `@mui/material` (checked by `src/test/bare.test.tsx`):
102
90
 
@@ -107,7 +95,6 @@ What each one loads, besides `react` and `@mui/material` (checked by `src/test/b
107
95
  | `/JoggingJointSlider` | nothing else |
108
96
  | `/CurrentPoseBar` | `@wandelbots/mui`, `@wandelbots/icons` |
109
97
  | `/SafetyBar` | `mobx-react-lite`, `axios` |
110
- | `/RobotControlPanel` | `three`, `@react-three/fiber`, `@wandelbots/mui`, `@wandelbots/icons`, `@wandelbots/design-tokens` |
111
98
 
112
99
  All of them load i18next and react-i18next, which come with the library.
113
100
 
@@ -117,9 +104,9 @@ All of them load i18next and react-i18next, which come with the library.
117
104
 
118
105
  ### Without three.js or without React
119
106
 
120
- - **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`.
121
- - **`/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.
122
- - **An app without React**, or with a UI of its own, uses `/session` alone (and `/nats`). Of the peer dependencies it needs only `mobx` (see [Peer dependencies](#peer-dependencies)). The parts of a session are MobX stores: such an app follows them with `autorun` or `reaction` of MobX. What it calls returns a promise that rejects when it fails (a jog that may not start rejects with a `JoggingRefusedError`); what fails in the background goes to `onError`. `load.dispose()` closes the session's connections.
107
+ - **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: `/CurrentPoseBar`, `/SafetyBar`, `/JoggingButtons` and `/JoggingJointSlider`.
108
+ - **`/core` needs three.js installed**, although it draws nothing in 3D: `ConnectedMotionGroup`, which it exports, gives a three.js quaternion (`mountingQuaternion`).
109
+ - **An app without React**, or with a UI of its own, uses `/session` alone (and `/nats`). Of the peer dependencies it needs only `mobx` (see [Peer dependencies](#peer-dependencies)). The parts of a session are MobX stores: such an app follows them with `autorun` or `reaction` of MobX. What it calls returns a promise that rejects when it fails (a jog that may not start rejects with a `JoggingRefusedError`), and what fails in the background goes to `onError`.
123
110
 
124
111
  ```typescript
125
112
  import { autorun } from "mobx"
@@ -155,13 +142,13 @@ load.dispose()
155
142
  | `@emotion/react`, `@emotion/styled` | ^11 | Every entry point with UI |
156
143
  | `@wandelbots/mui` | ^2 | Every entry point with UI (each simple part's needs are in [The simple parts on their own](#the-simple-parts-on-their-own)) |
157
144
  | `mobx-react-lite` | ^4.1.0 | Every entry point with UI |
158
- | `three` | >=0.182 | `.`, `/3d`, `/JoggingGizmo`, `/RobotControlPanel`, `/RobotControl`, `/RobotScene`, `/RobotView`, and `/core` until `ConnectedMotionGroup` is removed |
159
- | `@react-three/fiber` | ^9 | `.`, `/3d`, `/JoggingGizmo`, `/RobotControlPanel`, `/RobotControl`, `/RobotScene`, `/RobotView` |
160
- | `three-stdlib` | >=2 | `.`, `/3d`, `/RobotScene`, `/RobotView` |
161
- | `@react-three/drei` | ^10 | `.`, `/3d`, `/RobotScene`, `/RobotView` |
145
+ | `three` | >=0.182 | `.`, `/3d`, `/JoggingGizmo`, and `/core` (`ConnectedMotionGroup`) |
146
+ | `@react-three/fiber` | ^9 | `.`, `/3d`, `/JoggingGizmo` |
147
+ | `three-stdlib` | >=2 | `.`, `/3d` |
148
+ | `@react-three/drei` | ^10 | `.`, `/3d` |
162
149
  | `nats.ws` | ^1.30.3 | `/nats` |
163
150
 
164
- 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.
151
+ 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.
165
152
 
166
153
  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.
167
154
 
@@ -198,88 +185,6 @@ These packages are peer dependencies because the app and the library must use th
198
185
  - **Look:** `AppHeader` and `LoadingCover` use the styles of the design system, so they look a little different.
199
186
  - **Release asset:** `no-draco-models.zip` is gone. The models come from the NOVA API (since 4.0.0).
200
187
 
201
- ### From ConnectedMotionGroup to RobotSession
202
-
203
- `ConnectedMotionGroup` is deprecated. `RobotSession` replaces it: one robot of a cell, loaded and connected, with its description, live state, safety, activation, jogging and Move to. `ConnectedMotionGroup` keeps working until a later major version removes it, and `Robot` and `LinearAxis` still take it.
204
-
205
- ```tsx
206
- // Before
207
- const motionGroup = await ConnectedMotionGroup.connect(nova, "0@ur5e", { cellId })
208
- <Robot connectedMotionGroup={motionGroup} />
209
- motionGroup.dispose()
210
-
211
- // After
212
- const load = loadRobotSession(nova, "0@ur5e", { cellId })
213
- const session = await load.ready
214
- <RobotScene session={session} />
215
- load.dispose()
216
- ```
217
-
218
- What changes besides the names:
219
-
220
- - **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.
221
- - **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`.
222
- - **The activation follows the controller:** `activation.state` is the mode that the controller reports ("inactive" while its live state does not come), or the mode change in progress. A change that the controller has not confirmed after 30 seconds is over, and can be asked for again.
223
- - **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`.
224
- - **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`.
225
- - **Several robots:** load one session per robot instead of `ConnectedMotionGroup.connectMultiple`.
226
-
227
- | `ConnectedMotionGroup` | `RobotSession` |
228
- | --- | --- |
229
- | `motionGroupId`, `controllerId` | `motionGroupId`, `controllerId` (and `cellId`) |
230
- | `modelFromController` | `description.motionGroupModel` |
231
- | `dhParameters` | `description.dhParameters` |
232
- | `safetyZones` | `description.safetyZones` |
233
- | `description` | `description.motionGroupDescription` |
234
- | `isVirtual` | `description.isVirtual` |
235
- | `tcps` | `description.tcps` (id and name), `description.tcpOffsetsById` (position and orientation) |
236
- | `joints` | One per joint: `description.dhParameters`, or the joint limits in `description.jointLimits` |
237
- | `mountingPosition`, `mountingQuaternion` | `description.mounting` (mm and a rotation vector); `RobotScene` draws the robot at it |
238
- | `rapidlyChangingMotionState` | `state.rapidlyChangingMotionState` |
239
- | `controllerState` | `state.controllerState` |
240
- | `initialMotionState`, `controller`, `motionGroup`, `motionStateSocket` | No replacement: the session keeps its connections. Read `state` instead. |
241
- | `activationState` | `activation.state` |
242
- | `activate()`, `deactivate()`, `toggleActivation()` | `activation.activate()`, `activation.deactivate()`, `activation.toggle()` |
243
- | `isEstopActive`, `isMoveableSafetyState`, `isMoveableOperationMode`, `canBeMoved` | `safety.isEstopActive`, `safety.isMoveableSafetyState`, `safety.isMoveableOperationMode`, `safety.canBeMoved`; why the robot may not move: `safety.notMoveableReason` |
244
- | `joggingVelocity`, `joggingVelocityRads`, `setJoggingVelocity()` | The velocities of `jogging`: `rotationVelocityDegPerSec`, `rotationVelocityRadsPerSec`, `translationVelocityMmPerSec`, `setVelocityFromSlider()` |
245
- | `connectedJoggingSocket`, `planData` | No replacement (unused) |
246
- | `dispose()` | `load.dispose()`, or `session.dispose()` |
247
- | `<Robot connectedMotionGroup={…}>`, `<LinearAxis connectedMotionGroup={…}>` | `<RobotScene session={session} />` draws the session's robot or linear axis. `Robot` and `LinearAxis` take `motionGroup`: a `ConnectedMotionGroup`, or the app's own data (see `RobotModelSource`). |
248
-
249
- ### From JoggingPanel to RobotControl
250
-
251
- `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).
252
-
253
- ```tsx
254
- // Before
255
- <JoggingPanel nova={nova} motionGroupId="0@ur5e" cellId={cellId} locked={programRuns} />
256
-
257
- // After
258
- const load = loadRobotSession(nova, "0@ur5e", { cellId, storage: localStorage })
259
- const session = await load.ready
260
- <RobotControl session={session} disabled={programRuns} />
261
- ```
262
-
263
- | `JoggingPanel` | Instead |
264
- | --- | --- |
265
- | `nova`, `motionGroupId`, `cellId` | `loadRobotSession(nova, motionGroupId, { cellId })`; its session goes to `session` |
266
- | `locked` | `disabled` |
267
- | `onSetup(store)`, `store` | `session.jogging`, the session's `JoggingStore`. It lives as long as the session, also while the panel is hidden. |
268
- | The jogging settings in `localStorage` | Only with `storage: localStorage` (or a storage of the app) for `loadRobotSession`; without it nothing is kept |
269
- | `sx` | `sx` |
270
- | `children` | No replacement: the app puts its own parts next to the panel, see [Placing the parts](#placing-the-parts) |
271
- | The `show…` flags of `JoggingStore` (`showTcpSelect`, `showIncrementSelect`, …), its `tabs` and `onTabChange` | The props of `RobotControlPanel`, given to `RobotControl`: each replaces the session's, e.g. `<RobotControl session={session} increments={undefined} />` for no Increment mode |
272
- | `JoggingCartesianAxisControl` | `JoggingButtons` (a minus and a plus button per axis), or `JoggingGizmo` |
273
- | `JoggingJointValueControl` | `JoggingJointSlider` |
274
- | `VelocitySlider`, `VelocitySliderLabel` | The velocity of `RobotControlPanel` |
275
- | `JoggingStore.activate()` | `startCartesianJogging`, `startJointJogging` and `runIncrementalCartesianJog` of `JoggingStore` activate what they need; `session.ensureMovementOwnership("jogging")` hands the robot to jogging |
276
-
277
- What changes besides the names:
278
-
279
- - **Props in, callbacks out:** `RobotControlPanel`, `JoggingButtons`, `JoggingGizmo` and `JoggingJointSlider` take no store and move nothing themselves (`onJogStart`, `onJogStop`). `RobotControl` is `RobotControlPanel` wired to a session: it jogs the session's robot.
280
- - **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.
281
- - **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.
282
-
283
188
  ### 4.x Core Changes
284
189
 
285
190
  Robot data is now fetched from a running nova instance. This eliminates the need of shipping every react application with the robot data attached.
@@ -312,234 +217,25 @@ Breaking changes for each major version are documented in the [GitHub Releases](
312
217
 
313
218
  Manual robot control interfaces.
314
219
 
315
- **JoggingPanel** (deprecated, see [From JoggingPanel to RobotControl](#from-joggingpanel-to-robotcontrol)) - The jogging panel of earlier versions, with cartesian and joint controls. The older parts it is built from are deprecated with it: **JoggingCartesianAxisControl** (use `JoggingButtons`), **JoggingJointValueControl** (use `JoggingJointSlider`), **VelocitySlider** and **VelocitySliderLabel** (use the velocity of `RobotControlPanel`).
220
+ **JoggingPanel** - Complete jogging interface with cartesian and joint controls
316
221
 
317
- **JoggingStore** - The state of the jogging (velocity, coordinate system, the jogging connection). A robot session has one (`session.jogging`), and `JoggingStore.loadFor` creates one for your own controls. It also jogs for them: `startCartesianJogging(motion, axis, direction)` or `startJointJogging(joint, direction)` when a control is pressed and `stopJogging()` when it is let go, and `runIncrementalCartesianJog(motion, axis, direction, increment)` for one step. The store keeps the order that hold-to-jog needs: a press that ends before the jogging connection is ready moves nothing, and one step runs at a time. While the store is locked, or its owner says that the robot may not move (the option `notMoveableReason`, which a `RobotSession` gives its store), or after NOVA refused the jogging connection because another client jogs (`blocked`, until `unblock()`), it starts no jog: the start rejects with a `JoggingRefusedError`, whose `reason.code` says why. The same holds for everything else that opens the jogging connection, a TCP change (`requestTcpChange`) and `session.ensureMovementOwnership("jogging")`: NOVA switches a controller to control mode by itself for it. The store asks again once the connection is open, and closes it when the robot may no longer move by then.
222
+ - Dual-mode operation (Cartesian & Joint space)
223
+ - Real-time velocity control
224
+ - Multiple coordinate systems support (Robot base or Tool)
318
225
 
319
- **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.
226
+ **Simple jogging parts** (plain props and callbacks, see [The simple parts on their own](#the-simple-parts-on-their-own))
320
227
 
321
- - The gizmo draws in its own small canvas, so it can sit in a panel next to the 3D view. `JoggingGizmoOrientation` goes inside the app's `<Canvas>` and passes the camera's view to the gizmo through a shared ref. Until it has, the gizmo stays disabled.
322
- - `JoggingGizmoOrientation` goes anywhere in the scene. It follows the camera's up: in a scene that is Y up, like that of this library's robots, it translates NOVA's axes (Z up), so NOVA's Z is the scene's Y. In a scene that is Z up like NOVA's world, whose camera has Z up, it takes NOVA's axes as they are.
323
- - `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.
324
- - `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.
325
- - 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.
326
- - 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`.
327
- - 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.
328
- - 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.
329
- - 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.
330
-
331
- ```tsx
332
- const orientation = useRef<Quaternion | null>(null)
333
-
334
- <Canvas>
335
- {/* … the 3D view with the robot */}
336
- <JoggingGizmoOrientation target={orientation} />
337
- </Canvas>
338
-
339
- <JoggingGizmo
340
- orientation={orientation}
341
- frameQuaternion={jogFrame} // optional: NOVA's world frame by default
342
- motion={motion} // "translate" or "rotate"
343
- onJogStart={(axis, direction) =>
344
- motion === "rotate"
345
- ? startRotating(axis, direction)
346
- : startJogging(axis, direction)
347
- }
348
- onJogStop={() => stopJogging()}
349
- />
350
- ```
351
-
352
- **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.
353
-
354
- ```tsx
355
- <JoggingButtons
356
- motion={motion} // "translate" or "rotate"
357
- onJogStart={(axis, direction) =>
358
- motion === "rotate"
359
- ? startRotating(axis, direction)
360
- : startJogging(axis, direction)
361
- }
362
- onJogStop={() => stopJogging()}
363
- />
364
- ```
228
+ - **JoggingGizmo** - Handles in 3D to move the TCP along or turn it about the X, Y and Z axes
229
+ - **JoggingButtons** - A minus and a plus button per axis
230
+ - **JoggingJointSlider** - A joint on its range between its limits: hold a point to move the joint toward it
231
+ - **CurrentPoseBar** - The current pose of the TCP, its TCP and coordinate system, and the orientation format
365
232
 
366
- **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.
233
+ **Individual Jogging Controls**
367
234
 
368
- - `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.
369
- - `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.
370
- - One joint at a time is up to the app. Keep the jogging joint in a ref, which changes at once, and ignore the others' calls: `disabled` alone changes only with the next render, too late for two fingers that move in the same frame.
371
-
372
- ```tsx
373
- const jogging = useRef<number | null>(null)
374
- const [active, setActive] = useState<number | null>(null)
375
-
376
- {jointValues.map((value, index) => (
377
- <JoggingJointSlider
378
- key={index}
379
- label={`J${index + 1}`}
380
- value={value}
381
- min={limits[index].lower_limit}
382
- max={limits[index].upper_limit}
383
- onJogStart={(direction) => {
384
- if (jogging.current !== null && jogging.current !== index) return
385
- jogging.current = index
386
- setActive(index)
387
- startJointJogging(index, direction)
388
- }}
389
- onJogStop={() => {
390
- if (jogging.current !== index) return
391
- jogging.current = null
392
- setActive(null)
393
- stopJogging()
394
- }}
395
- // Shows the others as unavailable; the ref does the excluding
396
- disabled={active !== null && active !== index}
397
- />
398
- ))}
399
- ```
400
-
401
- **RobotControlPanel** (from `/3d` or `/RobotControlPanel`) - The Robot control panel of the design, built from the parts above: the tabs Translate and Rotate, with the TCP and the frame to jog along, Continuous or Increment, the velocity, the step size, and the gizmo or the buttons with a switch between them; the tab Joint, with a `JoggingJointSlider` per joint and the joint velocity; and the tab Move to, with a typed target (a pose of the TCP or joint values; else the current pose), the frame it is relative to, and a button to hold to move there. An app that wants the whole panel imports this; an app that wants one part imports that part.
402
-
403
- - It moves nothing itself, as its parts: `onJogStart(motion, axis, direction)` and `onJogStop` for jogging while held, and `increments.onStep(motion, axis, direction, distance)` for one step per press. The app keeps the velocity and the selects in its own store; the panel keeps the tab, the mode, the step size and the view.
404
- - Velocities and step sizes are in NOVA's units: mm and mm/s to translate, rad and rad/s to rotate. The panel shows mm/s and °/s. The velocity has a slider, in whole units, and a field to type it into: Enter, or leaving the field, applies it (`onVelocityChange`). A text that is no number, or a velocity outside `min` to `max`, is flagged at the field and neither applied nor corrected.
405
- - `tcp` and `jogFrame` show a select each, filled by the app. Without `increments`, there is no Continuous/Increment toggle. Without `gizmoOrientation` (from a `JoggingGizmoOrientation` in the app's 3D scene), it jogs with buttons only.
406
- - `onJogStop` also comes when the tab, the mode or the view changes while a control is held: the jog of that press must not go on.
407
- - `disabled` turns off every control: nothing may move and no setting may change (the app's lock). `jogDisabled` turns off only what jogs on Translate, Rotate and Joint (the gizmo, the buttons, the joint sliders) and the TCP select, whose change needs the jogging connection: e.g. while the robot is not activated or a trajectory moves it. The settings that move nothing stay usable then (Move relative to, Continuous or Increment, the step size, the velocity), and so does Move to, so a move of its own does not end when the app locks jogging during it. An app that used to pass `disabled={locked || !canBeMoved}` passes `disabled={locked}` and leaves the robot's state to `jogDisabled`, which `RobotControl` sets. `jogDisabledReason` is the text that says why jogging is off: Translate and Rotate show it in place of their hint of how to jog, Joint under its joints. `RobotControl` fills it with the robot's reason (not activated, its safety state or operation mode, no connection), with a trajectory that moves the robot, or with another client that jogs it. With `onJogRetry`, a Try again button shows under the reason: `RobotControl` gives it after another client held the jogging connection, and the next jog then asks NOVA for it again.
408
- - 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.
409
- - `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.
410
- - `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, or why the move to it failed). With `getCurrentJoints` (the joints' positions now, in rad, or mm for a linear axis), the field also takes joint values as the target, in square brackets and as many as the robot has joints: `[j1, …, jn]`. `onTargetChange` and `onMoveStart` then get `{ joints }` in place of a pose (`RobotControlTarget`). A robot that takes no TCP poses (`cartesian` is false: a linear axis, a turntable) moves to joint values only: the field shows its joints, live, and reads numbers without brackets as joint values. Then Reset shows, and with an `error` also Plan again, which gives the app the same pose once more (`onTargetChange(pose)`), so a failed move needs no typing. 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. `notMoveableReason` is why the robot may not move now, whatever the target (e.g. it is not activated): the field says so with a target and also while one is typed, and Move to stays off. Typing stays possible, and a typed target still comes (`onTargetChange`), to plan once the robot may move. `frame` is the "Relative to" select. The tab shows the velocity of the move to its target: `velocity.translate` for a pose of the TCP, and for joint values the velocity of the Joint tab (`joints.velocity`), or without that tab `velocity.rotate`. Without `moveTo`, there is no Move to tab.
411
-
412
- ```tsx
413
- const orientation = useRef<Quaternion | null>(null)
414
-
415
- <RobotControlPanel
416
- gizmoOrientation={orientation}
417
- tcp={{ options: tcps, value: tcp, onChange: setTcp }}
418
- jogFrame={{ options: frames, value: frame, onChange: setFrame }}
419
- velocity={{
420
- translate: { value: mmPerSec, min: 1, max: 250 },
421
- rotate: { value: radPerSec, min: 0.02, max: 1 },
422
- }}
423
- onVelocityChange={(motion, value) => setVelocity(motion, value)}
424
- onJogStart={(motion, axis, direction) => startJogging(motion, axis, direction)}
425
- onJogStop={() => stopJogging()}
426
- increments={{
427
- steps: { translate: [0.1, 1, 5, 10], rotate: [0.001, 0.01, 0.05] },
428
- onStep: (motion, axis, direction, distance) =>
429
- jogStep(motion, axis, direction, distance),
430
- }}
431
- joints={{
432
- joints: jointValues.map((value, index) => ({
433
- value,
434
- min: limits[index].lower_limit,
435
- max: limits[index].upper_limit,
436
- })),
437
- velocity: { value: jointRadPerSec, min: 0.02, max: 1 },
438
- onVelocityChange: setJointVelocity,
439
- onJogStart: (index, direction) => startJointJogging(index, direction),
440
- onJogStop: () => stopJogging(),
441
- }}
442
- moveTo={{
443
- getCurrentPose: () => currentTcpPose(),
444
- getCurrentJoints: () => currentJoints(), // the field takes [j1, …, jn] too
445
- onTargetChange: (target) => planAndLoad(target), // a pose or { joints }, or drop the plan (null)
446
- state: trajectoryState, // "planning" | "planned" | "moving" | "stopping" | "idle"
447
- error,
448
- onMoveStart: () => startTrajectory(),
449
- onMoveStop: () => pauseTrajectory(),
450
- }}
451
- />
452
- ```
453
-
454
- ### The parts of a robot session
455
-
456
- `RobotControl`, `RobotView`, `RobotScene` and `CurrentPose` are connected components: a UI component, which takes props and reports through callbacks, filled from the `RobotSession` given as `session`. A prop given to the connected component replaces the session's: `<RobotControl session={session} increments={undefined} />` has no Increment mode. An app without a `RobotSession` uses the UI component with props of its own.
457
-
458
- | Connected component | UI component |
459
- | --- | --- |
460
- | `RobotControl` | `RobotControlPanel` |
461
- | `RobotScene` | `RobotSceneView` |
462
- | `RobotView` | `RobotScene` in a `RobotCanvas` |
463
- | `CurrentPose` | `CurrentPoseBar` |
464
-
465
- **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.
466
-
467
- **RobotView**, **RobotCanvas**, **RobotScene**, **RobotSceneView** and **JoggingAxes** (from `/3d`, `/RobotView` or `/RobotScene`) - The 3D view of a session:
468
-
469
- - `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`. Any prop of `RobotSceneView` given to it replaces the session's; `robot` replaces only the parts it gives, e.g. `robot={{ rapidlyChangingMotionState }}` for other joints to show.
470
- - `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.
471
- - `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.
472
- - `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.
473
-
474
- **RobotGhost** (from `/3d` or `/RobotScene`) - A robot at given joints, drawn as a see-through ghost: a stored pose, a planned target, a posture that collides. It stands at the robot's mounting and draws in NOVA's coordinates, so it goes among the children of `RobotView` or `RobotScene`. An app draws as many as it wants, each in its own `color` and `opacity` (0.3 by default): each ghost has materials of its own, so ghosts of one model do not change each other. It takes the robot as `session`, or as plain data (`robot`, a `RobotModelSource`). `flangeRef` gives the ghost's flange, where the app draws parts of its own with `createPortal` of React Three Fiber, e.g. a marker of the TCP; the ghost style leaves them as they are. The page Ghosts of the playground (`playground/src/pages/GhostsPage.tsx`) draws two ghosts and a marker.
475
-
476
- ```tsx
477
- const [flange, setFlange] = useState<Group | null>(null)
478
-
479
- <RobotView session={session}>
480
- <RobotGhost session={session} joints={storedJoints} color="grey" />
481
- <RobotGhost
482
- session={session}
483
- joints={targetJoints}
484
- color={collides ? "red" : "blue"}
485
- opacity={0.5}
486
- flangeRef={setFlange}
487
- />
488
- {flange && createPortal(<TcpMarker />, flange)}
489
- </RobotView>
490
- ```
491
-
492
- **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.
493
-
494
- **RobotHeader** and **ConnectionWarning** (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 robot's `SafetyBar` and activation switch, and the app's own `actions`. Given a `session` it shows the robot's safety state, operation mode and controller type and follows them, e.g. an emergency stop as soon as NOVA reports it; its switch is off while NOVA would refuse a mode change, and a refused change goes to the session's `onError`. Without a robot, e.g. while none is loaded, it shows the app's name and menu only. `ConnectionWarning` goes into its `actions`: an icon that shows once the robot's live state stops arriving, also for its `session`. An app that builds its own header places `SafetyBar`, `ActivationSwitch` and `ConnectionWarning` itself, each with `session`; an app without a `RobotSession` gives the header `safety` and `activation` as plain props instead.
495
-
496
- #### Placing the parts
497
-
498
- 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.
499
-
500
- ```tsx
501
- import Box from "@mui/material/Box"
502
- import Stack from "@mui/material/Stack"
503
- import {
504
- ConnectionWarning,
505
- CurrentPose,
506
- JoggingGizmoOrientation,
507
- RobotControl,
508
- RobotHeader,
509
- type RobotSession,
510
- RobotView,
511
- } from "@wandelbots/wandelbots-js-react-components"
512
- import { useRef } from "react"
513
- import type { Quaternion } from "three"
514
-
515
- export function RobotApp({ session }: { session: RobotSession }) {
516
- // The camera of the 3D view, for the panel's gizmo
517
- const orientation = useRef<Quaternion | null>(null)
518
-
519
- return (
520
- <Stack sx={{ height: "100vh" }}>
521
- <RobotHeader
522
- appName="My robot app"
523
- session={session}
524
- actions={<ConnectionWarning session={session} />}
525
- />
526
- <Box sx={{ position: "relative", flex: 1, minHeight: 0 }}>
527
- <Box sx={{ position: "absolute", inset: 0 }}>
528
- <RobotView session={session}>
529
- <JoggingGizmoOrientation target={orientation} />
530
- </RobotView>
531
- </Box>
532
- <Box sx={{ position: "absolute", top: 12, right: 12, width: 444 }}>
533
- <RobotControl session={session} gizmoOrientation={orientation} />
534
- </Box>
535
- <Box sx={{ position: "absolute", left: 12, right: 12, bottom: 12 }}>
536
- <CurrentPose session={session} />
537
- </Box>
538
- </Box>
539
- </Stack>
540
- )
541
- }
542
- ```
235
+ - **JoggingCartesianAxisControl** - Single-axis cartesian movement
236
+ - **JoggingJointValueControl** - Individual joint controls
237
+ - **VelocitySlider** (and **VelocitySliderLabel**) - Speed adjustment interface
238
+ - **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.
543
239
 
544
240
  ### 3D Visualization & Robotics
545
241
 
@@ -547,13 +243,12 @@ export function RobotApp({ session }: { session: RobotSession }) {
547
243
 
548
244
  **Robot** - Real-time 3D robot rendering
549
245
 
550
- - Takes the robot as plain data (`RobotModelSource`): a `ConnectedMotionGroup`, or the app's own data. A `RobotSession`'s robot: `RobotScene`
551
- - Live pose updates from its motion state, at its mounting
246
+ - Live pose updates from a `ConnectedMotionGroup`
552
247
  - The model of the motion group from the NOVA instance (`defaultGetModel`)
553
248
 
554
249
  **LinearAxis** - The same for a linear axis
555
250
 
556
- **SupportedRobot**, **SupportedLinearAxis** and **MotionGroupVisualizer** - The same with single props: they take a motion state, the model name and the DH parameters. `MotionGroupVisualizer` picks the robot or the linear axis. The `…Exact` variants show the pose without smoothing. `transparentColor` draws one as a ghost, with `transparentOpacity` (0.3 by default); `flangeRef` gives its flange.
251
+ **SupportedRobot**, **SupportedLinearAxis** and **MotionGroupVisualizer** - The same without a `ConnectedMotionGroup`: they take a motion state, the model name and the DH parameters. `MotionGroupVisualizer` picks the robot or the linear axis. The `…Exact` variants show the pose without smoothing.
557
252
 
558
253
  **SafetyZonesRenderer** - 3D safety visualization
559
254
 
@@ -579,8 +274,6 @@ Safety components for production environments.
579
274
 
580
275
  - Real-time safety monitoring
581
276
  - Emergency stop integration
582
- - Each indicator has a stable `data-testid` (`safety-state-indicator`, `operation-mode-indicator`, `controller-type-indicator`) and, as an image, a name that says its state, e.g. "Safety state: E-Stop", "Operation mode: Manual" or "Controller type: Virtual": the compact bar shows only icons, with their texts in a popover on hover
583
- - Given a `session` (`<SafetyBar session={session} />`) it shows and follows the robot of that session; an app without a `RobotSession` gives the states as plain props
584
277
 
585
278
  ### App Frame
586
279
 
@@ -590,11 +283,9 @@ Safety components for production environments.
590
283
 
591
284
  ### Logic
592
285
 
593
- - **loadRobotSession** and **RobotSession** - A robot of a cell, loaded and connected: its description, live state, safety, activation, jogging and Move to. In a React app, its UI is [the parts of a robot session](#the-parts-of-a-robot-session); without React, see [Without three.js or without React](#without-threejs-or-without-react).
594
- - **TrajectoryExecutionStore** (`session.trajectory`) and **RobotTargetPose** (`session.targetPose`) - Move to without a UI. `planTrajectory(pose)` plans a trajectory and loads it; `hold(pose)` 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. Both take a pose as the app saves it (`RobotPose`: joints, or a TCP pose in a coordinate system, planned for the selected TCP), or a `TrajectoryTarget`; a pose of another motion group is refused. `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`)
595
- - **ConnectedMotionGroup** (deprecated, see [From ConnectedMotionGroup to RobotSession](#from-connectedmotiongroup-to-robotsession)) - A motion group with its live motion state, safety state and operation mode
286
+ - **ConnectedMotionGroup** - A motion group with its live motion state, safety state and operation mode
596
287
  - **MotionStreamConnection** and **JoggerConnection** - The motion state stream and the jogging connection of a motion group
597
- - **jointValuesEqual**, **poseEqual**, **tcpMotionEqual**, **unwrapRotationVector** (deprecated) - Helpers of the library's motion stream
288
+ - **jointValuesEqual**, **poseEqual**, **tcpMotionEqual**, **unwrapRotationVector** - Helpers for the motion state
598
289
  - **ValueInterpolator**, **useInterpolation**, **useSmoothedMotionState** - Smooth joint values for the 3D view
599
290
  - **i18n** - The translations of the library
600
291
 
@@ -604,9 +295,9 @@ Safety components for production environments.
604
295
 
605
296
  Components integrate with the Wandelbots Nova ecosystem:
606
297
 
607
- - **NovaConnection** - Where the library connects to NOVA (`nova` of `JoggingPanel`, `loadRobotSession`, `ConnectedMotionGroup.connect`, `MotionStreamConnection.open`, `JoggerConnection.open`, `defaultGetModel`), it takes a `NovaConnection`: the URL of the instance, or the NOVA client of the app (`Nova` of `@wandelbots/nova-js`, of any version). The library reads only the URL and the access token of the client, and connects with its own client (nova-js 4.13.0). So the app configures the connection in one place.
298
+ - **NovaConnection** - Where the library connects to NOVA (`nova` of `JoggingPanel`, `ConnectedMotionGroup.connect`, `MotionStreamConnection.open`, `JoggerConnection.open`, `defaultGetModel`), it takes a `NovaConnection`: the URL of the instance, or the NOVA client of the app (`Nova` of `@wandelbots/nova-js`, of any version). The library reads only the URL and the access token of the client, and connects with its own client (nova-js 4.13.0). So the app configures the connection in one place.
608
299
  - **Real-time Updates** - WebSocket connections for live robot state updates
609
- - **Motion Group Management** - One `RobotSession` per robot (`ConnectedMotionGroup` in earlier versions)
300
+ - **Motion Group Management** - Direct integration with `ConnectedMotionGroup` objects
610
301
  - **State Synchronization** - Automatic state management with MobX reactivity
611
302
 
612
303
  ### Technical Foundation
@@ -660,7 +351,7 @@ pnpm playground:preview # serves playground/dist on http://localhost:4180
660
351
 
661
352
  Vite reads these values when it starts (see [A NOVA instance](#a-nova-instance)). `CELL_ID` in the environment selects the cell (default `cell`). The cell needs a robot: without a motion group, the playground shows `NoMotionGroupModal`.
662
353
 
663
- The pages are Jogging, Joint limits, Safety and collisions, Robot models, Layouts and Building blocks. Each page combines parts that work together. Layouts puts `RobotControlPanel` and `CurrentPoseBar` over the robot's 3D view as the Figma design does; Building blocks shows the smaller parts alone. The app menu of the `AppHeader` switches the pages, and the URL selects the page and the motion group, for example `?page=jogging&motionGroup=0@ur5e`. The top bar has a switch that activates the robot: the parts that jog with the session's `JoggingStore` (on Layouts, Building blocks and Joint limits) move only an activated robot, and show their jog controls as off until then. The dev server uses React StrictMode, so a part that leaves a connection open shows up.
354
+ The pages are Jogging, Joint limits, Safety and collisions, Robot models and Building blocks. Each page combines parts that work together. The app menu of the `AppHeader` switches the pages, and the URL selects the page and the motion group, for example `?page=jogging&motionGroup=0@ur5e`. The dev server uses React StrictMode, so a part that leaves a connection open shows up.
664
355
 
665
356
  The built playground contains the URL and the access token of the instance: never publish or upload `playground/dist`.
666
357
 
@@ -674,7 +365,7 @@ pnpm test:e2e # against a NOVA instance, see "e2e Tests"
674
365
  pnpm test:playground # against a NOVA instance, see "e2e Tests"
675
366
  ```
676
367
 
677
- `pnpm api:check` compares the public API with the reports in `etc/api-extractor/`. After an intended change of the public API, `pnpm api:update` writes the reports again; commit them with the change. [etc/public-names.md](etc/public-names.md) lists every public name and why it is public (`pnpm api:names` writes it).
368
+ `pnpm api:check` compares the public API with the reports in `etc/api-extractor/`. After an intended change of the public API, `pnpm api:update` writes the reports again; commit them with the change.
678
369
 
679
370
  ### e2e Tests
680
371
 
package/dist/3d.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/Robot-DaAL3bVX.cjs"),o=require("./chunks/RobotScene-CcVH_l3C.cjs"),i=require("./chunks/JoggingGizmo-BqnY-JZT.cjs"),r=require("./chunks/JoggingGizmoOrientation-D3fbTbDf.cjs"),a=require("./chunks/RobotControlPanel-BJknCtcC.cjs"),s=require("./chunks/RobotControl-DP50NDAf.cjs"),u=require("./chunks/RobotGhost-b-zIDwlm.cjs"),t=require("./chunks/RobotView-BjqL3Z0t.cjs"),R=require("./chunks/hooks-BXe2bNMo.cjs"),S=require("./chunks/useSmoothedMotionState-CCXmMZ0S.cjs"),n=require("./chunks/Pose3-BfBNPRDM.cjs");exports.CollisionSceneRenderer=e.CollisionSceneRenderer;exports.JointLimitGizmo=e.JointLimitGizmo;exports.LinearAxis=e.LinearAxis;exports.Robot=e.Robot;exports.TrajectoryRenderer=e.TrajectoryRenderer;exports.FLANGE_NODE_SUFFIX=o.FLANGE_NODE_SUFFIX;exports.JOINT_REST_SUFFIX=o.JOINT_REST_SUFFIX;exports.JoggingAxes=o.JoggingAxes;exports.MotionGroupVisualizer=o.MotionGroupVisualizer;exports.MotionGroupVisualizerExact=o.MotionGroupVisualizerExact;exports.PresetEnvironment=o.PresetEnvironment;exports.RobotScene=o.RobotScene;exports.RobotSceneView=o.RobotSceneView;exports.SafetyZonesRenderer=o.SafetyZonesRenderer;exports.SupportedLinearAxis=o.SupportedLinearAxis;exports.SupportedLinearAxisExact=o.SupportedLinearAxisExact;exports.SupportedRobot=o.SupportedRobot;exports.SupportedRobotExact=o.SupportedRobotExact;exports.defaultGetModel=o.defaultGetModel;exports.jointIndexOf=o.jointIndexOf;exports.JoggingGizmo=i.JoggingGizmo;exports.JoggingGizmoOrientation=r.JoggingGizmoOrientation;exports.RobotControlPanel=a.RobotControlPanel;exports.RobotControl=s.RobotControl;exports.RobotGhost=u.RobotGhost;exports.RobotCanvas=t.RobotCanvas;exports.RobotView=t.RobotView;exports.ValueInterpolator=R.ValueInterpolator;exports.useSmoothedMotionState=S.useSmoothedMotionState;exports.Pose3=n.Pose3;exports.parseRotationToQuaternion=n.parseRotationToQuaternion;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./chunks/Pose3-DwMOSTKO.cjs"),e=require("./chunks/JoggingGizmoOrientation-EPtBeAun.cjs"),t=require("./chunks/useSmoothedMotionState-Ce9NjwBu.cjs");exports.CollisionSceneRenderer=o.CollisionSceneRenderer;exports.JointLimitGizmo=o.JointLimitGizmo;exports.LinearAxis=o.LinearAxis;exports.MotionGroupVisualizer=o.MotionGroupVisualizer;exports.MotionGroupVisualizerExact=o.MotionGroupVisualizerExact;exports.Pose3=o.Pose3;exports.PresetEnvironment=o.PresetEnvironment;exports.Robot=o.Robot;exports.SafetyZonesRenderer=o.SafetyZonesRenderer;exports.SupportedLinearAxis=o.SupportedLinearAxis;exports.SupportedLinearAxisExact=o.SupportedLinearAxisExact;exports.SupportedRobot=o.SupportedRobot;exports.SupportedRobotExact=o.SupportedRobotExact;exports.TrajectoryRenderer=o.TrajectoryRenderer;exports.defaultGetModel=o.defaultGetModel;exports.parseRotationToQuaternion=o.parseRotationToQuaternion;exports.JoggingGizmo=e.JoggingGizmo;exports.JoggingGizmoOrientation=e.JoggingGizmoOrientation;exports.ValueInterpolator=t.ValueInterpolator;exports.useSmoothedMotionState=t.useSmoothedMotionState;
package/dist/3d.d.ts CHANGED
@@ -7,21 +7,11 @@ export { JoggingGizmo, type JoggingGizmoProps, } from "./components/jogging/gizm
7
7
  export { JoggingGizmoOrientation, type JoggingGizmoOrientationProps, } from "./components/jogging/gizmo/JoggingGizmoOrientation";
8
8
  export type { JogAxis, JogDirection, JogHandle, } from "./components/jogging/jogHandle";
9
9
  export type { JogControlsProps } from "./components/jogging/useJogControls";
10
- export { type JogMotion, RobotControlPanel, type RobotControlIncrements, type RobotControlJogMode, type RobotControlJoint, type RobotControlJoints, type RobotControlJointTarget, type RobotControlMoveState, type RobotControlMoveTo, type RobotControlOption, type RobotControlPanelProps, type RobotControlPose, type RobotControlSelect, type RobotControlTab, type RobotControlTarget, type RobotControlVelocity, } from "./components/robotControl/RobotControlPanel";
11
- export { RobotControl, type RobotControlProps, } from "./components/robotControl/RobotControl";
12
- export type { RobotControlOptions } from "./components/robotControl/useRobotControlProps";
13
- export { JoggingAxes, type JoggingAxesProps, } from "./components/robotScene/JoggingAxes";
14
- export { RobotGhost, type RobotGhostProps, type RobotGhostRobot, } from "./components/robotScene/RobotGhost";
15
- export { RobotScene, type RobotSceneProps, } from "./components/robotScene/RobotScene";
16
- export { RobotSceneView, type RobotSceneViewProps, } from "./components/robotScene/RobotSceneView";
17
- export { RobotCanvas, type RobotCanvasProps, } from "./components/robotView/RobotCanvas";
18
- export { RobotView, type RobotViewProps, } from "./components/robotView/RobotView";
19
10
  export type { WebGLUnavailableContext } from "./components/utils/useWebGLRenderer";
20
11
  export * from "./components/robots/LinearAxis";
21
12
  export * from "./components/robots/MotionGroupVisualizer";
22
13
  export * from "./components/robots/Robot";
23
- export { defaultGetModel, FLANGE_NODE_SUFFIX, JOINT_REST_SUFFIX, jointIndexOf, } from "./components/robots/robotModelLogic";
24
- export type { RobotModelSource } from "./components/robots/robotModelSource";
14
+ export { defaultGetModel } from "./components/robots/robotModelLogic";
25
15
  export * from "./components/robots/SupportedLinearAxis";
26
16
  export * from "./components/robots/SupportedRobot";
27
17
  export { ValueInterpolator, type InterpolationOptions, } from "./components/utils/interpolation";