@wandelbots/wandelbots-js-react-components 6.3.0 → 6.4.0-pr.chore-public-names.673.cb7ee37

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 (196) hide show
  1. package/README.md +255 -122
  2. package/dist/3d.cjs +1 -1
  3. package/dist/3d.d.ts +7 -3
  4. package/dist/3d.js +20 -20
  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 +5 -0
  13. package/dist/JoggingGizmo/index.js +6 -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/SafetyBar/index.cjs +1 -1
  18. package/dist/SafetyBar/index.js +1 -1
  19. package/dist/chunks/ConnectedMotionGroup-D9JJSyXB.js +1822 -0
  20. package/dist/chunks/ConnectedMotionGroup-ir7Vf690.cjs +3 -0
  21. package/dist/chunks/CurrentPoseBar-Cbz4AO36.cjs +1 -0
  22. package/dist/chunks/CurrentPoseBar-CpwvWpEY.js +619 -0
  23. package/dist/chunks/JoggingButtons-i8FdMpCx.js +108 -0
  24. package/dist/chunks/JoggingButtons-paQCBXf4.cjs +1 -0
  25. package/dist/chunks/JoggingGizmoOrientation-CKZeLcMp.js +893 -0
  26. package/dist/chunks/JoggingGizmoOrientation-EPtBeAun.cjs +1 -0
  27. package/dist/chunks/JoggingJointSlider-DQhJOmcc.js +378 -0
  28. package/dist/chunks/JoggingJointSlider-YcEBMgF1.cjs +1 -0
  29. package/dist/chunks/Pose3-Ci1bxEvz.js +1373 -0
  30. package/dist/chunks/Pose3-DwMOSTKO.cjs +1 -0
  31. package/dist/chunks/SafetyBar-Be1c6Vz9.cjs +1 -0
  32. package/dist/chunks/{SafetyBar-Cy9DiXp9.js → SafetyBar-WXLP3Yi0.js} +34 -32
  33. package/dist/chunks/{externalizeComponent-EDymnaGR.js → externalizeComponent-7OVHUIUh.js} +84 -134
  34. package/dist/chunks/externalizeComponent-B0n_tR3v.cjs +2 -0
  35. package/dist/chunks/holdSafety-Cbej6-Kc.js +62 -0
  36. package/dist/chunks/holdSafety-TeMXlYQe.cjs +1 -0
  37. package/dist/chunks/joggingColors-BKRoSGQu.js +132 -0
  38. package/dist/chunks/joggingColors-BkPm75Hr.cjs +1 -0
  39. package/dist/chunks/json-3cqBD7UQ.js +18 -0
  40. package/dist/chunks/json-Bd6uGfgP.cjs +1 -0
  41. package/dist/chunks/loadRobotSession-Bt1-Brjp.js +3761 -0
  42. package/dist/chunks/loadRobotSession-DHVuK_pj.cjs +1 -0
  43. package/dist/chunks/novaConnection-BTSIgWd1.cjs +1 -0
  44. package/dist/chunks/novaConnection-J6_ohIQ0.js +14 -0
  45. package/dist/chunks/poseText-BXUaQWnK.cjs +1 -0
  46. package/dist/chunks/poseText-CtdXIeT_.js +41 -0
  47. package/dist/chunks/useSmoothedMotionState-C_Vo0py0.js +202 -0
  48. package/dist/chunks/useSmoothedMotionState-Ce9NjwBu.cjs +1 -0
  49. package/dist/components/AppHeader.d.ts +1 -1
  50. package/dist/components/VelocitySlider.d.ts +6 -1
  51. package/dist/components/currentPoseBar/CurrentPoseBar.d.ts +48 -0
  52. package/dist/components/currentPoseBar/OrientationFormatPopover.d.ts +19 -0
  53. package/dist/components/currentPoseBar/StreamStatus.d.ts +10 -0
  54. package/dist/components/currentPoseBar/orientation.d.ts +34 -0
  55. package/dist/components/currentPoseBar/poseValues.d.ts +15 -0
  56. package/dist/components/jogging/JoggingButtons.d.ts +18 -0
  57. package/dist/components/jogging/JoggingCartesianAxisControl.d.ts +8 -2
  58. package/dist/components/jogging/JoggingCartesianTab.d.ts +3 -0
  59. package/dist/components/jogging/JoggingJointTab.d.ts +4 -1
  60. package/dist/components/jogging/JoggingJointValueControl.d.ts +7 -1
  61. package/dist/components/jogging/JoggingPanel.d.ts +6 -3
  62. package/dist/components/jogging/JoggingRefusedError.d.ts +24 -0
  63. package/dist/components/jogging/JoggingStore.d.ts +382 -40
  64. package/dist/components/jogging/gizmo/JoggingGizmo.d.ts +53 -0
  65. package/dist/components/jogging/gizmo/JoggingGizmoOrientation.d.ts +26 -0
  66. package/dist/components/jogging/gizmo/RotationHandles.d.ts +7 -0
  67. package/dist/components/jogging/gizmo/RotationScene.d.ts +6 -0
  68. package/dist/components/jogging/gizmo/TranslationHandles.d.ts +6 -0
  69. package/dist/components/jogging/gizmo/TranslationScene.d.ts +6 -0
  70. package/dist/components/jogging/gizmo/arcGrabAreas.d.ts +58 -0
  71. package/dist/components/jogging/gizmo/arcs.d.ts +54 -0
  72. package/dist/components/jogging/gizmo/arrows.d.ts +63 -0
  73. package/dist/components/jogging/gizmo/gizmoShared.d.ts +135 -0
  74. package/dist/components/jogging/gizmo/gizmoView.d.ts +42 -0
  75. package/dist/components/jogging/gizmo/useGizmoTurn.d.ts +11 -0
  76. package/dist/components/jogging/holdSafety.d.ts +82 -0
  77. package/dist/components/jogging/jogError.d.ts +9 -0
  78. package/dist/components/jogging/jogHandle.d.ts +23 -0
  79. package/dist/components/jogging/joggingColors.d.ts +30 -0
  80. package/dist/components/jogging/joggingVelocity.d.ts +21 -0
  81. package/dist/components/jogging/joint/JoggingJointSlider.d.ts +56 -0
  82. package/dist/components/jogging/joint/JointSliderTrack.d.ts +27 -0
  83. package/dist/components/jogging/joint/jointJog.d.ts +55 -0
  84. package/dist/components/jogging/joint/useJointJogHold.d.ts +43 -0
  85. package/dist/components/jogging/useHold.d.ts +42 -0
  86. package/dist/components/jogging/useJogControls.d.ts +44 -0
  87. package/dist/components/robotControl/PanelSelect.d.ts +13 -0
  88. package/dist/components/robotControl/SmallSelect.d.ts +15 -0
  89. package/dist/components/robotControl/poseText.d.ts +43 -0
  90. package/dist/components/robotControl/robotControlTypes.d.ts +36 -0
  91. package/dist/components/robotControl/useCopyText.d.ts +12 -0
  92. package/dist/components/robotControl/useEveryFrame.d.ts +6 -0
  93. package/dist/components/robots/GenericRobot.d.ts +2 -1
  94. package/dist/components/robots/LinearAxis.d.ts +1 -1
  95. package/dist/components/robots/LinearAxisAnimator.d.ts +11 -2
  96. package/dist/components/robots/Robot.d.ts +1 -1
  97. package/dist/components/robots/robotModelLogic.d.ts +11 -9
  98. package/dist/components/utils/converters.d.ts +0 -2
  99. package/dist/components/utils/hooks.d.ts +1 -6
  100. package/dist/components/utils/json.d.ts +4 -0
  101. package/dist/components/utils/useSmoothedMotionState.d.ts +11 -2
  102. package/dist/components/utils/useWebGLRenderer.d.ts +32 -0
  103. package/dist/components/utils/webglSupport.d.ts +11 -0
  104. package/dist/core.cjs +1 -1
  105. package/dist/core.d.ts +28 -20
  106. package/dist/core.js +57 -54
  107. package/dist/index.cjs +1 -1
  108. package/dist/index.js +73 -70
  109. package/dist/lib/ConnectedMotionGroup.d.ts +9 -8
  110. package/dist/lib/ControllerStateStream.d.ts +125 -0
  111. package/dist/lib/JoggerConnection.d.ts +172 -27
  112. package/dist/lib/MotionStreamConnection.d.ts +16 -6
  113. package/dist/lib/Pose3.d.ts +22 -0
  114. package/dist/lib/PoseTransformer.d.ts +44 -0
  115. package/dist/lib/TrajectoryExecutionStore.d.ts +260 -0
  116. package/dist/lib/connectionLogger.d.ts +9 -0
  117. package/dist/lib/controllerStateSource.d.ts +38 -0
  118. package/dist/lib/incrementalCartesianMotion.d.ts +40 -0
  119. package/dist/lib/motionGroupModelResources.d.ts +1 -0
  120. package/dist/lib/motionStateUpdate.d.ts +44 -0
  121. package/dist/lib/nats/natsControllerStateSource.d.ts +27 -0
  122. package/dist/lib/novaConnection.d.ts +23 -0
  123. package/dist/lib/planErrorTranslation.d.ts +8 -0
  124. package/dist/lib/poseMath.d.ts +51 -0
  125. package/dist/lib/robotSession/RobotActivation.d.ts +90 -0
  126. package/dist/lib/robotSession/RobotDescription.d.ts +84 -0
  127. package/dist/lib/robotSession/RobotLiveState.d.ts +65 -0
  128. package/dist/lib/robotSession/RobotLoadProgress.d.ts +72 -0
  129. package/dist/lib/robotSession/RobotSafety.d.ts +59 -0
  130. package/dist/lib/robotSession/RobotSession.d.ts +117 -0
  131. package/dist/lib/robotSession/RobotTargetPose.d.ts +116 -0
  132. package/dist/lib/robotSession/loadRobotResources.d.ts +46 -0
  133. package/dist/lib/robotSession/loadRobotSession.d.ts +81 -0
  134. package/dist/lib/robotSession/robotPose.d.ts +27 -0
  135. package/dist/lib/rotation.d.ts +12 -0
  136. package/dist/nats.cjs +1 -0
  137. package/dist/nats.d.ts +4 -0
  138. package/dist/nats.js +131 -0
  139. package/dist/session.cjs +1 -0
  140. package/dist/session.d.ts +22 -0
  141. package/dist/session.js +33 -0
  142. package/package.json +68 -66
  143. package/dist/Setup.d.ts +0 -11
  144. package/dist/chunks/MotionGroupVisualizer-DshWR1wY.js +0 -1653
  145. package/dist/chunks/MotionGroupVisualizer-eD7yFEcF.cjs +0 -1
  146. package/dist/chunks/SafetyBar-DPrv_OQA.cjs +0 -1
  147. package/dist/chunks/externalizeComponent-OO4jcrz5.cjs +0 -2
  148. package/dist/chunks/theming-DfSy4-Ic.cjs +0 -4
  149. package/dist/chunks/theming-mF9Rt8SS.js +0 -5542
  150. package/dist/chunks/useSmoothedMotionState-DyDgSVYX.js +0 -478
  151. package/dist/chunks/useSmoothedMotionState-VYxEIyfr.cjs +0 -1
  152. package/dist/components/3d-viewport/CoordinateSystemTransform.d.ts +0 -11
  153. package/dist/components/AdornedTextField.d.ts +0 -7
  154. package/dist/components/CopyableText.d.ts +0 -6
  155. package/dist/components/CycleTimer/CycleTimer.d.ts +0 -3
  156. package/dist/components/CycleTimer/DefaultVariant.d.ts +0 -9
  157. package/dist/components/CycleTimer/SmallVariant.d.ts +0 -10
  158. package/dist/components/CycleTimer/index.d.ts +0 -27
  159. package/dist/components/CycleTimer/types.d.ts +0 -49
  160. package/dist/components/CycleTimer/useAnimations.d.ts +0 -14
  161. package/dist/components/CycleTimer/useTimerLogic.d.ts +0 -24
  162. package/dist/components/CycleTimer/utils.d.ts +0 -21
  163. package/dist/components/CycleTimer.d.ts +0 -3
  164. package/dist/components/DataGrid.d.ts +0 -66
  165. package/dist/components/LogPanel.d.ts +0 -38
  166. package/dist/components/LogStore.d.ts +0 -12
  167. package/dist/components/LogViewer.d.ts +0 -46
  168. package/dist/components/ProgramControl.d.ts +0 -55
  169. package/dist/components/ProgramStateIndicator.d.ts +0 -26
  170. package/dist/components/RobotCard.d.ts +0 -98
  171. package/dist/components/RobotListItem.d.ts +0 -34
  172. package/dist/components/RobotSetupReadinessIndicator.d.ts +0 -37
  173. package/dist/components/SelectableFab.d.ts +0 -7
  174. package/dist/components/TabBar.d.ts +0 -45
  175. package/dist/components/ThemeSelect.d.ts +0 -6
  176. package/dist/components/Timer/Timer.d.ts +0 -3
  177. package/dist/components/Timer/TimerDefaultVariant.d.ts +0 -9
  178. package/dist/components/Timer/TimerSmallVariant.d.ts +0 -10
  179. package/dist/components/Timer/index.d.ts +0 -19
  180. package/dist/components/Timer/types.d.ts +0 -35
  181. package/dist/components/Timer/useTimerAnimations.d.ts +0 -10
  182. package/dist/components/Timer/useTimerLogic.d.ts +0 -19
  183. package/dist/components/Timer/utils.d.ts +0 -17
  184. package/dist/components/Timer.d.ts +0 -3
  185. package/dist/components/TransparentOverlay.d.ts +0 -4
  186. package/dist/components/jogging/JoggingFreedriveTab.d.ts +0 -1
  187. package/dist/components/jogging/PoseCartesianValues.d.ts +0 -9
  188. package/dist/components/jogging/PoseJointValues.d.ts +0 -8
  189. package/dist/components/robots/AxisConfig.d.ts +0 -2
  190. package/dist/components/robots/manufacturerHomePositions.d.ts +0 -20
  191. package/dist/icons/DropdownArrowIcon.d.ts +0 -2
  192. package/dist/icons/index.d.ts +0 -12
  193. package/dist/lib/novaCompat.d.ts +0 -16
  194. package/dist/themes/createDarkTheme.d.ts +0 -7
  195. package/dist/themes/themeTypes.d.ts +0 -40
  196. package/dist/themes/theming.d.ts +0 -24
@@ -1,6 +1,6 @@
1
1
  import Stack from "@mui/material/Stack";
2
2
  import React, { type ReactNode } from "react";
3
- import type { AxisControlComponentColors } from "../../themes/themeTypes";
3
+ import type { AxisControlComponentColors } from "./joggingColors";
4
4
  import type { JoggingDirection } from "./JoggingStore";
5
5
  type JoggingCartesianAxisControlProps = {
6
6
  colors?: AxisControlComponentColors;
@@ -12,7 +12,13 @@ type JoggingCartesianAxisControlProps = {
12
12
  /** If set, the corresponding button will be rendered in the pressed state */
13
13
  activeJoggingDirection?: JoggingDirection;
14
14
  } & React.ComponentProps<typeof Stack>;
15
- /** A input widget to control an individual cartesian axis */
15
+ /**
16
+ * A input widget to control an individual cartesian axis
17
+ *
18
+ * @deprecated Use `JoggingButtons`: a minus and a plus button per axis, held
19
+ * to jog, taking props only (`motion`, `onJogStart`, `onJogStop`), with the
20
+ * colors of the design system. `JoggingGizmo` jogs by the same props.
21
+ */
16
22
  export declare const JoggingCartesianAxisControl: (({ colors, label, getDisplayedValue, startJogging, stopJogging, disabled, activeJoggingDirection, ...rest }: JoggingCartesianAxisControlProps) => import("react/jsx-runtime").JSX.Element) & {
17
23
  displayName: string;
18
24
  };
@@ -1,4 +1,7 @@
1
1
  import type { JoggingStore } from "./JoggingStore";
2
+ /**
3
+ * The cartesian tab of `JoggingPanel`
4
+ */
2
5
  export declare const JoggingCartesianTab: (({ store, children, }: {
3
6
  store: JoggingStore;
4
7
  children?: React.ReactNode;
@@ -1,5 +1,8 @@
1
- import type { ReactNode } from "react";
1
+ import { type ReactNode } from "react";
2
2
  import type { JoggingStore } from "./JoggingStore";
3
+ /**
4
+ * The joint tab of `JoggingPanel`
5
+ */
3
6
  export declare const JoggingJointTab: (({ store, children }: {
4
7
  store: JoggingStore;
5
8
  children?: ReactNode;
@@ -8,7 +8,13 @@ type JoggingJointValueControlProps = {
8
8
  getValue: () => number | undefined;
9
9
  disabled?: boolean;
10
10
  } & React.ComponentProps<typeof Stack>;
11
- /** A input widget to control an individual joint */
11
+ /**
12
+ * A input widget to control an individual joint
13
+ *
14
+ * @deprecated Use `JoggingJointSlider`: one joint as a slider across its
15
+ * limits, pressed where the joint is to go (`value`, `min`, `max`,
16
+ * `onJogStart`, `onJogStop`).
17
+ */
12
18
  export declare const JoggingJointValueControl: (({ startJogging, stopJogging, lowerLimit, upperLimit, useDegree, getValue, disabled, ...rest }: JoggingJointValueControlProps) => import("react/jsx-runtime").JSX.Element) & {
13
19
  displayName: string;
14
20
  };
@@ -1,10 +1,13 @@
1
1
  import type { SxProps } from "@mui/material/styles";
2
- import type { AnyNovaClient } from "../../lib/novaCompat";
2
+ import type { NovaConnection } from "../../lib/novaConnection";
3
3
  import { JoggingStore } from "./JoggingStore";
4
4
  export type JoggingPanelTabId = "cartesian" | "joint";
5
5
  export type JoggingPanelProps = {
6
- /** Either an existing Nova client or the base url of a deployed Nova instance */
7
- nova: AnyNovaClient | string;
6
+ /**
7
+ * The base url of a deployed Nova instance, or a Nova client of the app.
8
+ * The panel reads only the url and the access token of the client.
9
+ */
10
+ nova: NovaConnection;
8
11
  /** Id of the motion group to move e.g. 0@ur5e */
9
12
  motionGroupId: string;
10
13
  /** Cell id on the Nova instance. Defaults to "cell". */
@@ -0,0 +1,24 @@
1
+ import type { RobotNotMoveableReason } from "../../lib/robotSession/RobotSafety";
2
+ /**
3
+ * Why a jogging store starts no jog now, as a code an app can translate: the
4
+ * reason of the store's owner that the robot may not move (see
5
+ * `JoggingStoreOptions.notMoveableReason`), "blocked" after NOVA refused the
6
+ * jogging connection because another client jogs (see
7
+ * `JoggingStore.blocked`, until `JoggingStore.unblock`), or "locked" while
8
+ * the store is locked (see `JoggingStore.isLocked`)
9
+ */
10
+ export type JoggingRefusedReason = RobotNotMoveableReason | {
11
+ code: "blocked";
12
+ } | {
13
+ code: "locked";
14
+ };
15
+ /**
16
+ * A jog that a jogging store did not start, because the robot may not move
17
+ * now or the store is locked: nothing was sent to the robot. `reason` says
18
+ * why. Also what else needs the jogging connection and did not get it: a
19
+ * TCP change, or handing the robot to jogging.
20
+ */
21
+ export declare class JoggingRefusedError extends Error {
22
+ /** Why the jog did not start: `reason.code` is for the app to translate */
23
+ readonly reason: JoggingRefusedReason;
24
+ }
@@ -1,6 +1,7 @@
1
- import { JointTypeEnum, type CoordinateSystem, type MotionGroupDescription, type RobotTcp } from "@wandelbots/nova-js/v2";
1
+ import { JointTypeEnum, type CoordinateSystem, type KinematicModel, type MotionGroupDescription, type Pose, type RobotTcp } from "@wandelbots/nova-js/v2";
2
2
  import { type IReactionDisposer } from "mobx";
3
3
  import type { JoggerConnection } from "../../lib/JoggerConnection";
4
+ import type { RobotNotMoveableReason } from "../../lib/robotSession/RobotSafety";
4
5
  declare const discreteIncrementOptions: {
5
6
  id: string;
6
7
  mm: number;
@@ -25,7 +26,37 @@ export type IncrementJogInProgress = {
25
26
  axis: JoggingAxis;
26
27
  };
27
28
  type TabType = "cartesian" | "joint" | "debug";
29
+ type JoggingTab = {
30
+ id: TabType;
31
+ label: string;
32
+ };
28
33
  export type CartesianMotionType = "translate" | "rotate";
34
+ /**
35
+ * Where a jogging store keeps the user's jogging settings between visits: the
36
+ * part of the Web Storage API that it uses, so `localStorage` itself fits, as
37
+ * does a storage of the app's own
38
+ */
39
+ export type JoggingStoreStorage = Pick<Storage, "getItem" | "setItem">;
40
+ /** What an app can give a jogging store besides its robot's data */
41
+ export type JoggingStoreOptions = {
42
+ /**
43
+ * Where to keep the jogging settings: the tab, the coordinate systems, the
44
+ * increment, the motion type and the orientation. Without it the store
45
+ * keeps them in `localStorage`, where the browser has one; the app decides
46
+ * where they belong, so pass it.
47
+ */
48
+ storage?: JoggingStoreStorage;
49
+ /**
50
+ * Why the robot may not move right now, or null when it may. The store asks
51
+ * before it starts a jog, and starts none while there is a reason: the
52
+ * start rejects with a {@link JoggingRefusedError}. NOVA switches a
53
+ * controller to control mode by itself for a movement request, so without
54
+ * this a robot that is not activated jogs. A robot session gives its
55
+ * safety's reason; a store without it refuses only while it is locked or
56
+ * blocked by another client's jogging.
57
+ */
58
+ notMoveableReason?: () => RobotNotMoveableReason | null;
59
+ };
29
60
  export declare class JoggingStore {
30
61
  readonly jogger: JoggerConnection;
31
62
  readonly coordSystems: CoordinateSystem[];
@@ -35,12 +66,25 @@ export declare class JoggingStore {
35
66
  selectedTabId: TabType;
36
67
  /** Locks to prevent UI interactions during certain operations */
37
68
  locks: Set<string>;
38
- /** Block jogging UI interactions when connection is taken by another jogger */
69
+ /**
70
+ * NOVA refused the jogging connection because another client jogs the
71
+ * robot. The store then starts no jog (see {@link JoggingRefusedError},
72
+ * "blocked") until {@link JoggingStore.unblock}: it does not ask NOVA
73
+ * again by itself, so a UI has to say it and offer to try again.
74
+ */
39
75
  blocked: boolean;
40
76
  /**
41
- * Id of selected coordinate system from among those defined on the API side
77
+ * Id of selected coordinate system from among those defined on the API side.
78
+ * The cartesian values are shown in it ("Values relative to"), see
79
+ * {@link JoggingStore.tcpPoseInSelectedCoordSystem}.
42
80
  */
43
81
  selectedCoordSystemId: string;
82
+ /**
83
+ * Id of the coordinate system whose axes the jog buttons move along unless
84
+ * in tool orientation ("Move relative to"). Starts at the first coordinate
85
+ * system, like {@link JoggingStore.selectedCoordSystemId}.
86
+ */
87
+ jogCoordSystemId: string;
44
88
  /** Id of selected tool center point from among the options available on the robot */
45
89
  selectedTcpId: string;
46
90
  /** Whether a TCP change request is currently in flight */
@@ -67,33 +111,68 @@ export declare class JoggingStore {
67
111
  * with the information about the motion
68
112
  */
69
113
  incrementJogInProgress: IncrementJogInProgress | null;
70
- /** How fast the robot goes when doing cartesian translate jogging in mm/s */
114
+ /**
115
+ * Human-readable message from the most recent jogging/trajectory error
116
+ * (e.g. a collision that stopped an incremental jog). The state stream
117
+ * itself resets to a normal state (e.g. "Ready") as soon as the motion
118
+ * stops, so this is latched here to stay visible until the next jog
119
+ * attempt is made.
120
+ */
121
+ lastJogError: string | null;
122
+ /**
123
+ * Awaited by {@link JoggingStore.activate} before the jogger claims the
124
+ * robot for a jog, e.g. to end another motion that holds the controller's
125
+ * execution session. When it rejects, the jog does not start.
126
+ */
127
+ onBeforeActivate: (() => void | Promise<void>) | null;
128
+ /**
129
+ * How fast the robot goes when doing cartesian translate and prismatic joint
130
+ * jogging in mm/s. Starts at 10 % of the motion group's T1 max (the lowest
131
+ * manual TCP velocity limit it reports, at most 250 mm/s), so 25 mm/s for
132
+ * most robots, and is overwritten by the slider.
133
+ */
71
134
  translationVelocityMmPerSec: number;
72
- /** How fast the robot goes when doing cartesian or joint rotation jogging in °/s */
135
+ /** How fast the robot goes when doing cartesian or joint rotation jogging in °/s. Starts at 5 °/s. */
73
136
  rotationVelocityDegPerSec: number;
74
- /** Minimum translation velocity user can choose on the velocity slider in °/s */
137
+ /** Minimum translation velocity user can choose on the velocity slider in mm/s */
75
138
  minTranslationVelocityMmPerSec: number;
76
- /** Maximum translation velocity user can choose on the velocity slider in °/s */
139
+ /** Maximum translation velocity user can choose on the velocity slider in mm/s */
77
140
  maxTranslationVelocityMmPerSec: number;
78
141
  /** Minimum rotation velocity user can choose on the velocity slider in °/s */
79
142
  minRotationVelocityDegPerSec: number;
80
143
  /** Maximum rotation velocity user can choose on the velocity slider in °/s */
81
144
  maxRotationVelocityDegPerSec: number;
82
- /** Whether to show the coordinate system select dropdown in the UI */
145
+ /**
146
+ * Whether to show the coordinate system select dropdown in the UI
147
+ */
83
148
  showCoordSystemSelect: boolean;
84
- /** Whether to show the TCP select dropdown in the UI */
149
+ /**
150
+ * Whether to show the TCP select dropdown in the UI
151
+ */
85
152
  showTcpSelect: boolean;
86
- /** Whether to show the orientation select dropdown in the UI */
153
+ /**
154
+ * Whether to show the orientation select dropdown in the UI
155
+ */
87
156
  showOrientationSelect: boolean;
88
- /** Whether to show the increment select dropdown in the UI */
157
+ /**
158
+ * Whether to show the increment select dropdown in the UI
159
+ */
89
160
  showIncrementSelect: boolean;
90
- /** Whether to show icons in the jogging tabs */
161
+ /**
162
+ * Whether to show icons in the jogging tabs
163
+ */
91
164
  showTabIcons: boolean;
92
- /** Whether to show the label to the right of the velocity slider */
165
+ /**
166
+ * Whether to show the label to the right of the velocity slider
167
+ */
93
168
  showVelocitySliderLabel: boolean;
94
- /** Whether to show the legend before the slider */
169
+ /**
170
+ * Whether to show the legend before the slider
171
+ */
95
172
  showVelocityLegend: boolean;
96
- /** Whether to show the legend before the joints */
173
+ /**
174
+ * Whether to show the legend before the joints
175
+ */
97
176
  showJointsLegend: boolean;
98
177
  disposers: IReactionDisposer[];
99
178
  /**
@@ -109,27 +188,240 @@ export declare class JoggingStore {
109
188
  * Load a jogging store with the relevant data it needs
110
189
  * from the backend
111
190
  */
112
- static loadFor(jogger: JoggerConnection): Promise<JoggingStore>;
113
- constructor(jogger: JoggerConnection, coordSystems: CoordinateSystem[], motionGroupDescription: MotionGroupDescription, tcps: RobotTcp[], inverseSolverValue: string | null | undefined);
191
+ static loadFor(jogger: JoggerConnection, options?: JoggingStoreOptions): Promise<JoggingStore>;
192
+ /**
193
+ * Make a jogging store from data that was loaded before: the coordinate
194
+ * systems of the controller, the description and the kinematic model of the
195
+ * motion group. An app that loads them once for several stores uses this
196
+ * instead of {@link JoggingStore.loadFor}.
197
+ */
198
+ static create(jogger: JoggerConnection, data: {
199
+ coordinateSystems: CoordinateSystem[];
200
+ description: MotionGroupDescription;
201
+ kinematicModel: KinematicModel;
202
+ }, options?: JoggingStoreOptions): JoggingStore;
203
+ /** Where the jogging settings are kept, see {@link JoggingStoreOptions} */
204
+ private readonly storage;
205
+ /** Why the robot may not move now, see {@link JoggingStoreOptions} */
206
+ private readonly notMoveableReason;
207
+ /**
208
+ * Counts the starts and stops of held jogs, so that each one knows whether
209
+ * it is still the latest when its wait is over: a stop while the jogging
210
+ * websocket opens makes that press move nothing, and a stop keeps the
211
+ * websocket for a start that came in the same event (a joint slider that
212
+ * turns around)
213
+ */
214
+ private jogPress;
215
+ /**
216
+ * Whether the latest of {@link JoggingStore.jogPress} is a stop: a start
217
+ * that it overtook closes the websocket that it opened then
218
+ */
219
+ private stoppedLast;
220
+ /**
221
+ * The step that runs now: stops it, see
222
+ * `stopIncrementalJog`, and resolves once it is over
223
+ */
224
+ private runningStep;
225
+ /**
226
+ * Set by {@link JoggingStore.dispose}: a panel may still show the store,
227
+ * and it starts no jog any more
228
+ */
229
+ private disposed;
230
+ /** Ends the watch of the held jog that moves now, see `watchHeldJog` */
231
+ private endHeldJogWatch;
232
+ constructor(jogger: JoggerConnection, coordSystems: CoordinateSystem[], motionGroupDescription: MotionGroupDescription, tcps: RobotTcp[], inverseSolverValue: string | null | undefined, options?: JoggingStoreOptions);
233
+ /**
234
+ * Closes the jogger's websockets. The store starts no jog afterwards: a
235
+ * start rejects with a {@link JoggingRefusedError} ("disconnected"), and
236
+ * opens nothing.
237
+ */
114
238
  dispose(): void;
115
- get coordSystemCountByName(): import("lodash").Dictionary<number>;
239
+ get coordSystemCountByName(): Record<string, number>;
116
240
  deactivate(): Promise<void>;
117
- /** Activate the jogger with current settings */
241
+ /**
242
+ * Activate the jogger with current settings: for the tab that is selected
243
+ * and, on the Cartesian tab, for a step while an increment is selected.
244
+ * Resolves when the jogging websocket is initialized, or when the jogging
245
+ * was stopped before that (`deactivate`).
246
+ *
247
+ * Rejects with a {@link JoggingRefusedError} while the store is locked or
248
+ * its owner says that the robot may not move (see
249
+ * {@link JoggingStoreOptions}): nothing is sent to the robot then, and no
250
+ * jogging websocket opens. Also when that came to be while the jogging
251
+ * websocket opened: the store closes it again.
252
+ *
253
+ * {@link JoggingStore.startCartesianJogging},
254
+ * {@link JoggingStore.startJointJogging} and
255
+ * {@link JoggingStore.runIncrementalCartesianJog} activate what they need
256
+ * themselves.
257
+ */
118
258
  activate(): Promise<JoggerConnection>;
259
+ /**
260
+ * Activates the jogger for a jog of the given kind, unless it is refused
261
+ * (see {@link JoggingStore.refuseUnlessJoggable}, also for `ownLock`)
262
+ */
263
+ private activateFor;
264
+ /**
265
+ * Opens the jogging websocket of the jogger, unless a jog may not start
266
+ * (see {@link JoggingStore.refuseUnlessJoggable}). It is a movement
267
+ * connection, for which NOVA switches a controller to control mode by
268
+ * itself and holds it there: the store opens it only here, for a jog, a
269
+ * TCP change or its robot session.
270
+ *
271
+ * It asks before it opens the websocket, and again once it is open: that
272
+ * takes 0.1 to 0.5 s, in which the robot may have been deactivated or
273
+ * stopped. Refused then, the websocket closes again before anything moves.
274
+ *
275
+ * `reinitialize` opens it anew when it is open already, for another TCP.
276
+ */
277
+ private openJoggingWebsocket;
278
+ /**
279
+ * Throws a {@link JoggingRefusedError} while a jog may not start: once
280
+ * the store is disposed ("disconnected"), with the
281
+ * owner's reason that the robot may not move, else while another client
282
+ * holds the jogging connection ({@link JoggingStore.blocked}), else while
283
+ * the store is locked. `ownLock` is the lock of the step that asks: it
284
+ * locks the store against other jogs, not against itself.
285
+ */
286
+ private refuseUnlessJoggable;
287
+ /**
288
+ * Why a jog may not start now, or null: see
289
+ * {@link JoggingStore.refuseUnlessJoggable}. Observed while a step runs,
290
+ * which it stops.
291
+ */
292
+ private refusedReason;
293
+ /**
294
+ * Starts jogging the TCP along an axis (`translate`) or about it
295
+ * (`rotate`) until {@link JoggingStore.stopJogging}, with the store's
296
+ * velocity, TCP and "Move relative to". For a jog control that is held:
297
+ * call this on the press and `stopJogging` on the release.
298
+ *
299
+ * The robot moves once the jogging websocket is ready, about 0.1 to 0.5 s
300
+ * later. A press that was stopped by then, or that another press followed,
301
+ * moves nothing. Rejects with a {@link JoggingRefusedError} as
302
+ * {@link JoggingStore.activate} does: while the store is locked or the
303
+ * robot may not move, also when that came to be while the websocket
304
+ * opened.
305
+ *
306
+ * A jog that moves is stopped as by its release (see
307
+ * {@link JoggingStore.stopJogging}) once a jog would be refused: when the
308
+ * robot may no longer move, another client takes the jogging connection or
309
+ * the store gets locked. It stays stopped until the next press, also when
310
+ * the reason goes away; the release still comes and changes nothing.
311
+ */
312
+ startCartesianJogging(motion: CartesianMotionType, axis: JoggingAxis, direction: JoggingDirection): Promise<void>;
313
+ /**
314
+ * Starts jogging one joint (by its index) until
315
+ * {@link JoggingStore.stopJogging}, with the store's rotation velocity, or
316
+ * its translation velocity for a linear axis. As
317
+ * {@link JoggingStore.startCartesianJogging}, for a control that is held,
318
+ * and refused and stopped as it.
319
+ */
320
+ startJointJogging(joint: number, direction: JoggingDirection): Promise<void>;
321
+ /**
322
+ * Follows the held jog that moves now, until its release or the press
323
+ * that follows it: stops it as its release does once a jog would be
324
+ * refused, see {@link JoggingStore.startCartesianJogging}. NOVA jogs on
325
+ * at the last velocity for as long as the jogging websocket is open.
326
+ */
327
+ private watchHeldJog;
328
+ /**
329
+ * Opens the jogging websocket for a held jog. Resolves to whether this
330
+ * press is still the latest once it is open: a press that was stopped by
331
+ * then, or that another press followed, moves nothing.
332
+ *
333
+ * A start that fails or is refused leaves no jogging websocket open. A stop
334
+ * that came in the same event kept it for this start (see
335
+ * {@link JoggingStore.stopJogging}), and no other stop may follow. A stop
336
+ * that came while the start waited, before the websocket opened (for
337
+ * `onBeforeActivate`, or for the TCP and orientation), found nothing to
338
+ * close: the start closes it then, unless another press followed the
339
+ * stop, which owns it.
340
+ */
341
+ private openForHeldJog;
342
+ /**
343
+ * Stops the jog of {@link JoggingStore.startCartesianJogging} or
344
+ * {@link JoggingStore.startJointJogging} and closes the jogging websocket.
345
+ * Never refused, also while the store is locked or the robot may not move:
346
+ * a jog always gets its stop.
347
+ *
348
+ * A start that comes while the robot is told to stop keeps the websocket,
349
+ * e.g. a joint slider that turns around stops and starts in one event.
350
+ *
351
+ * A step that runs is no held jog, and is left alone: a held jog is
352
+ * refused meanwhile, so the stop of its control belongs to none.
353
+ */
354
+ stopJogging(): Promise<void>;
355
+ /**
356
+ * Moves the TCP one step along an axis (`translate`, by the increment's
357
+ * mm) or about it (`rotate`, by its degrees), with the store's velocity,
358
+ * TCP and "Move relative to". `increment` is one of
359
+ * {@link JoggingStore.discreteIncrementOptions}. Resolves once the robot
360
+ * has made the step.
361
+ *
362
+ * One step runs at a time: the store is locked while it runs (as by
363
+ * {@link JoggingStore.withMotionLock}) and shows it as
364
+ * {@link JoggingStore.incrementJogInProgress}. Rejects with a
365
+ * {@link JoggingRefusedError} as {@link JoggingStore.activate} does: while
366
+ * the store is locked, so also while another step runs, or the robot may
367
+ * not move.
368
+ *
369
+ * A step that the robot may no longer make is stopped: when the robot may
370
+ * no longer move, another client takes the jogging connection or
371
+ * something else locks the store. Before its trajectory went to NOVA
372
+ * (planning it takes a round trip) or was started, it rejects with a
373
+ * {@link JoggingRefusedError} then; once it runs, it is paused and
374
+ * resolves when the robot stands still. A stopped step stays stopped,
375
+ * also when the reason goes away.
376
+ */
377
+ runIncrementalCartesianJog(motion: CartesianMotionType, axis: JoggingAxis, direction: JoggingDirection, increment: DiscreteIncrementOption): Promise<void>;
378
+ /**
379
+ * Follows the step of the lock `lock` until `end`: stops it once a jog
380
+ * would be refused for another reason than its own lock, see
381
+ * {@link JoggingStore.runIncrementalCartesianJog}. `refusedReason` is what
382
+ * the jogger asks: the reason that stopped the step, else why a jog would
383
+ * be refused now.
384
+ */
385
+ private watchStep;
386
+ /**
387
+ * Takes the user's settings from the storage (see
388
+ * {@link JoggingStoreOptions}), which is `localStorage` only by default
389
+ */
119
390
  loadFromLocalStorage(): void;
391
+ /**
392
+ * Keeps the user's settings in the storage (see
393
+ * {@link JoggingStoreOptions}), which is `localStorage` only by default
394
+ */
120
395
  saveToLocalStorage(): void;
121
396
  get isLocked(): boolean;
397
+ /**
398
+ * Translation key for a friendlier version of
399
+ * {@link JoggingStore.lastJogError}, if the raw backend message is
400
+ * recognized. `null` when there's no latched error or the message isn't one
401
+ * we have a friendlier version for (in which case the raw message should be
402
+ * shown as-is).
403
+ */
404
+ get lastJogErrorTranslationKey(): string | null;
122
405
  get localStorageSave(): {
123
406
  selectedTabId: TabType;
124
407
  selectedCoordSystemId: string;
408
+ jogCoordSystemId: string;
125
409
  selectedOrientation: string;
126
410
  selectedIncrementId: string;
127
411
  selectedCartesianMotionType: CartesianMotionType;
128
412
  };
129
- get tabs(): {
130
- id: TabType;
131
- label: string;
132
- }[];
413
+ /**
414
+ * Whether the robot can jog its TCP along axes (translate, rotate): with an
415
+ * inverse solver, or when none could be loaded (as a default). A kinematic
416
+ * model without a solver (null), e.g. a linear axis or a turntable, jogs
417
+ * its joints only.
418
+ */
419
+ get canJogCartesian(): boolean;
420
+ /**
421
+ * The tabs of `JoggingPanel`: Cartesian (where the robot can jog its TCP)
422
+ * and Joints
423
+ */
424
+ get tabs(): [JoggingTab, ...JoggingTab[]];
133
425
  get incrementOptions(): readonly [{
134
426
  readonly id: "continuous";
135
427
  }, ...{
@@ -142,30 +434,46 @@ export declare class JoggingStore {
142
434
  mm: number;
143
435
  degrees: number;
144
436
  }[];
145
- get incrementOptionsById(): import("lodash").Dictionary<{
146
- id: string;
147
- mm: number;
148
- degrees: number;
149
- } | {
150
- readonly id: "continuous";
151
- }>;
152
- get tabsById(): import("lodash").Dictionary<{
153
- id: TabType;
154
- label: string;
155
- }>;
156
- get currentTab(): {
157
- id: TabType;
158
- label: string;
159
- };
437
+ get incrementOptionsById(): Record<string, (typeof incrementOptions)[number]>;
438
+ get tabsById(): Record<string, JoggingTab>;
439
+ /**
440
+ * The selected tab, or the first where the robot has not the selected one
441
+ * (no Cartesian tab without an inverse solver)
442
+ */
443
+ get currentTab(): JoggingTab;
444
+ /**
445
+ * The index of the selected tab in {@link JoggingStore.tabs}, for the MUI
446
+ * `Tabs` of `JoggingPanel`
447
+ */
160
448
  get tabIndex(): number;
161
- get coordSystemsById(): import("lodash").Dictionary<CoordinateSystem>;
449
+ get coordSystemsById(): Record<string, CoordinateSystem>;
162
450
  /**
163
451
  * The id of the coordinate system to use for jogging.
164
452
  * If in tool orientation, this is set to "tool", not the
165
453
  * selected coordinate system.
166
454
  */
167
455
  get activeCoordSystemId(): string;
168
- get tcpsById(): import("lodash").Dictionary<RobotTcp>;
456
+ /** The coordinate system to jog along, resolved relative to world */
457
+ get jogCoordSystem(): CoordinateSystem;
458
+ /**
459
+ * The streamed TCP pose (its readout, see
460
+ * {@link MotionStreamConnection.readoutState}) expressed in the selected
461
+ * coordinate system, for values that show what a pose field in that
462
+ * coordinate system shows.
463
+ */
464
+ get tcpPoseInSelectedCoordSystem(): Pose | undefined;
465
+ get tcpsById(): Record<string, RobotTcp>;
466
+ /**
467
+ * The streamed TCP pose (its readout) as the pose of a TCP, relative to a
468
+ * coordinate system: for a pose display with a TCP and frame of its own,
469
+ * like CurrentPoseBar. Undefined without a pose, or for an unknown TCP or
470
+ * coordinate system.
471
+ */
472
+ tcpPoseIn(tcpId: string, coordinateSystemId: string): Pose | undefined;
473
+ /**
474
+ * The step of the selected increment, or undefined for continuous jogging.
475
+ * In tool orientation, a step moves along the tool's axes.
476
+ */
169
477
  get activeDiscreteIncrement(): {
170
478
  id: string;
171
479
  mm: number;
@@ -179,6 +487,9 @@ export declare class JoggingStore {
179
487
  minVelocityInDisplayUnits(useDegree: boolean): number;
180
488
  /** Maximum selectable velocity in mm/sec or deg/sec */
181
489
  maxVelocityInDisplayUnits(useDegree: boolean): number;
490
+ /**
491
+ * The `onChange` of the MUI `Tabs` of `JoggingPanel`
492
+ */
182
493
  onTabChange(_event: React.SyntheticEvent, newValue: number): void;
183
494
  setSelectedCoordSystemId(id: string): void;
184
495
  /**
@@ -194,19 +505,50 @@ export declare class JoggingStore {
194
505
  * If the jogger is idle, a jogging websocket is briefly opened to communicate the
195
506
  * TCP change. The websocket is kept open until the state-stream confirms the
196
507
  * change (or a 1s timeout), to ensure the backend has time to process it.
508
+ *
509
+ * The jogging websocket is a movement connection, for which NOVA switches a
510
+ * controller to control mode by itself. So the change rejects with a
511
+ * {@link JoggingRefusedError} as a jog does, while the store is locked or
512
+ * its owner says that the robot may not move: the TCP stays, and no
513
+ * websocket opens (or it closes again, see {@link JoggingStore.activate}).
514
+ * As for a jog, {@link JoggingStore.onBeforeActivate} ends another motion
515
+ * first; when it rejects, the TCP stays.
197
516
  */
198
517
  requestTcpChange(tcpId: string): Promise<void>;
199
518
  private waitForTcpConfirmation;
200
519
  setSelectedOrientation(orientation: OrientationId): void;
520
+ /** "Move relative to" the selected TCP: jog along its own axes */
521
+ setMoveRelativeToSelectedTcp(): void;
522
+ /** "Move relative to" a coordinate system: jog along its axes */
523
+ setMoveRelativeToCoordSystem(coordSystemId: string): void;
201
524
  setSelectedIncrementId(id: IncrementOptionId): void;
202
525
  setCurrentIncrementJog(incrementJog: IncrementJogInProgress | null): void;
526
+ setLastJogError(message: string | null): void;
527
+ /**
528
+ * Set the selected velocity in mm/s or °/s, from the slider or a velocity
529
+ * text field. Values outside the slider range (and values that are not a
530
+ * finite number) are ignored; a text field reports them to the user
531
+ * instead of applying them.
532
+ */
203
533
  setVelocityFromSlider(velocity: number, useDegree: boolean): void;
204
534
  setSelectedCartesianMotionType(type: CartesianMotionType): void;
205
535
  lock(id: string): void;
206
536
  unlock(id: string): void;
207
537
  block(): void;
538
+ /**
539
+ * Ends {@link JoggingStore.blocked}, so that jogging can be tried again.
540
+ * For a jogger that is still in jogging mode (one that an app keeps there),
541
+ * it opens the jogging websocket again, unless a jog may not start: then
542
+ * the jogger is switched off instead.
543
+ */
208
544
  unblock(): void;
209
545
  /** Lock the UI until the given async callback resolves */
210
546
  withMotionLock(fn: () => Promise<void>): Promise<void>;
547
+ /**
548
+ * Locks the store until the callback resolves, and gives the callback the
549
+ * id of its lock: for a jog that starts under it (see
550
+ * {@link JoggingStore.refuseUnlessJoggable})
551
+ */
552
+ private withOwnLock;
211
553
  }
212
554
  export default JoggingStore;