@wandelbots/wandelbots-js-react-components 6.3.0 → 6.4.0-pr.chore-playground-tool-steps.664.4537d63

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 (191) hide show
  1. package/README.md +323 -120
  2. package/dist/3d.cjs +1 -1
  3. package/dist/3d.d.ts +5 -3
  4. package/dist/3d.js +24 -23
  5. package/dist/CurrentPoseBar/index.cjs +1 -0
  6. package/dist/CurrentPoseBar/index.d.ts +2 -0
  7. package/dist/CurrentPoseBar/index.js +5 -0
  8. package/dist/JoggingButtons/index.cjs +1 -0
  9. package/dist/JoggingButtons/index.d.ts +3 -0
  10. package/dist/JoggingButtons/index.js +5 -0
  11. package/dist/JoggingGizmo/index.cjs +1 -0
  12. package/dist/JoggingGizmo/index.d.ts +4 -0
  13. package/dist/JoggingGizmo/index.js +7 -0
  14. package/dist/JoggingJointSlider/index.cjs +1 -0
  15. package/dist/JoggingJointSlider/index.d.ts +2 -0
  16. package/dist/JoggingJointSlider/index.js +5 -0
  17. package/dist/RobotControlPanel/index.cjs +1 -0
  18. package/dist/RobotControlPanel/index.d.ts +2 -0
  19. package/dist/RobotControlPanel/index.js +5 -0
  20. package/dist/RobotHeader/index.cjs +1 -0
  21. package/dist/RobotHeader/index.d.ts +4 -0
  22. package/dist/RobotHeader/index.js +5 -0
  23. package/dist/SafetyBar/index.cjs +1 -1
  24. package/dist/SafetyBar/index.js +1 -1
  25. package/dist/chunks/CurrentPoseBar-CyHUWmjM.cjs +1 -0
  26. package/dist/chunks/CurrentPoseBar-zTZi68tY.js +505 -0
  27. package/dist/chunks/JoggingButtons-CXaozFVz.js +108 -0
  28. package/dist/chunks/JoggingButtons-CbL-5LMK.cjs +1 -0
  29. package/dist/chunks/JoggingGizmo-DGbFLWgT.cjs +1 -0
  30. package/dist/chunks/JoggingGizmo-SuS9MmL7.js +810 -0
  31. package/dist/chunks/JoggingGizmoOrientation-dzned4f4.cjs +1 -0
  32. package/dist/chunks/JoggingGizmoOrientation-x_crT_64.js +14 -0
  33. package/dist/chunks/JoggingJointSlider-CZ-k6XCa.js +406 -0
  34. package/dist/chunks/JoggingJointSlider-R3_A9Ppj.cjs +1 -0
  35. package/dist/chunks/Robot-D0ZqUCn3.cjs +1 -0
  36. package/dist/chunks/Robot-UoykZeYH.js +1272 -0
  37. package/dist/chunks/RobotControlPanel-BnMfmO41.js +822 -0
  38. package/dist/chunks/RobotControlPanel-BuDGcxPR.cjs +1 -0
  39. package/dist/chunks/RobotHeader-BZci9ahT.js +244 -0
  40. package/dist/chunks/RobotHeader-CqK0700U.cjs +1 -0
  41. package/dist/chunks/SafetyBar-Bbg-o8h9.cjs +1 -0
  42. package/dist/chunks/{SafetyBar-Cy9DiXp9.js → SafetyBar-Cuak4ffd.js} +11 -10
  43. package/dist/chunks/SmallSelect-BdD9uLKK.js +52 -0
  44. package/dist/chunks/SmallSelect-Dcsd7_6_.cjs +1 -0
  45. package/dist/chunks/TrajectoryExecutionStore-DPqfDcfn.js +3398 -0
  46. package/dist/chunks/TrajectoryExecutionStore-DV6mLEx9.cjs +3 -0
  47. package/dist/chunks/converters-C8I_A_tA.cjs +1 -0
  48. package/dist/chunks/converters-DpNB_WNQ.js +39 -0
  49. package/dist/chunks/externalizeComponent-BdxGBLIv.cjs +2 -0
  50. package/dist/chunks/externalizeComponent-_w2d1_pz.js +283 -0
  51. package/dist/chunks/holdSafety-BtoZ5We3.cjs +1 -0
  52. package/dist/chunks/holdSafety-Di1GZAWg.js +37 -0
  53. package/dist/chunks/joggingColors-CuT5u0H8.js +135 -0
  54. package/dist/chunks/joggingColors-ZDc_2UCp.cjs +1 -0
  55. package/dist/chunks/useEveryFrame-G_-ma1nC.js +142 -0
  56. package/dist/chunks/useEveryFrame-dmPPTKtT.cjs +1 -0
  57. package/dist/chunks/useSmoothedMotionState-COMJRcOt.js +214 -0
  58. package/dist/chunks/useSmoothedMotionState-Con0E5Bx.cjs +1 -0
  59. package/dist/components/AppHeader.d.ts +1 -1
  60. package/dist/components/currentPoseBar/CurrentPoseBar.d.ts +48 -0
  61. package/dist/components/currentPoseBar/OrientationFormatPopover.d.ts +19 -0
  62. package/dist/components/currentPoseBar/StreamStatus.d.ts +10 -0
  63. package/dist/components/currentPoseBar/orientation.d.ts +34 -0
  64. package/dist/components/currentPoseBar/poseValues.d.ts +15 -0
  65. package/dist/components/jogging/JoggingButtons.d.ts +16 -0
  66. package/dist/components/jogging/JoggingCartesianAxisControl.d.ts +1 -1
  67. package/dist/components/jogging/JoggingJointTab.d.ts +1 -1
  68. package/dist/components/jogging/JoggingPanel.d.ts +6 -3
  69. package/dist/components/jogging/JoggingStore.d.ts +96 -19
  70. package/dist/components/jogging/gizmo/JoggingGizmo.d.ts +43 -0
  71. package/dist/components/jogging/gizmo/JoggingGizmoOrientation.d.ts +26 -0
  72. package/dist/components/jogging/gizmo/RotationHandles.d.ts +7 -0
  73. package/dist/components/jogging/gizmo/RotationScene.d.ts +6 -0
  74. package/dist/components/jogging/gizmo/TranslationHandles.d.ts +6 -0
  75. package/dist/components/jogging/gizmo/TranslationScene.d.ts +6 -0
  76. package/dist/components/jogging/gizmo/arcGrabAreas.d.ts +58 -0
  77. package/dist/components/jogging/gizmo/arcs.d.ts +54 -0
  78. package/dist/components/jogging/gizmo/arrows.d.ts +63 -0
  79. package/dist/components/jogging/gizmo/gizmoShared.d.ts +125 -0
  80. package/dist/components/jogging/gizmo/gizmoView.d.ts +42 -0
  81. package/dist/components/jogging/gizmo/useGizmoTurn.d.ts +11 -0
  82. package/dist/components/jogging/holdSafety.d.ts +44 -0
  83. package/dist/components/jogging/jogError.d.ts +9 -0
  84. package/dist/components/jogging/jogHandle.d.ts +23 -0
  85. package/dist/components/jogging/joggingColors.d.ts +24 -0
  86. package/dist/components/jogging/joggingVelocity.d.ts +21 -0
  87. package/dist/components/jogging/joint/JoggingJointSlider.d.ts +52 -0
  88. package/dist/components/jogging/joint/JointSliderTrack.d.ts +27 -0
  89. package/dist/components/jogging/joint/jointJog.d.ts +55 -0
  90. package/dist/components/jogging/joint/useJointJogHold.d.ts +48 -0
  91. package/dist/components/jogging/useHold.d.ts +38 -0
  92. package/dist/components/jogging/useJogControls.d.ts +45 -0
  93. package/dist/components/robotControl/CartesianJogTab.d.ts +21 -0
  94. package/dist/components/robotControl/HoldToMoveButton.d.ts +25 -0
  95. package/dist/components/robotControl/JogArea.d.ts +22 -0
  96. package/dist/components/robotControl/JogModeToggle.d.ts +8 -0
  97. package/dist/components/robotControl/JointJogTab.d.ts +11 -0
  98. package/dist/components/robotControl/MoveToTab.d.ts +18 -0
  99. package/dist/components/robotControl/PanelSelect.d.ts +13 -0
  100. package/dist/components/robotControl/PoseField.d.ts +21 -0
  101. package/dist/components/robotControl/RobotControlPanel.d.ts +212 -0
  102. package/dist/components/robotControl/Section.d.ts +5 -0
  103. package/dist/components/robotControl/SmallSelect.d.ts +15 -0
  104. package/dist/components/robotControl/VelocityRow.d.ts +14 -0
  105. package/dist/components/robotControl/atPose.d.ts +8 -0
  106. package/dist/components/robotControl/poseText.d.ts +15 -0
  107. package/dist/components/robotControl/units.d.ts +16 -0
  108. package/dist/components/robotControl/useCopyText.d.ts +12 -0
  109. package/dist/components/robotControl/useEveryFrame.d.ts +6 -0
  110. package/dist/components/robotHeader/ActivationSwitch.d.ts +7 -0
  111. package/dist/components/robotHeader/AppNavigation.d.ts +15 -0
  112. package/dist/components/robotHeader/RobotHeader.d.ts +42 -0
  113. package/dist/components/robots/GenericRobot.d.ts +2 -1
  114. package/dist/components/robots/LinearAxis.d.ts +1 -1
  115. package/dist/components/robots/LinearAxisAnimator.d.ts +11 -2
  116. package/dist/components/robots/Robot.d.ts +1 -1
  117. package/dist/components/robots/robotModelLogic.d.ts +11 -9
  118. package/dist/components/utils/hooks.d.ts +1 -6
  119. package/dist/core.cjs +1 -1
  120. package/dist/core.d.ts +13 -18
  121. package/dist/core.js +37 -51
  122. package/dist/index.cjs +1 -1
  123. package/dist/index.js +58 -71
  124. package/dist/lib/ConnectedMotionGroup.d.ts +5 -7
  125. package/dist/lib/JoggerConnection.d.ts +137 -27
  126. package/dist/lib/MotionStreamConnection.d.ts +15 -6
  127. package/dist/lib/Pose3.d.ts +22 -0
  128. package/dist/lib/PoseTransformer.d.ts +25 -0
  129. package/dist/lib/TrajectoryExecutionStore.d.ts +129 -0
  130. package/dist/lib/connectionLogger.d.ts +9 -0
  131. package/dist/lib/incrementalCartesianMotion.d.ts +40 -0
  132. package/dist/lib/motionStateUpdate.d.ts +27 -0
  133. package/dist/lib/novaConnection.d.ts +23 -0
  134. package/dist/lib/planErrorTranslation.d.ts +8 -0
  135. package/dist/lib/rotation.d.ts +12 -0
  136. package/package.json +31 -66
  137. package/dist/Setup.d.ts +0 -11
  138. package/dist/chunks/MotionGroupVisualizer-DshWR1wY.js +0 -1653
  139. package/dist/chunks/MotionGroupVisualizer-eD7yFEcF.cjs +0 -1
  140. package/dist/chunks/SafetyBar-DPrv_OQA.cjs +0 -1
  141. package/dist/chunks/externalizeComponent-EDymnaGR.js +0 -268
  142. package/dist/chunks/externalizeComponent-OO4jcrz5.cjs +0 -2
  143. package/dist/chunks/theming-DfSy4-Ic.cjs +0 -4
  144. package/dist/chunks/theming-mF9Rt8SS.js +0 -5542
  145. package/dist/chunks/useSmoothedMotionState-DyDgSVYX.js +0 -478
  146. package/dist/chunks/useSmoothedMotionState-VYxEIyfr.cjs +0 -1
  147. package/dist/components/3d-viewport/CoordinateSystemTransform.d.ts +0 -11
  148. package/dist/components/AdornedTextField.d.ts +0 -7
  149. package/dist/components/CopyableText.d.ts +0 -6
  150. package/dist/components/CycleTimer/CycleTimer.d.ts +0 -3
  151. package/dist/components/CycleTimer/DefaultVariant.d.ts +0 -9
  152. package/dist/components/CycleTimer/SmallVariant.d.ts +0 -10
  153. package/dist/components/CycleTimer/index.d.ts +0 -27
  154. package/dist/components/CycleTimer/types.d.ts +0 -49
  155. package/dist/components/CycleTimer/useAnimations.d.ts +0 -14
  156. package/dist/components/CycleTimer/useTimerLogic.d.ts +0 -24
  157. package/dist/components/CycleTimer/utils.d.ts +0 -21
  158. package/dist/components/CycleTimer.d.ts +0 -3
  159. package/dist/components/DataGrid.d.ts +0 -66
  160. package/dist/components/LogPanel.d.ts +0 -38
  161. package/dist/components/LogStore.d.ts +0 -12
  162. package/dist/components/LogViewer.d.ts +0 -46
  163. package/dist/components/ProgramControl.d.ts +0 -55
  164. package/dist/components/ProgramStateIndicator.d.ts +0 -26
  165. package/dist/components/RobotCard.d.ts +0 -98
  166. package/dist/components/RobotListItem.d.ts +0 -34
  167. package/dist/components/RobotSetupReadinessIndicator.d.ts +0 -37
  168. package/dist/components/SelectableFab.d.ts +0 -7
  169. package/dist/components/TabBar.d.ts +0 -45
  170. package/dist/components/ThemeSelect.d.ts +0 -6
  171. package/dist/components/Timer/Timer.d.ts +0 -3
  172. package/dist/components/Timer/TimerDefaultVariant.d.ts +0 -9
  173. package/dist/components/Timer/TimerSmallVariant.d.ts +0 -10
  174. package/dist/components/Timer/index.d.ts +0 -19
  175. package/dist/components/Timer/types.d.ts +0 -35
  176. package/dist/components/Timer/useTimerAnimations.d.ts +0 -10
  177. package/dist/components/Timer/useTimerLogic.d.ts +0 -19
  178. package/dist/components/Timer/utils.d.ts +0 -17
  179. package/dist/components/Timer.d.ts +0 -3
  180. package/dist/components/TransparentOverlay.d.ts +0 -4
  181. package/dist/components/jogging/JoggingFreedriveTab.d.ts +0 -1
  182. package/dist/components/jogging/PoseCartesianValues.d.ts +0 -9
  183. package/dist/components/jogging/PoseJointValues.d.ts +0 -8
  184. package/dist/components/robots/AxisConfig.d.ts +0 -2
  185. package/dist/components/robots/manufacturerHomePositions.d.ts +0 -20
  186. package/dist/icons/DropdownArrowIcon.d.ts +0 -2
  187. package/dist/icons/index.d.ts +0 -12
  188. package/dist/lib/novaCompat.d.ts +0 -16
  189. package/dist/themes/createDarkTheme.d.ts +0 -7
  190. package/dist/themes/themeTypes.d.ts +0 -40
  191. package/dist/themes/theming.d.ts +0 -24
@@ -0,0 +1,135 @@
1
+ import { useRef as p, useState as P, useCallback as d, useEffect as A } from "react";
2
+ import { useTranslation as h } from "react-i18next";
3
+ import { u as R, p as S, e as v, s as B, a as D, b as E } from "./holdSafety-Di1GZAWg.js";
4
+ import { ColorsBlue400 as I, ColorsGreen400 as J, ColorsRed400 as j } from "@wandelbots/design-tokens";
5
+ const O = ["x", "y", "z"], T = ["-", "+"];
6
+ function x(n, s) {
7
+ return !!n && !!s && n.axis === s.axis && n.direction === s.direction;
8
+ }
9
+ function K(n, s = "translate") {
10
+ return s === "rotate" ? `R${n.axis}${n.direction}` : `${n.axis.toUpperCase()}${n.direction}`;
11
+ }
12
+ const k = (n) => n === " " || n === "Enter";
13
+ function U({
14
+ onStart: n,
15
+ onStop: s,
16
+ disabled: u = !1,
17
+ isSame: f
18
+ }) {
19
+ const t = p(null), [C, g] = P(null), l = p(null), i = p({ onStop: s, isSame: f });
20
+ i.current = { onStop: s, isSame: f };
21
+ const a = d(
22
+ (e) => u || t.current !== null ? !1 : (t.current = e, g(e), n(e), !0),
23
+ [u, n]
24
+ ), o = d((e) => {
25
+ const r = t.current;
26
+ r !== null && (e !== void 0 && !i.current.isSame(r, e) || (t.current = null, l.current = null, g(null), i.current.onStop()));
27
+ }, []), m = d(() => o(), [o]);
28
+ R(C !== null, u, m);
29
+ const H = d(
30
+ (e) => ({
31
+ onPointerDown: (r) => {
32
+ var c, y;
33
+ E(r) && a(e) && (l.current = r.pointerId, (y = (c = r.currentTarget).setPointerCapture) == null || y.call(c, r.pointerId));
34
+ },
35
+ onPointerMove: (r) => {
36
+ l.current === r.pointerId && D(r) && o(e);
37
+ },
38
+ onPointerUp: () => o(e),
39
+ onPointerCancel: () => o(e),
40
+ onLostPointerCapture: () => o(e),
41
+ onKeyDown: (r) => {
42
+ const c = k(r.key);
43
+ c && r.preventDefault(), t.current !== null ? v(r) && o() : c && B(r) && a(e);
44
+ },
45
+ onKeyUp: (r) => {
46
+ k(r.key) && o(e);
47
+ },
48
+ onBlur: (r) => o(e),
49
+ onContextMenu: S
50
+ }),
51
+ [a, o]
52
+ );
53
+ return { held: C, handlersFor: H, stop: m };
54
+ }
55
+ function _({
56
+ motion: n = "translate",
57
+ onJogStart: s,
58
+ onJogStop: u,
59
+ activeHandle: f,
60
+ disabled: t = !1
61
+ }) {
62
+ const { t: C } = h(), g = d(
63
+ (o) => s(o.axis, o.direction),
64
+ [s]
65
+ ), { held: l, handlersFor: i, stop: a } = U({
66
+ onStart: g,
67
+ onStop: u,
68
+ disabled: t,
69
+ isSame: x
70
+ });
71
+ return A(() => {
72
+ a();
73
+ }, [n, a]), {
74
+ held: l,
75
+ handlersFor: i,
76
+ /** The accessible name of a control, e.g. "Jog X+", or "Jog Rx+" rotating */
77
+ label: (o) => C("Jogging.Handle.lb", { handle: K(o, n) }),
78
+ /** Whether a control shows as pressed: while it is held or shown as active */
79
+ isPressed: (o) => x(l, o) || x(f, o)
80
+ };
81
+ }
82
+ const b = "rgba(255, 255, 255, 1)", z = {
83
+ X: {
84
+ backgroundColor: "rgba(215, 66, 56, 1)",
85
+ borderColor: "rgba(215, 66, 56, 1)",
86
+ buttonBackgroundColor: {
87
+ default: "rgba(241, 77, 66, 1)",
88
+ pressed: "rgba(138, 41, 35, 1)",
89
+ hovered: "rgba(241, 77, 66, 1)",
90
+ disabled: "rgba(241, 77, 66, 1)"
91
+ },
92
+ color: "rgba(255, 198, 198, 1)",
93
+ labelColor: b
94
+ },
95
+ Y: {
96
+ backgroundColor: "rgba(20, 151, 108, 1)",
97
+ borderColor: "rgba(20, 151, 108, 1)",
98
+ buttonBackgroundColor: {
99
+ default: "rgba(28, 188, 135, 1)",
100
+ pressed: "rgba(11, 89, 63, 1)",
101
+ disabled: "rgba(28, 188, 135, 1)",
102
+ hovered: "rgba(28, 188, 135, 1)"
103
+ },
104
+ color: "rgba(215, 255, 242, 1)",
105
+ labelColor: b
106
+ },
107
+ Z: {
108
+ backgroundColor: "rgba(1, 87, 155, 1)",
109
+ borderColor: "rgba(1, 87, 155, 1)",
110
+ buttonBackgroundColor: {
111
+ default: "rgba(2, 136, 209, 1)",
112
+ pressed: "rgba(2, 64, 114, 1)",
113
+ disabled: "rgba(2, 136, 209, 1)",
114
+ hovered: "rgba(2, 136, 209, 1)"
115
+ },
116
+ color: "rgba(210, 239, 255, 1)",
117
+ labelColor: b
118
+ }
119
+ }, F = b, L = b, N = {
120
+ x: j,
121
+ y: J,
122
+ z: I
123
+ };
124
+ export {
125
+ O as J,
126
+ T as a,
127
+ K as b,
128
+ z as c,
129
+ U as d,
130
+ F as e,
131
+ x as i,
132
+ N as j,
133
+ _ as u,
134
+ L as v
135
+ };
@@ -0,0 +1 @@
1
+ "use strict";const s=require("react"),I=require("react-i18next"),i=require("./holdSafety-BtoZ5We3.cjs"),x=require("@wandelbots/design-tokens"),J=["x","y","z"],h=["-","+"];function k(e,t){return!!e&&!!t&&e.axis===t.axis&&e.direction===t.direction}function S(e,t="translate"){return t==="rotate"?`R${e.axis}${e.direction}`:`${e.axis.toUpperCase()}${e.direction}`}const A=e=>e===" "||e==="Enter";function R({onStart:e,onStop:t,disabled:c=!1,isSame:g}){const l=s.useRef(null),[f,p]=s.useState(null),a=s.useRef(null),d=s.useRef({onStop:t,isSame:g});d.current={onStop:t,isSame:g};const u=s.useCallback(n=>c||l.current!==null?!1:(l.current=n,p(n),e(n),!0),[c,e]),o=s.useCallback(n=>{const r=l.current;r!==null&&(n!==void 0&&!d.current.isSame(r,n)||(l.current=null,a.current=null,p(null),d.current.onStop()))},[]),y=s.useCallback(()=>o(),[o]);i.useEndHoldWhenUnattended(f!==null,c,y);const P=s.useCallback(n=>({onPointerDown:r=>{var b,H;i.startsPointerHold(r)&&u(n)&&(a.current=r.pointerId,(H=(b=r.currentTarget).setPointerCapture)==null||H.call(b,r.pointerId))},onPointerMove:r=>{a.current===r.pointerId&&i.primaryReleased(r)&&o(n)},onPointerUp:()=>o(n),onPointerCancel:()=>o(n),onLostPointerCapture:()=>o(n),onKeyDown:r=>{const b=A(r.key);b&&r.preventDefault(),l.current!==null?i.endsHold(r)&&o():b&&i.startsKeyHold(r)&&u(n)},onKeyUp:r=>{A(r.key)&&o(n)},onBlur:r=>o(n),onContextMenu:i.preventContextMenu}),[u,o]);return{held:f,handlersFor:P,stop:y}}function E({motion:e="translate",onJogStart:t,onJogStop:c,activeHandle:g,disabled:l=!1}){const{t:f}=I.useTranslation(),p=s.useCallback(o=>t(o.axis,o.direction),[t]),{held:a,handlersFor:d,stop:u}=R({onStart:p,onStop:c,disabled:l,isSame:k});return s.useEffect(()=>{u()},[e,u]),{held:a,handlersFor:d,label:o=>f("Jogging.Handle.lb",{handle:S(o,e)}),isPressed:o=>k(a,o)||k(g,o)}}const C="rgba(255, 255, 255, 1)",j={X:{backgroundColor:"rgba(215, 66, 56, 1)",borderColor:"rgba(215, 66, 56, 1)",buttonBackgroundColor:{default:"rgba(241, 77, 66, 1)",pressed:"rgba(138, 41, 35, 1)",hovered:"rgba(241, 77, 66, 1)",disabled:"rgba(241, 77, 66, 1)"},color:"rgba(255, 198, 198, 1)",labelColor:C},Y:{backgroundColor:"rgba(20, 151, 108, 1)",borderColor:"rgba(20, 151, 108, 1)",buttonBackgroundColor:{default:"rgba(28, 188, 135, 1)",pressed:"rgba(11, 89, 63, 1)",disabled:"rgba(28, 188, 135, 1)",hovered:"rgba(28, 188, 135, 1)"},color:"rgba(215, 255, 242, 1)",labelColor:C},Z:{backgroundColor:"rgba(1, 87, 155, 1)",borderColor:"rgba(1, 87, 155, 1)",buttonBackgroundColor:{default:"rgba(2, 136, 209, 1)",pressed:"rgba(2, 64, 114, 1)",disabled:"rgba(2, 136, 209, 1)",hovered:"rgba(2, 136, 209, 1)"},color:"rgba(210, 239, 255, 1)",labelColor:C}},D=C,O=C,m={x:x.ColorsRed400,y:x.ColorsGreen400,z:x.ColorsBlue400};exports.JOG_AXES=J;exports.JOG_DIRECTIONS=h;exports.cartesianAxisColors=j;exports.isSameJogHandle=k;exports.jogAxisColors=m;exports.jogHandleName=S;exports.jointArrowColor=D;exports.useHold=R;exports.useJogControls=E;exports.velocitySliderLegendColor=O;
@@ -0,0 +1,142 @@
1
+ import { jsx as u, jsxs as T } from "react/jsx-runtime";
2
+ import I from "@mui/material/Box";
3
+ import C from "@mui/material/MenuItem";
4
+ import w from "@mui/material/Stack";
5
+ import E from "@mui/material/Typography";
6
+ import { AdornedSelect as m } from "@wandelbots/mui";
7
+ import { useId as f, useState as d, useEffect as p, useRef as F } from "react";
8
+ function y(t, e) {
9
+ var r;
10
+ return ((r = t.find((o) => o.id === e)) == null ? void 0 : r.label) ?? String(e);
11
+ }
12
+ function h(t) {
13
+ return t.map((e) => /* @__PURE__ */ u(C, { value: e.id, children: e.label }, e.id));
14
+ }
15
+ function B({
16
+ label: t,
17
+ options: e,
18
+ value: r,
19
+ onChange: o,
20
+ disabled: i
21
+ }) {
22
+ const n = f();
23
+ return /* @__PURE__ */ u(
24
+ m,
25
+ {
26
+ label: t,
27
+ labelId: n,
28
+ value: r,
29
+ disabled: i,
30
+ renderValue: (a) => y(e, a),
31
+ onChange: (a) => o(String(a.target.value)),
32
+ children: h(e)
33
+ }
34
+ );
35
+ }
36
+ function M({
37
+ label: t,
38
+ options: e,
39
+ value: r,
40
+ onChange: o,
41
+ disabled: i
42
+ }) {
43
+ const n = f();
44
+ return /* @__PURE__ */ T(
45
+ w,
46
+ {
47
+ direction: "row",
48
+ sx: { alignItems: "center", justifyContent: "space-between", gap: 2 },
49
+ children: [
50
+ /* @__PURE__ */ u(E, { id: n, variant: "body2", color: "text.secondary", children: t }),
51
+ /* @__PURE__ */ u(I, { sx: { width: "calc((100% - 12px) / 2)", flexShrink: 0 }, children: /* @__PURE__ */ u(
52
+ m,
53
+ {
54
+ labelId: n,
55
+ adornedSize: "small",
56
+ value: r,
57
+ disabled: i,
58
+ renderValue: (a) => y(e, a),
59
+ onChange: (a) => o(String(a.target.value)),
60
+ children: h(e)
61
+ }
62
+ ) })
63
+ ]
64
+ }
65
+ );
66
+ }
67
+ function s() {
68
+ try {
69
+ return document.execCommand("copy");
70
+ } catch {
71
+ return !1;
72
+ }
73
+ }
74
+ function O() {
75
+ const [t, e] = d(!1);
76
+ p(() => {
77
+ if (!t) return;
78
+ const o = setTimeout(() => e(!1), 3e3);
79
+ return () => clearTimeout(o);
80
+ }, [t]);
81
+ async function r(o, i) {
82
+ try {
83
+ if (navigator.clipboard) {
84
+ await navigator.clipboard.writeText(o), e(!0);
85
+ return;
86
+ }
87
+ } catch {
88
+ }
89
+ if (i) {
90
+ i(), s() && e(!0);
91
+ return;
92
+ }
93
+ const n = document.createElement("textarea");
94
+ n.value = o, n.readOnly = !0, n.style.position = "fixed", n.style.opacity = "0", document.body.appendChild(n), n.select(), s() && e(!0), n.remove();
95
+ }
96
+ return { copied: t, copy: r };
97
+ }
98
+ const N = /^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/;
99
+ function W(t) {
100
+ const e = (r, o) => Number.parseFloat(r.toFixed(o));
101
+ return `(${[
102
+ ...t.position.map((r) => e(r, 1)),
103
+ ...t.orientation.map((r) => e(r, 4))
104
+ ].join(", ")})`;
105
+ }
106
+ function $(t) {
107
+ let e = t.trim();
108
+ const r = e.startsWith("("), o = e.endsWith(")");
109
+ if (r !== o || (r && (e = e.slice(1, -1)), e.trim() === "")) return null;
110
+ const i = [];
111
+ for (const S of e.split(",")) {
112
+ const l = S.trim();
113
+ if (!N.test(l)) return null;
114
+ const c = Number(l);
115
+ if (!Number.isFinite(c)) return null;
116
+ i.push(c);
117
+ }
118
+ if (i.length !== 6) return null;
119
+ const [n, a, x, b, g, v] = i;
120
+ return { position: [n, a, x], orientation: [b, g, v] };
121
+ }
122
+ function q(t, e) {
123
+ const r = F(t);
124
+ r.current = t;
125
+ const [o, i] = d(t);
126
+ return p(() => {
127
+ if (!e) return;
128
+ let n = 0;
129
+ const a = () => {
130
+ i(r.current()), n = requestAnimationFrame(a);
131
+ };
132
+ return a(), () => cancelAnimationFrame(n);
133
+ }, [e]), o;
134
+ }
135
+ export {
136
+ M as I,
137
+ B as P,
138
+ q as a,
139
+ $ as b,
140
+ W as p,
141
+ O as u
142
+ };
@@ -0,0 +1 @@
1
+ "use strict";const c=require("react/jsx-runtime"),b=require("@mui/material/Box"),g=require("@mui/material/MenuItem"),v=require("@mui/material/Stack"),j=require("@mui/material/Typography"),f=require("@wandelbots/mui"),s=require("react");function m(t,e){var n;return((n=t.find(i=>i.id===e))==null?void 0:n.label)??String(e)}function p(t){return t.map(e=>c.jsx(g,{value:e.id,children:e.label},e.id))}function I({label:t,options:e,value:n,onChange:i,disabled:o}){const r=s.useId();return c.jsx(f.AdornedSelect,{label:t,labelId:r,value:n,disabled:o,renderValue:u=>m(e,u),onChange:u=>i(String(u.target.value)),children:p(e)})}function q({label:t,options:e,value:n,onChange:i,disabled:o}){const r=s.useId();return c.jsxs(v,{direction:"row",sx:{alignItems:"center",justifyContent:"space-between",gap:2},children:[c.jsx(j,{id:r,variant:"body2",color:"text.secondary",children:t}),c.jsx(b,{sx:{width:"calc((100% - 12px) / 2)",flexShrink:0},children:c.jsx(f.AdornedSelect,{labelId:r,adornedSize:"small",value:n,disabled:o,renderValue:u=>m(e,u),onChange:u=>i(String(u.target.value)),children:p(e)})})]})}function d(){try{return document.execCommand("copy")}catch{return!1}}function C(){const[t,e]=s.useState(!1);s.useEffect(()=>{if(!t)return;const i=setTimeout(()=>e(!1),3e3);return()=>clearTimeout(i)},[t]);async function n(i,o){try{if(navigator.clipboard){await navigator.clipboard.writeText(i),e(!0);return}}catch{}if(o){o(),d()&&e(!0);return}const r=document.createElement("textarea");r.value=i,r.readOnly=!0,r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.select(),d()&&e(!0),r.remove()}return{copied:t,copy:n}}const E=/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/;function F(t){const e=(n,i)=>Number.parseFloat(n.toFixed(i));return`(${[...t.position.map(n=>e(n,1)),...t.orientation.map(n=>e(n,4))].join(", ")})`}function w(t){let e=t.trim();const n=e.startsWith("("),i=e.endsWith(")");if(n!==i||(n&&(e=e.slice(1,-1)),e.trim()===""))return null;const o=[];for(const T of e.split(",")){const l=T.trim();if(!E.test(l))return null;const a=Number(l);if(!Number.isFinite(a))return null;o.push(a)}if(o.length!==6)return null;const[r,u,x,y,h,S]=o;return{position:[r,u,x],orientation:[y,h,S]}}function A(t,e){const n=s.useRef(t);n.current=t;const[i,o]=s.useState(t);return s.useEffect(()=>{if(!e)return;let r=0;const u=()=>{o(n.current()),r=requestAnimationFrame(u)};return u(),()=>cancelAnimationFrame(r)},[e]),i}exports.InlineSelect=q;exports.PanelSelect=I;exports.parsePoseText=w;exports.poseToText=F;exports.useCopyText=C;exports.useEveryFrame=A;
@@ -0,0 +1,214 @@
1
+ import { Nova as d } from "@wandelbots/nova-js/v2";
2
+ import { autorun as A, observable as y, runInAction as T } from "mobx";
3
+ import V, { useEffect as C, useState as w, useRef as v } from "react";
4
+ function I(e) {
5
+ C(e, []);
6
+ }
7
+ function _(e) {
8
+ I(() => A(e));
9
+ }
10
+ function j(e) {
11
+ return I(() => {
12
+ let t;
13
+ function n() {
14
+ e(), t = requestAnimationFrame(n);
15
+ }
16
+ return t = requestAnimationFrame(n), () => {
17
+ cancelAnimationFrame(t);
18
+ };
19
+ });
20
+ }
21
+ function k(e) {
22
+ return e instanceof d ? e : typeof e == "string" ? new d({ instanceUrl: e }) : new d({
23
+ instanceUrl: e.config.instanceUrl,
24
+ accessToken: e.accessToken ?? e.config.accessToken ?? void 0
25
+ });
26
+ }
27
+ function q(e) {
28
+ return typeof e == "string" ? void 0 : e.config.cellId;
29
+ }
30
+ class F {
31
+ constructor(t = [], n = {}) {
32
+ this.currentValues = [], this.targetValues = [], this.previousTargetValues = [], this.targetUpdateTime = 0, this.animationId = null, this.updateCount = 0, this.velocities = [], this.animate = () => {
33
+ this.update(0.016666666666666666) ? this.animationId = null : this.animationId = requestAnimationFrame(this.animate);
34
+ }, this.options = {
35
+ tension: 120,
36
+ friction: 20,
37
+ threshold: 1e-3,
38
+ onChange: () => {
39
+ },
40
+ onComplete: () => {
41
+ },
42
+ ...n
43
+ }, this.currentValues = [...t], this.targetValues = [...t], this.previousTargetValues = [...t], this.velocities = new Array(t.length).fill(0), this.targetUpdateTime = performance.now(), this.updateCount = 0;
44
+ }
45
+ /**
46
+ * Update interpolation using spring physics
47
+ *
48
+ * Call this method every frame for smooth animation. In React Three Fiber,
49
+ * call from within useFrame callback with the provided delta time.
50
+ *
51
+ * @param delta - Time elapsed since last update in seconds (e.g., 1/60 ≈ 0.0167 for 60fps)
52
+ * @returns true when interpolation is complete (all values reached their targets)
53
+ */
54
+ update(t = 1 / 60) {
55
+ let n = !1, s = !0;
56
+ this.updateCount++;
57
+ const o = Math.min(t, 1 / 15), u = this.updateCount === 1 ? 0.7 : 1;
58
+ for (let i = 0; i < this.currentValues.length; i++) {
59
+ const l = this.currentValues[i], h = this.targetValues[i], g = this.velocities[i], r = h - l, a = r * this.options.tension * u, f = g * this.options.friction, c = a - f, m = g + c * o, p = l + m * o;
60
+ Math.abs(r) < this.options.threshold && Math.abs(m) < this.options.threshold * 10 ? this.currentValues[i] !== h && (this.currentValues[i] = h, this.velocities[i] = 0, n = !0) : (s = !1, this.currentValues[i] = p, this.velocities[i] = m, n = !0);
61
+ }
62
+ return n && this.options.onChange(this.currentValues), s && this.options.onComplete(this.currentValues), s;
63
+ }
64
+ /**
65
+ * Set new target values for the interpolation to move towards
66
+ *
67
+ * Includes smart blending for very rapid target updates (faster than 120fps)
68
+ * to prevent jarring movements when targets change frequently.
69
+ */
70
+ setTarget(t) {
71
+ const n = performance.now(), s = n - this.targetUpdateTime;
72
+ this.previousTargetValues = [...this.targetValues], this.targetValues = [...t], this.targetUpdateTime = n, this.updateCount = 0;
73
+ const o = this.previousTargetValues.every(
74
+ (u, i) => u === this.currentValues[i]
75
+ );
76
+ if (s < 8 && s > 0 && this.previousTargetValues.length > 0 && !o) {
77
+ const u = Math.min(s / 8, 1);
78
+ for (let i = 0; i < this.targetValues.length; i++) {
79
+ const l = this.previousTargetValues[i] || 0, h = t[i] || 0;
80
+ Math.abs(h - l) > 0.1 && (this.targetValues[i] = l + (h - l) * u);
81
+ }
82
+ }
83
+ for (; this.currentValues.length < t.length; )
84
+ this.currentValues.push(t[this.currentValues.length]), this.velocities.push(0);
85
+ this.currentValues.length > t.length && (this.currentValues = this.currentValues.slice(0, t.length), this.velocities = this.velocities.slice(0, t.length));
86
+ }
87
+ /**
88
+ * Get a copy of all current interpolated values
89
+ */
90
+ getCurrentValues() {
91
+ return [...this.currentValues];
92
+ }
93
+ /**
94
+ * Get a single interpolated value by its array index
95
+ */
96
+ getValue(t) {
97
+ return this.currentValues[t] ?? 0;
98
+ }
99
+ /**
100
+ * Check if automatic interpolation is currently running
101
+ *
102
+ * This only tracks auto-interpolation started with startAutoInterpolation().
103
+ * Manual update() calls are not tracked by this method.
104
+ */
105
+ isInterpolating() {
106
+ return this.animationId !== null;
107
+ }
108
+ /**
109
+ * Stop automatic interpolation if it's running
110
+ *
111
+ * This cancels the internal animation frame loop but does not affect
112
+ * manual update() calls.
113
+ */
114
+ stop() {
115
+ this.animationId !== null && (cancelAnimationFrame(this.animationId), this.animationId = null);
116
+ }
117
+ /**
118
+ * Instantly set values without interpolation
119
+ */
120
+ setImmediate(t) {
121
+ this.stop(), this.currentValues = [...t], this.targetValues = [...t], this.previousTargetValues = [...t], this.velocities = new Array(t.length).fill(0), this.targetUpdateTime = performance.now(), this.updateCount = 0, this.options.onChange(this.currentValues);
122
+ }
123
+ /**
124
+ * Update interpolation options
125
+ */
126
+ updateOptions(t) {
127
+ this.options = { ...this.options, ...t };
128
+ }
129
+ /**
130
+ * Start automatic interpolation with an animation loop
131
+ *
132
+ * This begins a requestAnimationFrame loop that calls update() automatically.
133
+ * For React Three Fiber components, prefer using manual update() calls
134
+ * within useFrame hooks instead.
135
+ */
136
+ startAutoInterpolation() {
137
+ this.startInterpolation();
138
+ }
139
+ /**
140
+ * Clean up all resources and stop any running animations
141
+ *
142
+ * This cancels any active animation frames and resets internal state.
143
+ * Call this when the component unmounts or is no longer needed.
144
+ */
145
+ destroy() {
146
+ this.stop();
147
+ }
148
+ startInterpolation() {
149
+ this.animationId === null && this.animate();
150
+ }
151
+ }
152
+ function O(e = [], t = {}) {
153
+ const n = V.useRef(null);
154
+ return n.current || (n.current = new F(e, t)), V.useEffect(() => {
155
+ var s;
156
+ (s = n.current) == null || s.updateOptions(t);
157
+ }, [t]), V.useEffect(() => () => {
158
+ var s;
159
+ (s = n.current) == null || s.destroy();
160
+ }, []), [n.current];
161
+ }
162
+ function E(e, t) {
163
+ const [n] = w(
164
+ () => y({ ...e })
165
+ ), s = v(null), o = v(null), u = v(0);
166
+ function i() {
167
+ o.current !== null && (cancelAnimationFrame(o.current), o.current = null);
168
+ }
169
+ function l() {
170
+ const r = s.current;
171
+ if (!r) return;
172
+ const a = performance.now(), f = (a - u.current) / 1e3;
173
+ u.current = a;
174
+ const c = r.update(f);
175
+ T(() => {
176
+ n.joint_position = r.getCurrentValues();
177
+ }), o.current = c ? null : requestAnimationFrame(l);
178
+ }
179
+ function h() {
180
+ o.current === null && (u.current = performance.now(), o.current = requestAnimationFrame(l));
181
+ }
182
+ function g(r) {
183
+ var f;
184
+ const a = r.joint_position.filter(
185
+ (c) => c !== void 0
186
+ );
187
+ (f = s.current) == null || f.setTarget(a), T(() => {
188
+ const c = r, m = n;
189
+ for (const p of Object.keys(c))
190
+ p !== "joint_position" && m[p] !== c[p] && (m[p] = c[p]);
191
+ }), h();
192
+ }
193
+ return I(() => {
194
+ const r = e.joint_position.filter(
195
+ (a) => a !== void 0
196
+ );
197
+ return s.current = new F(r, t), () => {
198
+ var a;
199
+ i(), (a = s.current) == null || a.destroy();
200
+ };
201
+ }), C(() => {
202
+ var r;
203
+ t && ((r = s.current) == null || r.updateOptions(t));
204
+ }, [t]), C(() => A(() => g(e)), [e]), n;
205
+ }
206
+ export {
207
+ F as V,
208
+ E as a,
209
+ _ as b,
210
+ k as c,
211
+ j as d,
212
+ q as e,
213
+ O as u
214
+ };
@@ -0,0 +1 @@
1
+ "use strict";const v=require("@wandelbots/nova-js/v2"),V=require("mobx"),u=require("react");function I(e){u.useEffect(e,[])}function T(e){I(()=>V.autorun(e))}function A(e){return I(()=>{let t;function n(){e(),t=requestAnimationFrame(n)}return t=requestAnimationFrame(n),()=>{cancelAnimationFrame(t)}})}function F(e){return e instanceof v.Nova?e:typeof e=="string"?new v.Nova({instanceUrl:e}):new v.Nova({instanceUrl:e.config.instanceUrl,accessToken:e.accessToken??e.config.accessToken??void 0})}function y(e){return typeof e=="string"?void 0:e.config.cellId}class C{constructor(t=[],n={}){this.currentValues=[],this.targetValues=[],this.previousTargetValues=[],this.targetUpdateTime=0,this.animationId=null,this.updateCount=0,this.velocities=[],this.animate=()=>{this.update(.016666666666666666)?this.animationId=null:this.animationId=requestAnimationFrame(this.animate)},this.options={tension:120,friction:20,threshold:.001,onChange:()=>{},onComplete:()=>{},...n},this.currentValues=[...t],this.targetValues=[...t],this.previousTargetValues=[...t],this.velocities=new Array(t.length).fill(0),this.targetUpdateTime=performance.now(),this.updateCount=0}update(t=1/60){let n=!1,s=!0;this.updateCount++;const o=Math.min(t,1/15),c=this.updateCount===1?.7:1;for(let i=0;i<this.currentValues.length;i++){const l=this.currentValues[i],f=this.targetValues[i],d=this.velocities[i],r=f-l,a=r*this.options.tension*c,m=d*this.options.friction,h=a-m,g=d+h*o,p=l+g*o;Math.abs(r)<this.options.threshold&&Math.abs(g)<this.options.threshold*10?this.currentValues[i]!==f&&(this.currentValues[i]=f,this.velocities[i]=0,n=!0):(s=!1,this.currentValues[i]=p,this.velocities[i]=g,n=!0)}return n&&this.options.onChange(this.currentValues),s&&this.options.onComplete(this.currentValues),s}setTarget(t){const n=performance.now(),s=n-this.targetUpdateTime;this.previousTargetValues=[...this.targetValues],this.targetValues=[...t],this.targetUpdateTime=n,this.updateCount=0;const o=this.previousTargetValues.every((c,i)=>c===this.currentValues[i]);if(s<8&&s>0&&this.previousTargetValues.length>0&&!o){const c=Math.min(s/8,1);for(let i=0;i<this.targetValues.length;i++){const l=this.previousTargetValues[i]||0,f=t[i]||0;Math.abs(f-l)>.1&&(this.targetValues[i]=l+(f-l)*c)}}for(;this.currentValues.length<t.length;)this.currentValues.push(t[this.currentValues.length]),this.velocities.push(0);this.currentValues.length>t.length&&(this.currentValues=this.currentValues.slice(0,t.length),this.velocities=this.velocities.slice(0,t.length))}getCurrentValues(){return[...this.currentValues]}getValue(t){return this.currentValues[t]??0}isInterpolating(){return this.animationId!==null}stop(){this.animationId!==null&&(cancelAnimationFrame(this.animationId),this.animationId=null)}setImmediate(t){this.stop(),this.currentValues=[...t],this.targetValues=[...t],this.previousTargetValues=[...t],this.velocities=new Array(t.length).fill(0),this.targetUpdateTime=performance.now(),this.updateCount=0,this.options.onChange(this.currentValues)}updateOptions(t){this.options={...this.options,...t}}startAutoInterpolation(){this.startInterpolation()}destroy(){this.stop()}startInterpolation(){this.animationId===null&&this.animate()}}function w(e=[],t={}){const n=u.useRef(null);return n.current||(n.current=new C(e,t)),u.useEffect(()=>{var s;(s=n.current)==null||s.updateOptions(t)},[t]),u.useEffect(()=>()=>{var s;(s=n.current)==null||s.destroy()},[]),[n.current]}function R(e,t){const[n]=u.useState(()=>V.observable({...e})),s=u.useRef(null),o=u.useRef(null),c=u.useRef(0);function i(){o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)}function l(){const r=s.current;if(!r)return;const a=performance.now(),m=(a-c.current)/1e3;c.current=a;const h=r.update(m);V.runInAction(()=>{n.joint_position=r.getCurrentValues()}),o.current=h?null:requestAnimationFrame(l)}function f(){o.current===null&&(c.current=performance.now(),o.current=requestAnimationFrame(l))}function d(r){var m;const a=r.joint_position.filter(h=>h!==void 0);(m=s.current)==null||m.setTarget(a),V.runInAction(()=>{const h=r,g=n;for(const p of Object.keys(h))p!=="joint_position"&&g[p]!==h[p]&&(g[p]=h[p])}),f()}return I(()=>{const r=e.joint_position.filter(a=>a!==void 0);return s.current=new C(r,t),()=>{var a;i(),(a=s.current)==null||a.destroy()}}),u.useEffect(()=>{var r;t&&((r=s.current)==null||r.updateOptions(t))},[t]),u.useEffect(()=>V.autorun(()=>d(e)),[e]),n}exports.ValueInterpolator=C;exports.cellIdOf=y;exports.createNovaClient=F;exports.useAnimationFrame=A;exports.useAutorun=T;exports.useInterpolation=w;exports.useSmoothedMotionState=R;
@@ -1,4 +1,4 @@
1
- import { type SxProps } from "@mui/material/styles";
1
+ import type { SxProps } from "@mui/material/styles";
2
2
  import { type ReactNode } from "react";
3
3
  export type AppItem = {
4
4
  /** Unique identifier for the app */
@@ -0,0 +1,48 @@
1
+ import type { SxProps, Theme } from "@mui/material/styles";
2
+ import type { JoggingDetailsState, TrajectoryDetailsState } from "@wandelbots/nova-js/v2";
3
+ import type { RobotControlPose, RobotControlSelect } from "../robotControl/RobotControlPanel";
4
+ import type { EulerConvention } from "./orientation";
5
+ export type { EulerConvention } from "./orientation";
6
+ /** How the bar shows the orientation of the pose */
7
+ export type OrientationFormat = {
8
+ type: "rotationVector" | "eulerAngles" | "quaternion";
9
+ /** The unit of a rotation vector and of Euler angles */
10
+ angleUnit: "rad" | "deg";
11
+ /** The convention of Euler angles; kept while another type is shown */
12
+ eulerConvention: EulerConvention;
13
+ };
14
+ /**
15
+ * What the robot's motion stream reports: NOVA's
16
+ * `execute.details.state.kind` of a jog or a trajectory
17
+ */
18
+ export type CurrentPoseBarState = JoggingDetailsState["kind"] | TrajectoryDetailsState["kind"];
19
+ /** What the app gives CurrentPoseBar: the pose, its TCP and frame, the state */
20
+ export type CurrentPoseBarProps = {
21
+ /**
22
+ * The TCP's pose relative to the frame, both chosen in the bar: position
23
+ * in mm, orientation as a rotation vector in rad. Read on every frame;
24
+ * null while unknown.
25
+ */
26
+ getCurrentPose: () => RobotControlPose | null;
27
+ /** The TCP whose pose the bar shows; the bar's own, not the panel's */
28
+ tcp?: RobotControlSelect;
29
+ /** The coordinate system the pose is relative to */
30
+ frame?: RobotControlSelect;
31
+ /** The state of the motion stream; none is "Ready" */
32
+ state?: CurrentPoseBarState | null;
33
+ /**
34
+ * An error that outlasts the motion that caused it, e.g. a jog stopped
35
+ * near a collision; shown instead of the state
36
+ */
37
+ error?: string | null;
38
+ /** The orientation format, if the app keeps it; else the bar keeps its own */
39
+ orientationFormat?: OrientationFormat;
40
+ onOrientationFormatChange?: (format: OrientationFormat) => void;
41
+ sx?: SxProps<Theme>;
42
+ };
43
+ /**
44
+ * The bar under the 3D view: the TCP's current pose in a TCP and frame of
45
+ * its own, a button to copy it, the orientation format, and the state of
46
+ * the robot's motion stream
47
+ */
48
+ export declare const CurrentPoseBar: ({ getCurrentPose, tcp, frame, state, error, orientationFormat: appFormat, onOrientationFormatChange, sx, }: CurrentPoseBarProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import type { OrientationFormat } from "./CurrentPoseBar";
2
+ type OrientationFormatPopoverProps = {
3
+ /** The bar: the popover opens above it, at its left */
4
+ anchor: HTMLElement | null;
5
+ open: boolean;
6
+ onClose: () => void;
7
+ format: OrientationFormat;
8
+ onChange: (format: OrientationFormat) => void;
9
+ };
10
+ /**
11
+ * Orientation format: how the bar shows the orientation. The angle unit is
12
+ * for a rotation vector and Euler angles; the convention for Euler angles.
13
+ * It renders again only when it opens, closes or shows another format: an
14
+ * open menu measures its place on every render, and the bar renders on every
15
+ * render of the app.
16
+ */
17
+ export declare const OrientationFormatPopover: import("react").MemoExoticComponent<typeof OrientationFormatPopoverContent>;
18
+ declare function OrientationFormatPopoverContent({ anchor, open, onClose, format, onChange, }: OrientationFormatPopoverProps): import("react/jsx-runtime").JSX.Element;
19
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { CurrentPoseBarState } from "./CurrentPoseBar";
2
+ /**
3
+ * The state of the robot's motion stream, as RobotPad's StreamStateSection:
4
+ * an error that outlasts its motion comes first, since the state is normal
5
+ * again as soon as the motion stops
6
+ */
7
+ export declare function StreamStatus({ state, error, }: {
8
+ state: CurrentPoseBarState | null | undefined;
9
+ error: string | null | undefined;
10
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,34 @@
1
+ import type { OrientationType } from "@wandelbots/nova-js/v2";
2
+ /** One of NOVA's Euler angle conventions, e.g. `EULER_ANGLES_EXTRINSIC_XYZ` */
3
+ export type EulerConvention = Extract<OrientationType, `EULER_ANGLES_${string}`>;
4
+ /** A quaternion as [x, y, z, w], NOVA's order */
5
+ export type QuaternionTuple = [number, number, number, number];
6
+ type Axis = "X" | "Y" | "Z";
7
+ /** All Euler conventions of NOVA: the intrinsic ones, then the extrinsic ones */
8
+ export declare const EULER_CONVENTIONS: readonly EulerConvention[];
9
+ /**
10
+ * Whether the convention turns about the moving axes (intrinsic) or the fixed
11
+ * ones (extrinsic), and its axes in the order of its angles
12
+ */
13
+ export declare function parseEulerConvention(convention: EulerConvention): {
14
+ intrinsic: boolean;
15
+ axes: [Axis, Axis, Axis];
16
+ };
17
+ /** The quaternion of a rotation vector: its direction is the axis, its length the angle in rad */
18
+ export declare function rotationVectorToQuaternion([x, y, z]: [
19
+ number,
20
+ number,
21
+ number
22
+ ]): QuaternionTuple;
23
+ /**
24
+ * The Euler angles of a rotation in rad, in the order of the convention's
25
+ * axes: intrinsic XYZ turns about X, then the turned Y, then the turned Z;
26
+ * extrinsic XYZ about the fixed X, Y and Z. Each angle is within [-π, π].
27
+ *
28
+ * The method of Bernardes and Viollet (2022), "Quaternion to Euler angles
29
+ * conversion: a direct, general and computationally efficient method", as
30
+ * SciPy uses it. In gimbal lock only the sum or the difference of the first
31
+ * and last angle is known; then the last extrinsic angle is 0.
32
+ */
33
+ export declare function quaternionToEuler(quaternion: QuaternionTuple, convention: EulerConvention): [number, number, number];
34
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { RobotControlPose } from "../robotControl/RobotControlPanel";
2
+ import type { OrientationFormat } from "./CurrentPoseBar";
3
+ /** Rotation vector in rad, Figma's default; Euler angles as Figma's, extrinsic XYZ */
4
+ export declare const DEFAULT_ORIENTATION_FORMAT: OrientationFormat;
5
+ /** One value of the bar, e.g. "X" and "-328.2" */
6
+ export type PoseValue = {
7
+ label: string;
8
+ value: string;
9
+ kind: "x" | "y" | "z" | "orientation";
10
+ };
11
+ /**
12
+ * The values the bar shows for a pose: the position to 0.1 mm, then the
13
+ * orientation in the format; a dash for each while the pose is unknown
14
+ */
15
+ export declare function poseValues(pose: RobotControlPose | null, format: OrientationFormat): PoseValue[];
@@ -0,0 +1,16 @@
1
+ import { type JogControlsProps } from "./useJogControls";
2
+ /**
3
+ * Props of {@link JoggingButtons}: the same as those of JoggingGizmo, less
4
+ * what only a 3D drawing needs
5
+ */
6
+ export type JoggingButtonsProps = JogControlsProps;
7
+ /**
8
+ * Jogging by buttons: a row per axis with a minus and a plus button, held to
9
+ * jog. `motion` picks whether they move the robot along the axes (X-, X+) or
10
+ * turn it about them (Rx-, Rx+).
11
+ *
12
+ * Unlike JoggingGizmo, the buttons do not turn with the 3D view: X+ is X+ of
13
+ * the jog frame, wherever the camera looks from. They take the same props as
14
+ * the gizmo, so an app wires both the same way.
15
+ */
16
+ export declare const JoggingButtons: (props: JoggingButtonsProps) => import("react/jsx-runtime").JSX.Element;