@wandelbots/wandelbots-js-react-components 6.4.0-pr.revamp.667.9fadf2c → 6.4.0-pr.revamp.667.fa67ce5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/3d.cjs +1 -1
- package/dist/3d.js +1 -1
- package/dist/RobotHeader/index.cjs +1 -1
- package/dist/RobotHeader/index.js +1 -1
- package/dist/SafetyBar/index.cjs +1 -1
- package/dist/SafetyBar/index.js +1 -1
- package/dist/chunks/{Robot-BeTWgowU.cjs → Robot-B3vKEVXP.cjs} +1 -1
- package/dist/chunks/{Robot-D4XbngYI.js → Robot-DDD382dk.js} +1 -1
- package/dist/chunks/{RobotHeader-BZci9ahT.js → RobotHeader-BvIzk8Fw.js} +1 -1
- package/dist/chunks/{RobotHeader-CqK0700U.cjs → RobotHeader-Daft80jq.cjs} +1 -1
- package/dist/chunks/{SafetyBar-Bbg-o8h9.cjs → SafetyBar-BVk-SH_0.cjs} +1 -1
- package/dist/chunks/{SafetyBar-Cuak4ffd.js → SafetyBar-eYzCHOFD.js} +1 -1
- package/dist/chunks/TrajectoryExecutionStore-8yxebRg1.cjs +3 -0
- package/dist/chunks/{TrajectoryExecutionStore-DG2Ztg9g.js → TrajectoryExecutionStore-tZgq2ivg.js} +977 -734
- package/dist/chunks/converters-BsXgcxCW.cjs +1 -0
- package/dist/chunks/{converters-DpNB_WNQ.js → converters-D9KpJ2HD.js} +16 -8
- package/dist/components/jogging/JoggingStore.d.ts +29 -3
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +3 -1
- package/dist/core.js +41 -38
- package/dist/index.cjs +1 -1
- package/dist/index.js +49 -46
- package/dist/lib/ControllerStateStream.d.ts +125 -0
- package/dist/lib/controllerStateSource.d.ts +37 -0
- package/dist/lib/nats/natsControllerStateSource.d.ts +27 -0
- package/dist/nats.cjs +1 -0
- package/dist/nats.d.ts +4 -0
- package/dist/nats.js +131 -0
- package/package.json +11 -1
- package/dist/chunks/TrajectoryExecutionStore-BlmjJeEw.cjs +0 -3
- package/dist/chunks/converters-C8I_A_tA.cjs +0 -1
package/dist/chunks/{TrajectoryExecutionStore-DG2Ztg9g.js → TrajectoryExecutionStore-tZgq2ivg.js}
RENAMED
|
@@ -1,61 +1,62 @@
|
|
|
1
|
-
import { jsxs as y, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { ZeroGravityComponentsBackdropFill as
|
|
10
|
-
import { ExpandMoreFilled as
|
|
11
|
-
import { RoundedIconButton as
|
|
12
|
-
import { observer as
|
|
13
|
-
import * as
|
|
14
|
-
import { useState as Y, forwardRef as
|
|
15
|
-
import { e as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import { runInAction as S, makeAutoObservable as
|
|
22
|
-
import { useTranslation as
|
|
23
|
-
import { radiansToDegrees as
|
|
24
|
-
import { JointTypeEnum as
|
|
1
|
+
import { jsxs as y, Fragment as tt, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import te from "@mui/material/AppBar";
|
|
3
|
+
import Ot from "@mui/material/Backdrop";
|
|
4
|
+
import V from "@mui/material/Box";
|
|
5
|
+
import ee from "@mui/material/Menu";
|
|
6
|
+
import $ from "@mui/material/MenuItem";
|
|
7
|
+
import oe from "@mui/material/Toolbar";
|
|
8
|
+
import I from "@mui/material/Typography";
|
|
9
|
+
import { ZeroGravityComponentsBackdropFill as ie } from "@wandelbots/design-tokens";
|
|
10
|
+
import { ExpandMoreFilled as ne } from "@wandelbots/icons/ExpandMoreFilled";
|
|
11
|
+
import { RoundedIconButton as re } from "@wandelbots/mui";
|
|
12
|
+
import { observer as M, useLocalObservable as Rt } from "mobx-react-lite";
|
|
13
|
+
import * as C from "react";
|
|
14
|
+
import { useState as Y, forwardRef as B, useEffect as et, useRef as st, useId as ae } from "react";
|
|
15
|
+
import { e as Q } from "./externalizeComponent-_w2d1_pz.js";
|
|
16
|
+
import se from "@mui/icons-material/OpenWith";
|
|
17
|
+
import le from "@mui/icons-material/Share";
|
|
18
|
+
import _ from "@mui/material/Stack";
|
|
19
|
+
import ce from "@mui/material/Tab";
|
|
20
|
+
import de from "@mui/material/Tabs";
|
|
21
|
+
import { runInAction as S, makeAutoObservable as Z, computed as Jt, when as ot, autorun as yt, reaction as ge } from "mobx";
|
|
22
|
+
import { useTranslation as P } from "react-i18next";
|
|
23
|
+
import { radiansToDegrees as At, tryParseJson as R, XYZ_TO_VECTOR as St, degreesToRadians as he, makeErrorMessage as ue } from "@wandelbots/nova-js";
|
|
24
|
+
import { JointTypeEnum as D } from "@wandelbots/nova-js/v2";
|
|
25
25
|
import * as bt from "three";
|
|
26
|
-
import { Vector3 as K, Quaternion as
|
|
27
|
-
import { d as
|
|
28
|
-
import
|
|
29
|
-
import { capitalize as
|
|
30
|
-
import { lowerFirst as
|
|
31
|
-
import { m as
|
|
32
|
-
import
|
|
33
|
-
import
|
|
26
|
+
import { Vector3 as K, Quaternion as me } from "three";
|
|
27
|
+
import { d as ut, p as vt, q as pe, c as N, e as it, P as A } from "./Pose3-pocKPrHN.js";
|
|
28
|
+
import Pt from "@mui/material/CircularProgress";
|
|
29
|
+
import { capitalize as fe } from "@mui/material/utils";
|
|
30
|
+
import { lowerFirst as ye, countBy as Se } from "lodash-es";
|
|
31
|
+
import { m as be } from "./SafetyBar-eYzCHOFD.js";
|
|
32
|
+
import ve from "@mui/material/Alert";
|
|
33
|
+
import Ce from "@mui/material/AlertTitle";
|
|
34
34
|
import ct from "@mui/material/Button";
|
|
35
|
-
import { useTheme as
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import { e as
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import
|
|
51
|
-
import
|
|
52
|
-
import
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import
|
|
56
|
-
import
|
|
57
|
-
|
|
58
|
-
|
|
35
|
+
import { useTheme as z, styled as Lt } from "@mui/material/styles";
|
|
36
|
+
import F from "@mui/material/Divider";
|
|
37
|
+
import Ct from "@mui/material/ToggleButton";
|
|
38
|
+
import nt from "@mui/material/IconButton";
|
|
39
|
+
import { e as _t, v as _e, c as lt } from "./joggingColors-CuT5u0H8.js";
|
|
40
|
+
import Dt from "lodash-es/isEqual.js";
|
|
41
|
+
import xe from "@mui/material/InputAdornment";
|
|
42
|
+
import Ie from "@mui/material/FormControl";
|
|
43
|
+
import we from "@mui/material/InputLabel";
|
|
44
|
+
import je from "@mui/material/Select";
|
|
45
|
+
import H from "lodash-es/keyBy.js";
|
|
46
|
+
import Me from "lodash-es/uniqueId.js";
|
|
47
|
+
import Ee from "@mui/material/ToggleButtonGroup";
|
|
48
|
+
import Vt from "@mui/material/Slider";
|
|
49
|
+
import Te from "lodash-es/isNumber.js";
|
|
50
|
+
import ke from "@mui/icons-material/ChevronLeft";
|
|
51
|
+
import Oe from "@mui/icons-material/ChevronRight";
|
|
52
|
+
import Re from "lodash-es/throttle.js";
|
|
53
|
+
import Je from "@mui/material/Dialog";
|
|
54
|
+
import Ae from "@mui/material/DialogActions";
|
|
55
|
+
import Pe from "@mui/material/DialogContent";
|
|
56
|
+
import Le from "@mui/material/DialogTitle";
|
|
57
|
+
import { t as De } from "./converters-D9KpJ2HD.js";
|
|
58
|
+
const Ri = Q(
|
|
59
|
+
M((e) => {
|
|
59
60
|
const {
|
|
60
61
|
appIcon: t,
|
|
61
62
|
appName: o,
|
|
@@ -63,16 +64,16 @@ const xi = Z(
|
|
|
63
64
|
onAppSelect: n,
|
|
64
65
|
disabled: r = !1,
|
|
65
66
|
sx: a
|
|
66
|
-
} = e, [s,
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
},
|
|
71
|
-
|
|
67
|
+
} = e, [s, d] = Y(null), u = !!s, h = (l) => {
|
|
68
|
+
d(l.currentTarget);
|
|
69
|
+
}, m = () => {
|
|
70
|
+
d(null);
|
|
71
|
+
}, g = (l) => {
|
|
72
|
+
m(), l.onClick ? l.onClick() : l.href && (window.location.href = l.href), n == null || n(l);
|
|
72
73
|
};
|
|
73
|
-
return /* @__PURE__ */ y(
|
|
74
|
+
return /* @__PURE__ */ y(tt, { children: [
|
|
74
75
|
/* @__PURE__ */ c(
|
|
75
|
-
|
|
76
|
+
te,
|
|
76
77
|
{
|
|
77
78
|
position: "static",
|
|
78
79
|
sx: {
|
|
@@ -84,18 +85,18 @@ const xi = Z(
|
|
|
84
85
|
},
|
|
85
86
|
...a
|
|
86
87
|
},
|
|
87
|
-
children: /* @__PURE__ */ y(
|
|
88
|
-
/* @__PURE__ */ c(
|
|
89
|
-
/* @__PURE__ */ y(
|
|
90
|
-
/* @__PURE__ */ c(
|
|
88
|
+
children: /* @__PURE__ */ y(oe, { sx: { minHeight: "62px !important" }, children: [
|
|
89
|
+
/* @__PURE__ */ c(V, { sx: { mr: 1, display: "flex", alignItems: "center" }, children: t }),
|
|
90
|
+
/* @__PURE__ */ y(V, { sx: { display: "flex", alignItems: "center", flexGrow: 1 }, children: [
|
|
91
|
+
/* @__PURE__ */ c(I, { component: "h1", variant: "subtitle1", children: o }),
|
|
91
92
|
i.length > 0 && /* @__PURE__ */ c(
|
|
92
|
-
|
|
93
|
+
re,
|
|
93
94
|
{
|
|
94
|
-
icon: /* @__PURE__ */ c(
|
|
95
|
+
icon: /* @__PURE__ */ c(ne, { size: 20 }),
|
|
95
96
|
ariaLabel: "switch app",
|
|
96
97
|
"aria-controls": "app-menu",
|
|
97
98
|
"aria-haspopup": "true",
|
|
98
|
-
onClick:
|
|
99
|
+
onClick: h,
|
|
99
100
|
disabled: r,
|
|
100
101
|
sx: { ml: 1 }
|
|
101
102
|
}
|
|
@@ -105,24 +106,24 @@ const xi = Z(
|
|
|
105
106
|
}
|
|
106
107
|
),
|
|
107
108
|
/* @__PURE__ */ c(
|
|
108
|
-
|
|
109
|
+
Ot,
|
|
109
110
|
{
|
|
110
|
-
open:
|
|
111
|
-
onClick:
|
|
111
|
+
open: u,
|
|
112
|
+
onClick: m,
|
|
112
113
|
sx: {
|
|
113
114
|
backdropFilter: "blur(4px)",
|
|
114
|
-
backgroundColor:
|
|
115
|
+
backgroundColor: ie,
|
|
115
116
|
zIndex: (l) => l.zIndex.modal - 1
|
|
116
117
|
}
|
|
117
118
|
}
|
|
118
119
|
),
|
|
119
120
|
/* @__PURE__ */ c(
|
|
120
|
-
|
|
121
|
+
ee,
|
|
121
122
|
{
|
|
122
123
|
id: "app-menu",
|
|
123
124
|
anchorEl: s,
|
|
124
|
-
open:
|
|
125
|
-
onClose:
|
|
125
|
+
open: u,
|
|
126
|
+
onClose: m,
|
|
126
127
|
anchorOrigin: {
|
|
127
128
|
vertical: "bottom",
|
|
128
129
|
horizontal: "left"
|
|
@@ -138,24 +139,24 @@ const xi = Z(
|
|
|
138
139
|
mt: 1
|
|
139
140
|
}
|
|
140
141
|
},
|
|
141
|
-
children: i.map((l) => /* @__PURE__ */ y(
|
|
142
|
-
/* @__PURE__ */ c(
|
|
143
|
-
/* @__PURE__ */ c(
|
|
142
|
+
children: i.map((l) => /* @__PURE__ */ y($, { onClick: () => g(l), children: [
|
|
143
|
+
/* @__PURE__ */ c(V, { sx: { display: "flex", alignItems: "center" }, children: l.icon }),
|
|
144
|
+
/* @__PURE__ */ c(I, { variant: "body1", sx: { ml: 2 }, children: l.name })
|
|
144
145
|
] }, l.id))
|
|
145
146
|
}
|
|
146
147
|
)
|
|
147
148
|
] });
|
|
148
149
|
})
|
|
149
|
-
),
|
|
150
|
+
), Ve = ({
|
|
150
151
|
title: e,
|
|
151
152
|
titleId: t,
|
|
152
153
|
...o
|
|
153
|
-
}, i) => /* @__PURE__ */
|
|
154
|
+
}, i) => /* @__PURE__ */ C.createElement("svg", { width: 21, height: 21, viewBox: "0 0 21 21", fill: "none", xmlns: "http://www.w3.org/2000/svg", ref: i, "aria-labelledby": t, ...o }, e ? /* @__PURE__ */ C.createElement("title", { id: t }, e) : null, /* @__PURE__ */ C.createElement("g", { id: "JogMinus" }, /* @__PURE__ */ C.createElement("path", { id: "Minus", d: "M0 13V8H21V13H0Z", fill: "white" }))), $e = B(Ve), Ne = ({
|
|
154
155
|
title: e,
|
|
155
156
|
titleId: t,
|
|
156
157
|
...o
|
|
157
|
-
}, i) => /* @__PURE__ */
|
|
158
|
-
|
|
158
|
+
}, i) => /* @__PURE__ */ C.createElement("svg", { width: 21, height: 21, viewBox: "0 0 21 21", fill: "none", xmlns: "http://www.w3.org/2000/svg", ref: i, "aria-labelledby": t, ...o }, e ? /* @__PURE__ */ C.createElement("title", { id: t }, e) : null, /* @__PURE__ */ C.createElement("g", { id: "JogPlus" }, /* @__PURE__ */ C.createElement("g", { id: "Plus" }, /* @__PURE__ */ C.createElement("path", { d: "M0 13V8H8V13H0Z", fill: "white" }), /* @__PURE__ */ C.createElement("path", { d: "M8 0L13 2.18557e-07L13 21H8L8 0Z", fill: "white" }), /* @__PURE__ */ C.createElement("path", { d: "M13 13V8H21V13H13Z", fill: "white" })))), Fe = B(Ne), xt = Q(
|
|
159
|
+
M(
|
|
159
160
|
({
|
|
160
161
|
colors: e,
|
|
161
162
|
label: t,
|
|
@@ -166,16 +167,16 @@ const xi = Z(
|
|
|
166
167
|
activeJoggingDirection: a,
|
|
167
168
|
...s
|
|
168
169
|
}) => {
|
|
169
|
-
var
|
|
170
|
-
|
|
171
|
-
const J = o(),
|
|
172
|
-
|
|
170
|
+
var E, T, k, x, O, U, G;
|
|
171
|
+
ut(() => {
|
|
172
|
+
const J = o(), L = g.current;
|
|
173
|
+
L && (L.textContent = J);
|
|
173
174
|
});
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
r &&
|
|
175
|
+
const d = z(), [u, h] = Y(null);
|
|
176
|
+
et(() => {
|
|
177
|
+
r && w();
|
|
177
178
|
}, [r]);
|
|
178
|
-
const
|
|
179
|
+
const m = a || u, g = st(null);
|
|
179
180
|
e || (e = {
|
|
180
181
|
color: "#fff",
|
|
181
182
|
backgroundColor: "#000",
|
|
@@ -188,7 +189,7 @@ const xi = Z(
|
|
|
188
189
|
},
|
|
189
190
|
labelColor: "#000"
|
|
190
191
|
});
|
|
191
|
-
const l =
|
|
192
|
+
const l = m ? (E = e.buttonBackgroundColor) == null ? void 0 : E.pressed : e.borderColor, f = {
|
|
192
193
|
width: "55px",
|
|
193
194
|
color: e.color,
|
|
194
195
|
path: { fill: e.color },
|
|
@@ -204,52 +205,52 @@ const xi = Z(
|
|
|
204
205
|
backgroundColor: (k = e.buttonBackgroundColor) == null ? void 0 : k.hovered
|
|
205
206
|
},
|
|
206
207
|
":active": {
|
|
207
|
-
backgroundColor: (
|
|
208
|
+
backgroundColor: (x = e.buttonBackgroundColor) == null ? void 0 : x.pressed,
|
|
208
209
|
color: e.backgroundColor,
|
|
209
210
|
path: { fill: e.backgroundColor }
|
|
210
211
|
},
|
|
211
212
|
":disabled": {
|
|
212
|
-
backgroundColor: (
|
|
213
|
-
"svg path": { fill:
|
|
213
|
+
backgroundColor: (O = e.buttonBackgroundColor) == null ? void 0 : O.disabled,
|
|
214
|
+
"svg path": { fill: d.palette.action.disabled }
|
|
214
215
|
}
|
|
215
|
-
},
|
|
216
|
+
}, v = {
|
|
216
217
|
...f,
|
|
217
|
-
backgroundColor: (
|
|
218
|
+
backgroundColor: (U = e.buttonBackgroundColor) == null ? void 0 : U.pressed,
|
|
218
219
|
color: e.backgroundColor,
|
|
219
220
|
path: { fill: e.backgroundColor },
|
|
220
221
|
":disabled": {
|
|
221
|
-
backgroundColor: (
|
|
222
|
-
"svg path": { fill:
|
|
222
|
+
backgroundColor: (G = e.buttonBackgroundColor) == null ? void 0 : G.pressed,
|
|
223
|
+
"svg path": { fill: d.palette.action.disabled }
|
|
223
224
|
}
|
|
224
225
|
};
|
|
225
|
-
function
|
|
226
|
-
r || J.button === 0 && (
|
|
226
|
+
function j(J, L) {
|
|
227
|
+
r || J.button === 0 && (h(L), i(L));
|
|
227
228
|
}
|
|
228
|
-
function
|
|
229
|
-
|
|
229
|
+
function w() {
|
|
230
|
+
h(null), n();
|
|
230
231
|
}
|
|
231
|
-
return /* @__PURE__ */ y(
|
|
232
|
+
return /* @__PURE__ */ y(_, { height: "64px", direction: "row", justifyContent: "center", ...s, children: [
|
|
232
233
|
/* @__PURE__ */ c(
|
|
233
|
-
|
|
234
|
+
nt,
|
|
234
235
|
{
|
|
235
236
|
disabled: r,
|
|
236
237
|
disableRipple: !0,
|
|
237
|
-
onPointerDown: (J) =>
|
|
238
|
-
onPointerUp:
|
|
239
|
-
onPointerOut:
|
|
238
|
+
onPointerDown: (J) => j(J, "-"),
|
|
239
|
+
onPointerUp: w,
|
|
240
|
+
onPointerOut: w,
|
|
240
241
|
size: "large",
|
|
241
242
|
sx: {
|
|
242
|
-
...
|
|
243
|
+
...m === "-" ? v : p,
|
|
243
244
|
borderRadius: "16px 0px 0px 16px",
|
|
244
245
|
borderLeft: `2px solid ${l ?? "#fff"}`,
|
|
245
246
|
borderBottom: `2px solid ${l ?? "#fff"}`,
|
|
246
247
|
borderTop: `2px solid ${l ?? "#fff"}`
|
|
247
248
|
},
|
|
248
|
-
children: /* @__PURE__ */ c(
|
|
249
|
+
children: /* @__PURE__ */ c($e, {})
|
|
249
250
|
}
|
|
250
251
|
),
|
|
251
252
|
/* @__PURE__ */ y(
|
|
252
|
-
|
|
253
|
+
_,
|
|
253
254
|
{
|
|
254
255
|
spacing: "6px",
|
|
255
256
|
sx: {
|
|
@@ -263,7 +264,7 @@ const xi = Z(
|
|
|
263
264
|
},
|
|
264
265
|
children: [
|
|
265
266
|
/* @__PURE__ */ c(
|
|
266
|
-
|
|
267
|
+
_,
|
|
267
268
|
{
|
|
268
269
|
height: "22px",
|
|
269
270
|
direction: "row",
|
|
@@ -275,26 +276,26 @@ const xi = Z(
|
|
|
275
276
|
color: e.color,
|
|
276
277
|
".MuiTypography-root": {
|
|
277
278
|
fontWeight: 700,
|
|
278
|
-
...r ? { color:
|
|
279
|
+
...r ? { color: d.palette.action.disabled } : {}
|
|
279
280
|
},
|
|
280
|
-
...r ? { "svg path": { fill:
|
|
281
|
+
...r ? { "svg path": { fill: d.palette.action.disabled } } : {}
|
|
281
282
|
},
|
|
282
283
|
children: t
|
|
283
284
|
}
|
|
284
285
|
),
|
|
285
286
|
/* @__PURE__ */ c(
|
|
286
|
-
|
|
287
|
+
I,
|
|
287
288
|
{
|
|
288
289
|
height: "22px",
|
|
289
290
|
sx: {
|
|
290
291
|
fontSize: "15px",
|
|
291
|
-
color: r ?
|
|
292
|
+
color: r ? d.palette.action.disabled : e.color,
|
|
292
293
|
fontWeight: 700,
|
|
293
294
|
fontVariantNumeric: "tabular-nums",
|
|
294
295
|
minWidth: "80px",
|
|
295
296
|
textAlign: "center"
|
|
296
297
|
},
|
|
297
|
-
ref:
|
|
298
|
+
ref: g,
|
|
298
299
|
children: o()
|
|
299
300
|
}
|
|
300
301
|
)
|
|
@@ -302,29 +303,29 @@ const xi = Z(
|
|
|
302
303
|
}
|
|
303
304
|
),
|
|
304
305
|
/* @__PURE__ */ c(
|
|
305
|
-
|
|
306
|
+
nt,
|
|
306
307
|
{
|
|
307
308
|
disableRipple: !0,
|
|
308
309
|
disabled: r,
|
|
309
|
-
onPointerDown: (J) =>
|
|
310
|
-
onPointerUp:
|
|
311
|
-
onPointerOut:
|
|
310
|
+
onPointerDown: (J) => j(J, "+"),
|
|
311
|
+
onPointerUp: w,
|
|
312
|
+
onPointerOut: w,
|
|
312
313
|
size: "large",
|
|
313
314
|
sx: {
|
|
314
|
-
...
|
|
315
|
+
...m === "+" ? v : p,
|
|
315
316
|
borderRadius: "0px 16px 16px 0px",
|
|
316
317
|
borderRight: `2px solid ${l ?? "#fff"}`,
|
|
317
318
|
borderBottom: `2px solid ${l ?? "#fff"}`,
|
|
318
319
|
borderTop: `2px solid ${l ?? "#fff"}`
|
|
319
320
|
},
|
|
320
|
-
children: /* @__PURE__ */ c(
|
|
321
|
+
children: /* @__PURE__ */ c(Fe, {})
|
|
321
322
|
}
|
|
322
323
|
)
|
|
323
324
|
] });
|
|
324
325
|
}
|
|
325
326
|
)
|
|
326
|
-
),
|
|
327
|
-
|
|
327
|
+
), Be = Q(
|
|
328
|
+
M(
|
|
328
329
|
({
|
|
329
330
|
startJogging: e,
|
|
330
331
|
stopJogging: t,
|
|
@@ -335,11 +336,11 @@ const xi = Z(
|
|
|
335
336
|
disabled: a,
|
|
336
337
|
...s
|
|
337
338
|
}) => {
|
|
338
|
-
var
|
|
339
|
-
const { t:
|
|
340
|
-
background: (
|
|
341
|
-
color: (
|
|
342
|
-
}, l =
|
|
339
|
+
var x, O, U, G, J, L, ft;
|
|
340
|
+
const { t: d } = P(), [u, h] = Y(), m = z(), g = {
|
|
341
|
+
background: (x = m.palette.backgroundPaperElevation) == null ? void 0 : x[4],
|
|
342
|
+
color: (O = m.palette.backgroundPaperElevation) == null ? void 0 : O[11]
|
|
343
|
+
}, l = Rt(() => ({
|
|
343
344
|
activeJoggingDir: null,
|
|
344
345
|
startJogging(b) {
|
|
345
346
|
this.activeJoggingDir = b, e(b);
|
|
@@ -347,43 +348,43 @@ const xi = Z(
|
|
|
347
348
|
stopJogging() {
|
|
348
349
|
this.activeJoggingDir = null, t();
|
|
349
350
|
}
|
|
350
|
-
})), f =
|
|
351
|
+
})), f = Re(() => {
|
|
351
352
|
const b = n ? p(r()) : r();
|
|
352
|
-
(b === void 0 ||
|
|
353
|
+
(b === void 0 || u === void 0 || Math.abs(u - b) > 1e-9) && h(b);
|
|
353
354
|
}, 50);
|
|
354
|
-
|
|
355
|
+
ut(f);
|
|
355
356
|
function p(b) {
|
|
356
357
|
if (b !== void 0)
|
|
357
|
-
return
|
|
358
|
+
return At(b);
|
|
358
359
|
}
|
|
359
|
-
function
|
|
360
|
+
function v(b) {
|
|
360
361
|
b.button === 0 && l.startJogging("-");
|
|
361
362
|
}
|
|
362
|
-
function
|
|
363
|
+
function j(b) {
|
|
363
364
|
b.button === 0 && l.startJogging("+");
|
|
364
365
|
}
|
|
365
|
-
function
|
|
366
|
+
function w(b) {
|
|
366
367
|
l.stopJogging();
|
|
367
368
|
}
|
|
368
|
-
function
|
|
369
|
+
function E(b) {
|
|
369
370
|
l.stopJogging();
|
|
370
371
|
}
|
|
371
|
-
function T(b,
|
|
372
|
+
function T(b, W = 1) {
|
|
372
373
|
if (b === void 0 || Number.isNaN(b)) return "";
|
|
373
|
-
const
|
|
374
|
-
amount: b.toFixed(
|
|
374
|
+
const q = d("General.degree.variable", {
|
|
375
|
+
amount: b.toFixed(W)
|
|
375
376
|
});
|
|
376
|
-
return b > 0 &&
|
|
377
|
+
return b > 0 && W === 0 ? `+${q}` : q;
|
|
377
378
|
}
|
|
378
|
-
function k(b,
|
|
379
|
+
function k(b, W = 1) {
|
|
379
380
|
if (b === void 0 || Number.isNaN(b)) return "";
|
|
380
|
-
const
|
|
381
|
-
amount: b.toFixed(
|
|
381
|
+
const q = d("General.mm.variable", {
|
|
382
|
+
amount: b.toFixed(W)
|
|
382
383
|
});
|
|
383
|
-
return b > 0 &&
|
|
384
|
+
return b > 0 && W === 0 ? `+${q}` : q;
|
|
384
385
|
}
|
|
385
386
|
return /* @__PURE__ */ y(
|
|
386
|
-
|
|
387
|
+
_,
|
|
387
388
|
{
|
|
388
389
|
height: "64px",
|
|
389
390
|
width: "100%",
|
|
@@ -393,52 +394,52 @@ const xi = Z(
|
|
|
393
394
|
sx: {
|
|
394
395
|
"& .MuiIconButton-root": {
|
|
395
396
|
width: "52px",
|
|
396
|
-
color:
|
|
397
|
+
color: m.palette.text.primary,
|
|
397
398
|
alignContent: "center",
|
|
398
|
-
backgroundColor: (
|
|
399
|
+
backgroundColor: (U = m.palette.backgroundPaperElevation) == null ? void 0 : U[11],
|
|
399
400
|
"& svg": {
|
|
400
401
|
width: "42px",
|
|
401
402
|
height: "42px"
|
|
402
403
|
},
|
|
403
404
|
"&.Mui-disabled": {
|
|
404
|
-
backgroundColor: (
|
|
405
|
-
color:
|
|
405
|
+
backgroundColor: (G = m.palette.backgroundPaperElevation) == null ? void 0 : G[11],
|
|
406
|
+
color: m.palette.action.disabled,
|
|
406
407
|
opacity: 1
|
|
407
408
|
},
|
|
408
409
|
"&:hover": {
|
|
409
|
-
backgroundColor: (J =
|
|
410
|
+
backgroundColor: (J = m.palette.backgroundPaperElevation) == null ? void 0 : J[9]
|
|
410
411
|
},
|
|
411
412
|
"&:active": {
|
|
412
|
-
...
|
|
413
|
+
...g
|
|
413
414
|
}
|
|
414
415
|
}
|
|
415
416
|
},
|
|
416
417
|
children: [
|
|
417
418
|
/* @__PURE__ */ c(
|
|
418
|
-
|
|
419
|
+
nt,
|
|
419
420
|
{
|
|
420
|
-
onPointerDown:
|
|
421
|
-
onPointerUp:
|
|
422
|
-
onPointerOut:
|
|
421
|
+
onPointerDown: v,
|
|
422
|
+
onPointerUp: w,
|
|
423
|
+
onPointerOut: E,
|
|
423
424
|
disabled: a,
|
|
424
425
|
disableRipple: !0,
|
|
425
426
|
sx: {
|
|
426
427
|
borderRadius: "16px 0px 0px 16px",
|
|
427
|
-
...l.activeJoggingDir === "-" ?
|
|
428
|
+
...l.activeJoggingDir === "-" ? g : {}
|
|
428
429
|
},
|
|
429
430
|
children: /* @__PURE__ */ c(
|
|
430
|
-
|
|
431
|
+
ke,
|
|
431
432
|
{
|
|
432
433
|
sx: {
|
|
433
434
|
pointerEvents: "none",
|
|
434
|
-
color:
|
|
435
|
+
color: _t
|
|
435
436
|
}
|
|
436
437
|
}
|
|
437
438
|
)
|
|
438
439
|
}
|
|
439
440
|
),
|
|
440
441
|
/* @__PURE__ */ y(
|
|
441
|
-
|
|
442
|
+
_,
|
|
442
443
|
{
|
|
443
444
|
flexGrow: 1,
|
|
444
445
|
alignItems: "center",
|
|
@@ -448,14 +449,14 @@ const xi = Z(
|
|
|
448
449
|
borderLeftWidth: 0,
|
|
449
450
|
borderRightWidth: 0,
|
|
450
451
|
border: "none",
|
|
451
|
-
backgroundColor: (
|
|
452
|
+
backgroundColor: (L = m.palette.backgroundPaperElevation) == null ? void 0 : L[11],
|
|
452
453
|
paddingLeft: "20px",
|
|
453
454
|
paddingRight: "20px",
|
|
454
455
|
zIndex: 1
|
|
455
456
|
},
|
|
456
457
|
children: [
|
|
457
458
|
/* @__PURE__ */ c(
|
|
458
|
-
|
|
459
|
+
I,
|
|
459
460
|
{
|
|
460
461
|
sx: {
|
|
461
462
|
fontSize: "15px",
|
|
@@ -465,19 +466,19 @@ const xi = Z(
|
|
|
465
466
|
fontVariantNumeric: "tabular-nums",
|
|
466
467
|
minWidth: "80px",
|
|
467
468
|
textAlign: "center",
|
|
468
|
-
color: a ?
|
|
469
|
+
color: a ? m.palette.action.disabled : m.palette.text.primary
|
|
469
470
|
},
|
|
470
|
-
children: n ? T(
|
|
471
|
+
children: n ? T(u) : k(u)
|
|
471
472
|
}
|
|
472
473
|
),
|
|
473
474
|
/* @__PURE__ */ c(
|
|
474
|
-
|
|
475
|
+
Vt,
|
|
475
476
|
{
|
|
476
477
|
disabled: !0,
|
|
477
478
|
"aria-label": "Joint position",
|
|
478
479
|
min: n ? p(o) : o,
|
|
479
480
|
max: n ? p(i) : i,
|
|
480
|
-
value:
|
|
481
|
+
value: u || 0,
|
|
481
482
|
track: !1,
|
|
482
483
|
sx: {
|
|
483
484
|
"& .MuiSlider-mark": {
|
|
@@ -487,15 +488,15 @@ const xi = Z(
|
|
|
487
488
|
width: "5px",
|
|
488
489
|
height: "12px",
|
|
489
490
|
borderRadius: "2px",
|
|
490
|
-
color: a ?
|
|
491
|
+
color: a ? m.palette.action.disabled : m.palette.text.primary
|
|
491
492
|
},
|
|
492
493
|
"& .MuiSlider-markLabel": {
|
|
493
494
|
top: "20px",
|
|
494
495
|
fontSize: "12px",
|
|
495
|
-
color: a ?
|
|
496
|
+
color: a ? m.palette.action.disabled : m.palette.text.secondary
|
|
496
497
|
},
|
|
497
498
|
"& .MuiSlider-rail": {
|
|
498
|
-
backgroundColor: (ft =
|
|
499
|
+
backgroundColor: (ft = m.palette.backgroundPaperElevation) == null ? void 0 : ft[5],
|
|
499
500
|
opacity: 1
|
|
500
501
|
}
|
|
501
502
|
},
|
|
@@ -515,23 +516,23 @@ const xi = Z(
|
|
|
515
516
|
}
|
|
516
517
|
),
|
|
517
518
|
/* @__PURE__ */ c(
|
|
518
|
-
|
|
519
|
+
nt,
|
|
519
520
|
{
|
|
520
|
-
onPointerDown:
|
|
521
|
-
onPointerUp:
|
|
522
|
-
onPointerOut:
|
|
521
|
+
onPointerDown: j,
|
|
522
|
+
onPointerUp: w,
|
|
523
|
+
onPointerOut: E,
|
|
523
524
|
disabled: a,
|
|
524
525
|
disableRipple: !0,
|
|
525
526
|
sx: {
|
|
526
527
|
borderRadius: "0px 16px 16px 0px",
|
|
527
|
-
...l.activeJoggingDir === "+" ?
|
|
528
|
+
...l.activeJoggingDir === "+" ? g : {}
|
|
528
529
|
},
|
|
529
530
|
children: /* @__PURE__ */ c(
|
|
530
|
-
|
|
531
|
+
Oe,
|
|
531
532
|
{
|
|
532
533
|
sx: {
|
|
533
534
|
pointerEvents: "none",
|
|
534
|
-
color:
|
|
535
|
+
color: _t
|
|
535
536
|
}
|
|
536
537
|
}
|
|
537
538
|
)
|
|
@@ -543,7 +544,7 @@ const xi = Z(
|
|
|
543
544
|
}
|
|
544
545
|
)
|
|
545
546
|
);
|
|
546
|
-
function
|
|
547
|
+
function ze({
|
|
547
548
|
currentTcpPose: e,
|
|
548
549
|
axis: t,
|
|
549
550
|
direction: o,
|
|
@@ -557,48 +558,48 @@ function Ae({
|
|
|
557
558
|
throw new Error(
|
|
558
559
|
"Current pose has no position, cannot perform translation"
|
|
559
560
|
);
|
|
560
|
-
const
|
|
561
|
-
if (
|
|
561
|
+
const m = i.distanceMm * a, g = new K();
|
|
562
|
+
if (g[t] = m, n) {
|
|
562
563
|
if (!e.orientation)
|
|
563
564
|
throw new Error(
|
|
564
565
|
"Current pose has no orientation, cannot translate relative to tool"
|
|
565
566
|
);
|
|
566
|
-
|
|
567
|
-
|
|
567
|
+
g.applyQuaternion(
|
|
568
|
+
vt(
|
|
568
569
|
e.orientation,
|
|
569
570
|
"ROTATION_VECTOR"
|
|
570
571
|
)
|
|
571
572
|
);
|
|
572
|
-
} else r &&
|
|
573
|
+
} else r && g.applyQuaternion(r);
|
|
573
574
|
const l = [...e.position];
|
|
574
|
-
return l[0] = (l[0] ?? 0) +
|
|
575
|
+
return l[0] = (l[0] ?? 0) + g.x, l[1] = (l[1] ?? 0) + g.y, l[2] = (l[2] ?? 0) + g.z, {
|
|
575
576
|
position: l,
|
|
576
577
|
orientation: e.orientation
|
|
577
578
|
};
|
|
578
579
|
}
|
|
579
580
|
if (!e.orientation)
|
|
580
581
|
throw new Error("Current pose has no orientation, cannot perform rotation");
|
|
581
|
-
const s =
|
|
582
|
+
const s = vt(
|
|
582
583
|
e.orientation,
|
|
583
584
|
"ROTATION_VECTOR"
|
|
584
|
-
),
|
|
585
|
-
|
|
586
|
-
const
|
|
587
|
-
|
|
585
|
+
), d = new K();
|
|
586
|
+
d[t] = 1, !n && r && d.applyQuaternion(r);
|
|
587
|
+
const u = new me().setFromAxisAngle(
|
|
588
|
+
d,
|
|
588
589
|
i.distanceRads * a
|
|
589
|
-
),
|
|
590
|
+
), h = n ? s.multiply(u) : u.multiply(s);
|
|
590
591
|
return {
|
|
591
592
|
position: e.position,
|
|
592
|
-
orientation: [...
|
|
593
|
+
orientation: [...pe(h)]
|
|
593
594
|
};
|
|
594
595
|
}
|
|
595
|
-
function
|
|
596
|
-
return t.length !== e.length ? !1 :
|
|
596
|
+
function $t(e, t, o) {
|
|
597
|
+
return t.length !== e.length ? !1 : Ft(e, t, o);
|
|
597
598
|
}
|
|
598
|
-
function
|
|
599
|
-
return t.length !== e.length ? !0 :
|
|
599
|
+
function Nt(e, t, o) {
|
|
600
|
+
return t.length !== e.length ? !0 : Ft(e, t, o);
|
|
600
601
|
}
|
|
601
|
-
function
|
|
602
|
+
function Ft(e, t, o) {
|
|
602
603
|
for (let i = 0; i < t.length; i++)
|
|
603
604
|
if (Math.abs(
|
|
604
605
|
(t[i] ?? 0) - (e[i] ?? 0)
|
|
@@ -606,7 +607,7 @@ function Dt(e, t, o) {
|
|
|
606
607
|
return !1;
|
|
607
608
|
return !0;
|
|
608
609
|
}
|
|
609
|
-
function
|
|
610
|
+
function Ue(e, t, o) {
|
|
610
611
|
if (e === void 0 && t || e && t === void 0 || (e == null ? void 0 : e.orientation) === void 0 || (t == null ? void 0 : t.orientation) === void 0 || (e == null ? void 0 : e.position) === void 0 || (t == null ? void 0 : t.position) === void 0)
|
|
611
612
|
return !1;
|
|
612
613
|
if (e === void 0 || t === void 0)
|
|
@@ -614,14 +615,14 @@ function Ve(e, t, o) {
|
|
|
614
615
|
let i = 0;
|
|
615
616
|
return i += Math.abs(e.orientation[0] - t.orientation[0]), i += Math.abs(e.orientation[1] - t.orientation[1]), i += Math.abs(e.orientation[2] - t.orientation[2]), i += Math.abs(e.position[0] - t.position[0]), i += Math.abs(e.position[1] - t.position[1]), i += Math.abs(e.position[2] - t.position[2]), i <= o;
|
|
616
617
|
}
|
|
617
|
-
function
|
|
618
|
-
return e.coordinate_system === t.coordinate_system && e.tcp === t.tcp &&
|
|
618
|
+
function Bt(e, t, o) {
|
|
619
|
+
return e.coordinate_system === t.coordinate_system && e.tcp === t.tcp && Ue(
|
|
619
620
|
e.tcp_pose,
|
|
620
621
|
t.tcp_pose,
|
|
621
622
|
o
|
|
622
623
|
);
|
|
623
624
|
}
|
|
624
|
-
function
|
|
625
|
+
function zt(e, t) {
|
|
625
626
|
const o = new K(
|
|
626
627
|
t[0],
|
|
627
628
|
t[1],
|
|
@@ -633,107 +634,107 @@ function Le(e, t) {
|
|
|
633
634
|
), n = o.length(), r = o.normalize();
|
|
634
635
|
let a = i.length(), s = i.normalize();
|
|
635
636
|
s.dot(r) < 0 && (a = -a, s = s.multiplyScalar(-1));
|
|
636
|
-
let
|
|
637
|
-
return
|
|
637
|
+
let d = a - n;
|
|
638
|
+
return d -= 2 * Math.PI * Math.floor((d + Math.PI) / (2 * Math.PI)), a = n + d, [...s.multiplyScalar(a)];
|
|
638
639
|
}
|
|
639
|
-
const
|
|
640
|
-
function
|
|
640
|
+
const Ge = 2e-4;
|
|
641
|
+
function Ut(e) {
|
|
641
642
|
const { joint_position: t, tcp_pose: o, tcp: i, coordinate_system: n } = e;
|
|
642
643
|
return { joint_position: t, tcp_pose: o, tcp: i, coordinate_system: n };
|
|
643
644
|
}
|
|
644
|
-
function
|
|
645
|
-
return e.tcp === t.tcp && e.coordinate_system === t.coordinate_system && e.tcp_pose === void 0 == (t.tcp_pose === void 0) &&
|
|
645
|
+
function Gt(e, t) {
|
|
646
|
+
return e.tcp === t.tcp && e.coordinate_system === t.coordinate_system && e.tcp_pose === void 0 == (t.tcp_pose === void 0) && $t(
|
|
646
647
|
e.joint_position,
|
|
647
648
|
t.joint_position,
|
|
648
|
-
|
|
649
|
+
Ge
|
|
649
650
|
);
|
|
650
651
|
}
|
|
651
|
-
const
|
|
652
|
-
class
|
|
653
|
-
constructor(t, o, i, n, r, a, s = "cell",
|
|
654
|
-
this.controller = o, this.motionGroup = i, this.description = n, this.initialMotionState = r, this.motionStateSocket = a, this.cellId = s, this.nova =
|
|
652
|
+
const It = 1e-4;
|
|
653
|
+
class mt {
|
|
654
|
+
constructor(t, o, i, n, r, a, s = "cell", d = {}) {
|
|
655
|
+
this.controller = o, this.motionGroup = i, this.description = n, this.initialMotionState = r, this.motionStateSocket = a, this.cellId = s, this.nova = N(t), this.logger = d.logger ?? console, this.rapidlyChangingMotionState = r, a.addEventListener("message", (u) => {
|
|
655
656
|
var l;
|
|
656
|
-
const
|
|
657
|
-
if (!
|
|
657
|
+
const h = (l = R(u.data)) == null ? void 0 : l.result;
|
|
658
|
+
if (!h)
|
|
658
659
|
throw new Error(
|
|
659
|
-
`Failed to get motion state for ${this.motionGroupId}: ${
|
|
660
|
+
`Failed to get motion state for ${this.motionGroupId}: ${u.data}`
|
|
660
661
|
);
|
|
661
|
-
|
|
662
|
+
Bt(
|
|
662
663
|
this.rapidlyChangingMotionState,
|
|
663
|
-
|
|
664
|
-
|
|
664
|
+
h,
|
|
665
|
+
It
|
|
665
666
|
) || S(() => {
|
|
666
|
-
var f, p,
|
|
667
|
-
this.rapidlyChangingMotionState.tcp_pose == null ? this.rapidlyChangingMotionState.tcp_pose =
|
|
668
|
-
position:
|
|
669
|
-
orientation:
|
|
670
|
-
|
|
667
|
+
var f, p, v;
|
|
668
|
+
this.rapidlyChangingMotionState.tcp_pose == null ? this.rapidlyChangingMotionState.tcp_pose = h.tcp_pose : (f = h.tcp_pose) != null && f.orientation && ((p = h.tcp_pose) != null && p.position) && ((v = this.rapidlyChangingMotionState.tcp_pose) != null && v.orientation) ? this.rapidlyChangingMotionState.tcp_pose = {
|
|
669
|
+
position: h.tcp_pose.position,
|
|
670
|
+
orientation: zt(
|
|
671
|
+
h.tcp_pose.orientation,
|
|
671
672
|
this.rapidlyChangingMotionState.tcp_pose.orientation
|
|
672
673
|
)
|
|
673
674
|
} : this.logger.debug("Received incomplete tcp_pose, ignoring", {
|
|
674
|
-
tcpPose:
|
|
675
|
+
tcpPose: h.tcp_pose
|
|
675
676
|
});
|
|
676
|
-
}),
|
|
677
|
+
}), Nt(
|
|
677
678
|
this.rapidlyChangingMotionState.joint_position,
|
|
678
|
-
|
|
679
|
-
|
|
679
|
+
h.joint_position,
|
|
680
|
+
It
|
|
680
681
|
) || S(() => {
|
|
681
|
-
this.rapidlyChangingMotionState.joint_position =
|
|
682
|
-
}),
|
|
683
|
-
this.rapidlyChangingMotionState.tcp =
|
|
684
|
-
}), this.rapidlyChangingMotionState.standstill !==
|
|
685
|
-
this.rapidlyChangingMotionState.standstill =
|
|
682
|
+
this.rapidlyChangingMotionState.joint_position = h.joint_position;
|
|
683
|
+
}), h.tcp !== void 0 && this.rapidlyChangingMotionState.tcp !== h.tcp && S(() => {
|
|
684
|
+
this.rapidlyChangingMotionState.tcp = h.tcp;
|
|
685
|
+
}), this.rapidlyChangingMotionState.standstill !== h.standstill && S(() => {
|
|
686
|
+
this.rapidlyChangingMotionState.standstill = h.standstill;
|
|
686
687
|
});
|
|
687
|
-
const
|
|
688
|
-
|
|
689
|
-
this.rapidlyChangingMotionState.joint_limit_reached =
|
|
690
|
-
}), this.rapidlyChangingMotionState.execute !==
|
|
691
|
-
this.rapidlyChangingMotionState.execute =
|
|
688
|
+
const m = this.rapidlyChangingMotionState.joint_limit_reached.limit_reached, g = h.joint_limit_reached.limit_reached;
|
|
689
|
+
m.some((f, p) => f !== g[p]) && S(() => {
|
|
690
|
+
this.rapidlyChangingMotionState.joint_limit_reached = h.joint_limit_reached;
|
|
691
|
+
}), this.rapidlyChangingMotionState.execute !== h.execute && S(() => {
|
|
692
|
+
this.rapidlyChangingMotionState.execute = h.execute;
|
|
692
693
|
});
|
|
693
|
-
}),
|
|
694
|
+
}), Z(this, {
|
|
694
695
|
logger: !1,
|
|
695
696
|
// keepAlive: pose readouts poll it from requestAnimationFrame, which
|
|
696
697
|
// MobX does not track, and a computed nobody observes is recomputed on
|
|
697
698
|
// every read without consulting `equals`
|
|
698
|
-
readoutState:
|
|
699
|
+
readoutState: Jt({ equals: Gt, keepAlive: !0 })
|
|
699
700
|
});
|
|
700
701
|
}
|
|
701
702
|
static async open(t, o, i = {}) {
|
|
702
703
|
var p;
|
|
703
|
-
const n =
|
|
704
|
+
const n = N(t), r = i.cellId ?? it(t) ?? "cell", [a, s] = o.split("@"), d = await n.api.controller.getCurrentRobotControllerState(
|
|
704
705
|
r,
|
|
705
706
|
s
|
|
706
|
-
),
|
|
707
|
-
(
|
|
707
|
+
), u = d == null ? void 0 : d.motion_groups.find(
|
|
708
|
+
(v) => v.motion_group === o
|
|
708
709
|
);
|
|
709
|
-
if (!
|
|
710
|
+
if (!d || !u)
|
|
710
711
|
throw new Error(
|
|
711
712
|
`Controller ${s} or motion group ${o} not found`
|
|
712
713
|
);
|
|
713
|
-
const
|
|
714
|
+
const h = n.openReconnectingWebsocket(
|
|
714
715
|
`/cells/${r}/controllers/${s}/motion-groups/${o}/state-stream`
|
|
715
|
-
),
|
|
716
|
-
if (!
|
|
716
|
+
), m = await h.firstMessage(), g = (p = R(m.data)) == null ? void 0 : p.result;
|
|
717
|
+
if (!g)
|
|
717
718
|
throw new Error(
|
|
718
|
-
`Unable to parse initial motion state message ${
|
|
719
|
+
`Unable to parse initial motion state message ${m.data}`
|
|
719
720
|
);
|
|
720
721
|
const l = i.logger ?? console;
|
|
721
722
|
l.info("Connected motion state websocket to motion group", {
|
|
722
|
-
motionGroup:
|
|
723
|
-
initialMotionState:
|
|
723
|
+
motionGroup: u.motion_group,
|
|
724
|
+
initialMotionState: g
|
|
724
725
|
});
|
|
725
726
|
const f = await n.api.motionGroup.getMotionGroupDescription(
|
|
726
727
|
r,
|
|
727
728
|
s,
|
|
728
|
-
|
|
729
|
+
u.motion_group
|
|
729
730
|
);
|
|
730
|
-
return new
|
|
731
|
+
return new mt(
|
|
731
732
|
n,
|
|
732
|
-
h,
|
|
733
|
-
m,
|
|
734
|
-
f,
|
|
735
733
|
d,
|
|
734
|
+
u,
|
|
735
|
+
f,
|
|
736
736
|
g,
|
|
737
|
+
h,
|
|
737
738
|
r,
|
|
738
739
|
{ logger: l }
|
|
739
740
|
);
|
|
@@ -744,7 +745,7 @@ class ut {
|
|
|
744
745
|
* also holds for untracked reads, e.g. from requestAnimationFrame.
|
|
745
746
|
*/
|
|
746
747
|
get readoutState() {
|
|
747
|
-
return
|
|
748
|
+
return Ut(this.rapidlyChangingMotionState);
|
|
748
749
|
}
|
|
749
750
|
get motionGroupId() {
|
|
750
751
|
return this.motionGroup.motion_group;
|
|
@@ -761,10 +762,10 @@ class ut {
|
|
|
761
762
|
this.motionStateSocket.close();
|
|
762
763
|
}
|
|
763
764
|
}
|
|
764
|
-
const
|
|
765
|
-
function
|
|
765
|
+
const wt = "Movement request rejected. Another client is currently executing a 'Jogging' motion!", We = 500, qe = 5e3;
|
|
766
|
+
function He(e) {
|
|
766
767
|
var o;
|
|
767
|
-
return (((o = e.times) == null ? void 0 : o[e.times.length - 1]) ?? 0) * 2e3 +
|
|
768
|
+
return (((o = e.times) == null ? void 0 : o[e.times.length - 1]) ?? 0) * 2e3 + qe;
|
|
768
769
|
}
|
|
769
770
|
class pt {
|
|
770
771
|
constructor(t, o = {}) {
|
|
@@ -791,7 +792,7 @@ class pt {
|
|
|
791
792
|
* `dispose()` also closes the motion stream that this function opens.
|
|
792
793
|
*/
|
|
793
794
|
static async open(t, o, i = {}) {
|
|
794
|
-
const n = await
|
|
795
|
+
const n = await mt.open(
|
|
795
796
|
t,
|
|
796
797
|
o,
|
|
797
798
|
{
|
|
@@ -810,7 +811,7 @@ class pt {
|
|
|
810
811
|
getDefaultTcp(t) {
|
|
811
812
|
var i, n;
|
|
812
813
|
const o = (n = (i = t.description.dh_parameters) == null ? void 0 : i[0]) == null ? void 0 : n.type;
|
|
813
|
-
return t.joints.length < 6 && (o ===
|
|
814
|
+
return t.joints.length < 6 && (o === D.RevoluteJoint || o === D.PrismaticJoint) ? this.NO_TCP : this.DEFAULT_TCP;
|
|
814
815
|
}
|
|
815
816
|
// Set a new tcp or other options. If current mode is jogging, will reinitialize the jogging websocket
|
|
816
817
|
async setOptions(t) {
|
|
@@ -898,23 +899,23 @@ class pt {
|
|
|
898
899
|
a(
|
|
899
900
|
new Error(`Jogging initialization timeout after ${this.timeout} ms`)
|
|
900
901
|
);
|
|
901
|
-
}, this.timeout), a = (
|
|
902
|
-
n || (n = !0, clearTimeout(r), i.removeEventListener("close",
|
|
903
|
-
}, s = () => a(),
|
|
902
|
+
}, this.timeout), a = (u) => {
|
|
903
|
+
n || (n = !0, clearTimeout(r), i.removeEventListener("close", d), this.endJoggingInit === s && (this.endJoggingInit = void 0), u ? o(u) : t());
|
|
904
|
+
}, s = () => a(), d = () => {
|
|
904
905
|
i.disposed && a();
|
|
905
906
|
};
|
|
906
|
-
this.endJoggingInit = s, i.addEventListener("close",
|
|
907
|
-
var
|
|
908
|
-
const
|
|
909
|
-
if (((
|
|
907
|
+
this.endJoggingInit = s, i.addEventListener("close", d), i.addEventListener("message", (u) => {
|
|
908
|
+
var m, g, l;
|
|
909
|
+
const h = R(u.data);
|
|
910
|
+
if (((m = h == null ? void 0 : h.result) == null ? void 0 : m.kind) === "INITIALIZE_RECEIVED") {
|
|
910
911
|
a();
|
|
911
912
|
return;
|
|
912
913
|
}
|
|
913
|
-
if (((
|
|
914
|
-
if (this.onBlocked && ((l =
|
|
914
|
+
if (((g = h == null ? void 0 : h.result) == null ? void 0 : g.kind) === "MOTION_ERROR")
|
|
915
|
+
if (this.onBlocked && ((l = h == null ? void 0 : h.result) != null && l.message.includes(wt))) {
|
|
915
916
|
a(), i.dispose(), this.onBlocked();
|
|
916
917
|
return;
|
|
917
|
-
} else this.onError ? (a(), this.onError(
|
|
918
|
+
} else this.onError ? (a(), this.onError(u.data)) : a(new Error(u.data));
|
|
918
919
|
}), i.sendJson({
|
|
919
920
|
message_type: "InitializeJoggingRequest",
|
|
920
921
|
motion_group: this.motionGroupId,
|
|
@@ -992,7 +993,7 @@ class pt {
|
|
|
992
993
|
*/
|
|
993
994
|
get coordinateSystemRotation() {
|
|
994
995
|
if (!(this.orientation === "tool" || !this.coordinateSystem))
|
|
995
|
-
return
|
|
996
|
+
return A.fromCoordinateSystem(this.coordinateSystem).quaternion;
|
|
996
997
|
}
|
|
997
998
|
/**
|
|
998
999
|
* Velocity vector along one axis of the jogging frame. The API takes TCP
|
|
@@ -1049,8 +1050,8 @@ class pt {
|
|
|
1049
1050
|
direction: r,
|
|
1050
1051
|
motion: a
|
|
1051
1052
|
}) {
|
|
1052
|
-
var p,
|
|
1053
|
-
const s = [],
|
|
1053
|
+
var p, v, j;
|
|
1054
|
+
const s = [], d = ze({
|
|
1054
1055
|
currentTcpPose: t,
|
|
1055
1056
|
axis: n,
|
|
1056
1057
|
direction: r,
|
|
@@ -1063,29 +1064,29 @@ class pt {
|
|
|
1063
1064
|
path: {
|
|
1064
1065
|
path_definition_name: "PathLine",
|
|
1065
1066
|
target_pose: {
|
|
1066
|
-
position:
|
|
1067
|
-
orientation:
|
|
1067
|
+
position: d.position,
|
|
1068
|
+
orientation: d.orientation
|
|
1068
1069
|
}
|
|
1069
1070
|
}
|
|
1070
1071
|
});
|
|
1071
|
-
const
|
|
1072
|
-
if (
|
|
1072
|
+
const u = this.motionStream.description;
|
|
1073
|
+
if (u.cycle_time === void 0) {
|
|
1073
1074
|
this.logger.warn(
|
|
1074
1075
|
"Current motion group has no cycle time, cannot plan jogging motion"
|
|
1075
1076
|
);
|
|
1076
1077
|
return;
|
|
1077
1078
|
}
|
|
1078
|
-
const
|
|
1079
|
-
motion_group_model: ((
|
|
1080
|
-
cycle_time:
|
|
1081
|
-
mounting:
|
|
1082
|
-
tcp_offset:
|
|
1079
|
+
const h = this.motionStream.rapidlyChangingMotionState.tcp, m = h ? (v = (p = u.tcps) == null ? void 0 : p[h]) == null ? void 0 : v.pose : void 0, g = {
|
|
1080
|
+
motion_group_model: ((j = this.options) == null ? void 0 : j.motionGroupModel) ?? u.motion_group_model,
|
|
1081
|
+
cycle_time: u.cycle_time,
|
|
1082
|
+
mounting: u.mounting,
|
|
1083
|
+
tcp_offset: m,
|
|
1083
1084
|
// FIXME use proper mode's limits if set
|
|
1084
|
-
global:
|
|
1085
|
+
global: u.operation_limits.auto_limits
|
|
1085
1086
|
}, l = await this.nova.api.trajectoryPlanning.planTrajectory(
|
|
1086
1087
|
this.cellId,
|
|
1087
1088
|
{
|
|
1088
|
-
motion_group_setup:
|
|
1089
|
+
motion_group_setup: g,
|
|
1089
1090
|
start_joint_position: o,
|
|
1090
1091
|
motion_commands: s
|
|
1091
1092
|
}
|
|
@@ -1125,46 +1126,46 @@ class pt {
|
|
|
1125
1126
|
let n, r;
|
|
1126
1127
|
try {
|
|
1127
1128
|
await new Promise((a, s) => {
|
|
1128
|
-
let
|
|
1129
|
-
const
|
|
1130
|
-
|
|
1131
|
-
},
|
|
1132
|
-
if (!
|
|
1133
|
-
if (
|
|
1134
|
-
this.onError(
|
|
1129
|
+
let d = !1;
|
|
1130
|
+
const u = () => {
|
|
1131
|
+
d || (d = !0, a());
|
|
1132
|
+
}, h = (g) => {
|
|
1133
|
+
if (!d) {
|
|
1134
|
+
if (d = !0, this.onError) {
|
|
1135
|
+
this.onError(g), a();
|
|
1135
1136
|
return;
|
|
1136
1137
|
}
|
|
1137
1138
|
s(
|
|
1138
|
-
|
|
1139
|
-
`Failed to execute trajectory: ${JSON.stringify(
|
|
1139
|
+
g instanceof Error ? g : new Error(
|
|
1140
|
+
`Failed to execute trajectory: ${JSON.stringify(g)}`
|
|
1140
1141
|
)
|
|
1141
1142
|
);
|
|
1142
1143
|
}
|
|
1143
1144
|
};
|
|
1144
|
-
r =
|
|
1145
|
-
const
|
|
1145
|
+
r = u, this.endIncrementalMotion = u;
|
|
1146
|
+
const m = He(t);
|
|
1146
1147
|
n = setTimeout(() => {
|
|
1147
|
-
|
|
1148
|
-
new Error(`Jogging motion did not complete within ${
|
|
1148
|
+
h(
|
|
1149
|
+
new Error(`Jogging motion did not complete within ${m}ms`)
|
|
1149
1150
|
);
|
|
1150
|
-
},
|
|
1151
|
+
}, m), o.addEventListener("message", (g) => {
|
|
1151
1152
|
var f, p;
|
|
1152
|
-
const l = (f =
|
|
1153
|
+
const l = (f = R(g.data)) == null ? void 0 : f.result;
|
|
1153
1154
|
if (!(l != null && l.kind)) {
|
|
1154
|
-
|
|
1155
|
+
h(
|
|
1155
1156
|
new Error(
|
|
1156
|
-
`Failed to execute trajectory: Received invalid message ${
|
|
1157
|
+
`Failed to execute trajectory: Received invalid message ${g.data}`
|
|
1157
1158
|
)
|
|
1158
1159
|
);
|
|
1159
1160
|
return;
|
|
1160
1161
|
}
|
|
1161
|
-
if (this.onBlocked && ((p = l.message) != null && p.includes(
|
|
1162
|
-
this.onBlocked(),
|
|
1162
|
+
if (this.onBlocked && ((p = l.message) != null && p.includes(wt))) {
|
|
1163
|
+
this.onBlocked(), u();
|
|
1163
1164
|
return;
|
|
1164
1165
|
}
|
|
1165
1166
|
if (l.kind === "INITIALIZE_RECEIVED") {
|
|
1166
1167
|
if (l.add_trajectory_error || l.message) {
|
|
1167
|
-
|
|
1168
|
+
h(l);
|
|
1168
1169
|
return;
|
|
1169
1170
|
}
|
|
1170
1171
|
o.sendJson({
|
|
@@ -1173,11 +1174,11 @@ class pt {
|
|
|
1173
1174
|
});
|
|
1174
1175
|
} else if (l.kind === "START_RECEIVED") {
|
|
1175
1176
|
if (l.message) {
|
|
1176
|
-
|
|
1177
|
+
h(l);
|
|
1177
1178
|
return;
|
|
1178
1179
|
}
|
|
1179
|
-
this.waitForMotionToFinish(i.signal).then(
|
|
1180
|
-
} else l.kind === "PAUSE_RECEIVED" || (l.kind === "MOTION_ERROR" && l.message ?
|
|
1180
|
+
this.waitForMotionToFinish(i.signal).then(u, h);
|
|
1181
|
+
} else l.kind === "PAUSE_RECEIVED" || (l.kind === "MOTION_ERROR" && l.message ? h(l) : h(
|
|
1181
1182
|
new Error(
|
|
1182
1183
|
`Failed to execute trajectory, cannot handle message type "${l.kind}"`
|
|
1183
1184
|
)
|
|
@@ -1207,22 +1208,22 @@ class pt {
|
|
|
1207
1208
|
*/
|
|
1208
1209
|
async waitForMotionToFinish(t) {
|
|
1209
1210
|
const o = () => this.motionStream.rapidlyChangingMotionState.standstill;
|
|
1210
|
-
await
|
|
1211
|
-
timeout:
|
|
1211
|
+
await ot(() => !o(), {
|
|
1212
|
+
timeout: We,
|
|
1212
1213
|
signal: t
|
|
1213
1214
|
}).catch(() => {
|
|
1214
|
-
}), await
|
|
1215
|
+
}), await ot(o, { signal: t });
|
|
1215
1216
|
}
|
|
1216
1217
|
}
|
|
1217
|
-
const
|
|
1218
|
+
const Ke = (e) => {
|
|
1218
1219
|
const t = e.softTimeout || 3e3, [o, i] = Y(!1);
|
|
1219
|
-
return
|
|
1220
|
+
return et(() => {
|
|
1220
1221
|
const n = setTimeout(() => {
|
|
1221
1222
|
i(!0);
|
|
1222
1223
|
}, t);
|
|
1223
1224
|
return () => clearTimeout(n);
|
|
1224
1225
|
}), /* @__PURE__ */ c(
|
|
1225
|
-
|
|
1226
|
+
_,
|
|
1226
1227
|
{
|
|
1227
1228
|
width: "100%",
|
|
1228
1229
|
height: "100%",
|
|
@@ -1230,16 +1231,16 @@ const Ge = (e) => {
|
|
|
1230
1231
|
justifyContent: "center",
|
|
1231
1232
|
sx: { color: "text.primary" },
|
|
1232
1233
|
children: e.error ? /* @__PURE__ */ c(
|
|
1233
|
-
|
|
1234
|
+
Ye,
|
|
1234
1235
|
{
|
|
1235
1236
|
loadingMessage: e.message,
|
|
1236
1237
|
error: e.error
|
|
1237
1238
|
}
|
|
1238
|
-
) : /* @__PURE__ */ y(
|
|
1239
|
-
/* @__PURE__ */ c(
|
|
1240
|
-
!!e.message && /* @__PURE__ */ c(
|
|
1239
|
+
) : /* @__PURE__ */ y(tt, { children: [
|
|
1240
|
+
/* @__PURE__ */ c(Pt, { sx: { mb: 3 } }),
|
|
1241
|
+
!!e.message && /* @__PURE__ */ c(I, { variant: "body1", children: e.message }),
|
|
1241
1242
|
/* @__PURE__ */ c(
|
|
1242
|
-
|
|
1243
|
+
I,
|
|
1243
1244
|
{
|
|
1244
1245
|
variant: "body2",
|
|
1245
1246
|
sx: {
|
|
@@ -1253,10 +1254,10 @@ const Ge = (e) => {
|
|
|
1253
1254
|
] })
|
|
1254
1255
|
}
|
|
1255
1256
|
);
|
|
1256
|
-
},
|
|
1257
|
-
const t =
|
|
1257
|
+
}, Ye = (e) => {
|
|
1258
|
+
const t = be(e.error), o = e.error instanceof Error ? e.error.stack : null;
|
|
1258
1259
|
return /* @__PURE__ */ y(
|
|
1259
|
-
|
|
1260
|
+
_,
|
|
1260
1261
|
{
|
|
1261
1262
|
sx: {
|
|
1262
1263
|
maxHeight: "100%",
|
|
@@ -1266,9 +1267,9 @@ const Ge = (e) => {
|
|
|
1266
1267
|
color: "error.main"
|
|
1267
1268
|
},
|
|
1268
1269
|
children: [
|
|
1269
|
-
/* @__PURE__ */ c(
|
|
1270
|
+
/* @__PURE__ */ c(I, { variant: "body1", children: (e.loadingMessage ? `Error while ${ye(fe(e.loadingMessage))} - ` : "") + t }),
|
|
1270
1271
|
o && /* @__PURE__ */ c(
|
|
1271
|
-
|
|
1272
|
+
V,
|
|
1272
1273
|
{
|
|
1273
1274
|
component: "pre",
|
|
1274
1275
|
sx: {
|
|
@@ -1285,10 +1286,10 @@ const Ge = (e) => {
|
|
|
1285
1286
|
]
|
|
1286
1287
|
}
|
|
1287
1288
|
);
|
|
1288
|
-
},
|
|
1289
|
-
const { t } =
|
|
1289
|
+
}, Qe = M(({ store: e }) => {
|
|
1290
|
+
const { t } = P();
|
|
1290
1291
|
return /* @__PURE__ */ c(
|
|
1291
|
-
|
|
1292
|
+
Ot,
|
|
1292
1293
|
{
|
|
1293
1294
|
"data-testid": "jogging-blocked",
|
|
1294
1295
|
"aria-label": "jogging-blocked",
|
|
@@ -1301,9 +1302,9 @@ const Ge = (e) => {
|
|
|
1301
1302
|
justifyContent: "flex-start",
|
|
1302
1303
|
alignItems: "flex-start"
|
|
1303
1304
|
},
|
|
1304
|
-
children: /* @__PURE__ */ y(
|
|
1305
|
-
/* @__PURE__ */ y(
|
|
1306
|
-
/* @__PURE__ */ c(
|
|
1305
|
+
children: /* @__PURE__ */ y(_, { sx: { m: 2, width: "100%" }, children: [
|
|
1306
|
+
/* @__PURE__ */ y(ve, { severity: "error", sx: { mb: 2 }, children: [
|
|
1307
|
+
/* @__PURE__ */ c(Ce, { children: t("Jogging.Blocked.ti") }),
|
|
1307
1308
|
t("Jogging.Blocked.lb")
|
|
1308
1309
|
] }),
|
|
1309
1310
|
/* @__PURE__ */ c(
|
|
@@ -1318,36 +1319,36 @@ const Ge = (e) => {
|
|
|
1318
1319
|
] })
|
|
1319
1320
|
}
|
|
1320
1321
|
);
|
|
1321
|
-
}),
|
|
1322
|
+
}), Ze = ({
|
|
1322
1323
|
title: e,
|
|
1323
1324
|
titleId: t,
|
|
1324
1325
|
...o
|
|
1325
|
-
}, i) => /* @__PURE__ */
|
|
1326
|
+
}, i) => /* @__PURE__ */ C.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 19, height: 10, fill: "none", ref: i, "aria-labelledby": t, ...o }, e ? /* @__PURE__ */ C.createElement("title", { id: t }, e) : null, /* @__PURE__ */ C.createElement("path", { fill: "#fff", fillRule: "evenodd", d: "M5.131.312a.9.9 0 0 1 0 1.272L3.07 3.645h12.44l-2.06-2.061A.9.9 0 0 1 14.72.313l3.596 3.596a.9.9 0 0 1 0 1.271l-3.596 3.597a.9.9 0 0 1-1.271-1.272l2.061-2.062H3.07L5.13 7.505A.9.9 0 0 1 3.86 8.777L.263 5.18a.9.9 0 0 1 0-1.271L3.86.312a.9.9 0 0 1 1.271 0", clipRule: "evenodd" })), Xe = B(Ze), to = ({
|
|
1326
1327
|
title: e,
|
|
1327
1328
|
titleId: t,
|
|
1328
1329
|
...o
|
|
1329
|
-
}, i) => /* @__PURE__ */
|
|
1330
|
+
}, i) => /* @__PURE__ */ C.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 19, height: 10, fill: "none", ref: i, "aria-labelledby": t, ...o }, e ? /* @__PURE__ */ C.createElement("title", { id: t }, e) : null, /* @__PURE__ */ C.createElement("path", { fill: "#fff", fillRule: "evenodd", d: "M5.131.312a.9.9 0 0 1 0 1.272L3.07 3.645h12.44l-2.06-2.061A.9.9 0 0 1 14.72.313l3.596 3.596a.9.9 0 0 1 0 1.271l-3.596 3.597a.9.9 0 0 1-1.271-1.272l2.061-2.062H3.07L5.13 7.505A.9.9 0 0 1 3.86 8.777L.263 5.18a.9.9 0 0 1 0-1.271L3.86.312a.9.9 0 0 1 1.271 0", clipRule: "evenodd" })), eo = B(to), oo = ({
|
|
1330
1331
|
title: e,
|
|
1331
1332
|
titleId: t,
|
|
1332
1333
|
...o
|
|
1333
|
-
}, i) => /* @__PURE__ */
|
|
1334
|
+
}, i) => /* @__PURE__ */ C.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 10, height: 19, fill: "none", ref: i, "aria-labelledby": t, ...o }, e ? /* @__PURE__ */ C.createElement("title", { id: t }, e) : null, /* @__PURE__ */ C.createElement("path", { fill: "#fff", fillRule: "evenodd", d: "M9.522 14.811A.899.899 0 1 0 8.25 13.54L6.19 15.601V3.16L8.25 5.221A.9.9 0 0 0 9.522 3.95L5.926.354a.9.9 0 0 0-1.272 0L1.058 3.95a.9.9 0 1 0 1.271 1.271L4.391 3.16v12.442L2.329 13.54a.899.899 0 1 0-1.271 1.271l3.596 3.597a.9.9 0 0 0 1.272 0z", clipRule: "evenodd" })), io = B(oo), no = ({
|
|
1334
1335
|
title: e,
|
|
1335
1336
|
titleId: t,
|
|
1336
1337
|
...o
|
|
1337
|
-
}, i) => /* @__PURE__ */
|
|
1338
|
+
}, i) => /* @__PURE__ */ C.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ref: i, "aria-labelledby": t, ...o }, e ? /* @__PURE__ */ C.createElement("title", { id: t }, e) : null, /* @__PURE__ */ C.createElement("path", { d: "M8 16C5.76667 16 3.875 15.225 2.325 13.675C0.775 12.125 0 10.2333 0 8C0 5.76667 0.775 3.875 2.325 2.325C3.875 0.775 5.76667 0 8 0C9.15 0 10.25 0.2375 11.3 0.7125C12.35 1.1875 13.25 1.86667 14 2.75V0H16V7H9V5H13.2C12.6667 4.06667 11.9375 3.33333 11.0125 2.8C10.0875 2.26667 9.08333 2 8 2C6.33333 2 4.91667 2.58333 3.75 3.75C2.58333 4.91667 2 6.33333 2 8C2 9.66667 2.58333 11.0833 3.75 12.25C4.91667 13.4167 6.33333 14 8 14C9.28333 14 10.4417 13.6333 11.475 12.9C11.0583 14.1 12.5083 12.1667 11.475 12.9L12.9 14.325C11.4667 15.4417 9.83333 16 8 16Z", fill: "white" })), ro = B(no), Wt = M(
|
|
1338
1339
|
({ store: e }) => {
|
|
1339
|
-
const { t } =
|
|
1340
|
+
const { t } = P(), [o, i] = Y(
|
|
1340
1341
|
e.jogger.motionStream.rapidlyChangingMotionState.joint_limit_reached.limit_reached
|
|
1341
|
-
), n =
|
|
1342
|
-
|
|
1342
|
+
), n = st(o);
|
|
1343
|
+
ut(() => {
|
|
1343
1344
|
const a = e.jogger.motionStream.rapidlyChangingMotionState.joint_limit_reached.limit_reached;
|
|
1344
|
-
|
|
1345
|
+
Dt(n.current, a) || (n.current = a, i(a));
|
|
1345
1346
|
});
|
|
1346
1347
|
const r = [];
|
|
1347
1348
|
for (const [a, s] of o.entries())
|
|
1348
1349
|
s && r.push(a);
|
|
1349
1350
|
return /* @__PURE__ */ c(
|
|
1350
|
-
|
|
1351
|
+
V,
|
|
1351
1352
|
{
|
|
1352
1353
|
sx: {
|
|
1353
1354
|
display: "flex",
|
|
@@ -1355,7 +1356,7 @@ const Ge = (e) => {
|
|
|
1355
1356
|
justifyContent: "center"
|
|
1356
1357
|
},
|
|
1357
1358
|
children: /* @__PURE__ */ c(
|
|
1358
|
-
|
|
1359
|
+
I,
|
|
1359
1360
|
{
|
|
1360
1361
|
"data-testid": "jogging-joint-limit-detector",
|
|
1361
1362
|
"aria-label": "jogging-joint-limit-detector",
|
|
@@ -1374,7 +1375,7 @@ const Ge = (e) => {
|
|
|
1374
1375
|
}
|
|
1375
1376
|
);
|
|
1376
1377
|
}
|
|
1377
|
-
),
|
|
1378
|
+
), ao = Lt(Ie)(({ theme: e }) => ({
|
|
1378
1379
|
"&.MuiFormControl-root": {
|
|
1379
1380
|
".MuiSelect-select": {
|
|
1380
1381
|
paddingTop: "20px",
|
|
@@ -1391,35 +1392,35 @@ const Ge = (e) => {
|
|
|
1391
1392
|
}
|
|
1392
1393
|
}
|
|
1393
1394
|
}));
|
|
1394
|
-
function
|
|
1395
|
+
function X({
|
|
1395
1396
|
labelValue: e,
|
|
1396
1397
|
...t
|
|
1397
1398
|
}) {
|
|
1398
|
-
return /* @__PURE__ */ y(
|
|
1399
|
-
/* @__PURE__ */ c(
|
|
1400
|
-
/* @__PURE__ */ c(
|
|
1399
|
+
return /* @__PURE__ */ y(ao, { fullWidth: !0, variant: "filled", children: [
|
|
1400
|
+
/* @__PURE__ */ c(we, { id: t.labelId, children: e }),
|
|
1401
|
+
/* @__PURE__ */ c(je, { ...t })
|
|
1401
1402
|
] });
|
|
1402
1403
|
}
|
|
1403
|
-
function
|
|
1404
|
+
function jt(e) {
|
|
1404
1405
|
const t = e.lastIndexOf("On");
|
|
1405
1406
|
return t > 0 ? e.slice(0, t) : e;
|
|
1406
1407
|
}
|
|
1407
|
-
function
|
|
1408
|
+
function qt(e, t) {
|
|
1408
1409
|
const o = e[t];
|
|
1409
1410
|
if (o)
|
|
1410
1411
|
return o;
|
|
1411
|
-
const i =
|
|
1412
|
+
const i = jt(t), n = e[i];
|
|
1412
1413
|
if (n)
|
|
1413
1414
|
return n;
|
|
1414
1415
|
const r = Object.keys(e).filter(
|
|
1415
|
-
(s) =>
|
|
1416
|
+
(s) => jt(s) === i
|
|
1416
1417
|
);
|
|
1417
1418
|
if (r.length !== 1)
|
|
1418
1419
|
return;
|
|
1419
1420
|
const a = r[0];
|
|
1420
1421
|
return a ? e[a] : void 0;
|
|
1421
1422
|
}
|
|
1422
|
-
const
|
|
1423
|
+
const so = {
|
|
1423
1424
|
coordinate_system: "world",
|
|
1424
1425
|
name: "world",
|
|
1425
1426
|
reference_coordinate_system: "",
|
|
@@ -1427,49 +1428,49 @@ const io = {
|
|
|
1427
1428
|
orientation: [0, 0, 0],
|
|
1428
1429
|
orientation_type: "ROTATION_VECTOR"
|
|
1429
1430
|
};
|
|
1430
|
-
function
|
|
1431
|
-
const t =
|
|
1431
|
+
function Ht(e) {
|
|
1432
|
+
const t = H(
|
|
1432
1433
|
e.map((n) => ({
|
|
1433
1434
|
...n,
|
|
1434
1435
|
coordinate_system: n.coordinate_system || "world"
|
|
1435
1436
|
})),
|
|
1436
1437
|
"coordinate_system"
|
|
1437
1438
|
);
|
|
1438
|
-
t.world ?? (t.world =
|
|
1439
|
+
t.world ?? (t.world = so);
|
|
1439
1440
|
const o = {}, i = (n) => {
|
|
1440
1441
|
const r = o[n];
|
|
1441
1442
|
if (r)
|
|
1442
1443
|
return r;
|
|
1443
|
-
const a =
|
|
1444
|
+
const a = qt(t, n);
|
|
1444
1445
|
if (!a)
|
|
1445
1446
|
throw new Error(
|
|
1446
1447
|
`Unknown coordinate system ${n}. Known coordinate systems are: ${Object.keys(t).join(", ")}`
|
|
1447
1448
|
);
|
|
1448
1449
|
const s = a.reference_coordinate_system || "world";
|
|
1449
|
-
let
|
|
1450
|
+
let d;
|
|
1450
1451
|
if (s === "world")
|
|
1451
|
-
|
|
1452
|
+
d = a;
|
|
1452
1453
|
else {
|
|
1453
|
-
const
|
|
1454
|
-
|
|
1454
|
+
const u = i(s), h = A.fromCoordinateSystem(u).multiply(
|
|
1455
|
+
A.fromCoordinateSystem(a)
|
|
1455
1456
|
);
|
|
1456
|
-
|
|
1457
|
+
d = {
|
|
1457
1458
|
...a,
|
|
1458
1459
|
position: [
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1460
|
+
h.position.x,
|
|
1461
|
+
h.position.y,
|
|
1462
|
+
h.position.z
|
|
1462
1463
|
],
|
|
1463
1464
|
orientation: [
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1465
|
+
h.orientation.x,
|
|
1466
|
+
h.orientation.y,
|
|
1467
|
+
h.orientation.z
|
|
1467
1468
|
],
|
|
1468
1469
|
orientation_type: "ROTATION_VECTOR",
|
|
1469
|
-
reference_coordinate_system:
|
|
1470
|
+
reference_coordinate_system: u.reference_coordinate_system
|
|
1470
1471
|
};
|
|
1471
1472
|
}
|
|
1472
|
-
return o[n] =
|
|
1473
|
+
return o[n] = d, d;
|
|
1473
1474
|
};
|
|
1474
1475
|
return Object.fromEntries(
|
|
1475
1476
|
Object.keys(t).map((n) => [
|
|
@@ -1479,7 +1480,7 @@ function Nt(e) {
|
|
|
1479
1480
|
);
|
|
1480
1481
|
}
|
|
1481
1482
|
function dt(e, t) {
|
|
1482
|
-
const o =
|
|
1483
|
+
const o = qt(
|
|
1483
1484
|
e,
|
|
1484
1485
|
t || "world"
|
|
1485
1486
|
);
|
|
@@ -1489,16 +1490,16 @@ function dt(e, t) {
|
|
|
1489
1490
|
);
|
|
1490
1491
|
return o;
|
|
1491
1492
|
}
|
|
1492
|
-
function
|
|
1493
|
+
function lo(e, t) {
|
|
1493
1494
|
return dt(
|
|
1494
|
-
|
|
1495
|
+
Ht(t),
|
|
1495
1496
|
e
|
|
1496
1497
|
);
|
|
1497
1498
|
}
|
|
1498
|
-
function
|
|
1499
|
+
function rt(e, t, o) {
|
|
1499
1500
|
if (e.coordinateSystemId === t)
|
|
1500
1501
|
return e;
|
|
1501
|
-
const i =
|
|
1502
|
+
const i = Ht(o), n = dt(
|
|
1502
1503
|
i,
|
|
1503
1504
|
e.coordinateSystemId || "world"
|
|
1504
1505
|
), r = dt(
|
|
@@ -1510,9 +1511,9 @@ function it(e, t, o) {
|
|
|
1510
1511
|
...e,
|
|
1511
1512
|
coordinateSystemId: r.coordinate_system
|
|
1512
1513
|
};
|
|
1513
|
-
const a =
|
|
1514
|
-
|
|
1515
|
-
|
|
1514
|
+
const a = A.fromCoordinateSystem(r).inverse().multiply(
|
|
1515
|
+
A.fromCoordinateSystem(n).multiply(
|
|
1516
|
+
A.fromPose(e.pose)
|
|
1516
1517
|
)
|
|
1517
1518
|
);
|
|
1518
1519
|
return {
|
|
@@ -1532,14 +1533,14 @@ function it(e, t, o) {
|
|
|
1532
1533
|
coordinateSystemId: r.coordinate_system
|
|
1533
1534
|
};
|
|
1534
1535
|
}
|
|
1535
|
-
function
|
|
1536
|
-
const i =
|
|
1536
|
+
function Kt(e, t, o) {
|
|
1537
|
+
const i = A.fromPose(e).multiply(A.fromRobotTcp(t).inverse()).multiply(A.fromRobotTcp(o)), { position: n, orientation: r } = i;
|
|
1537
1538
|
return {
|
|
1538
1539
|
position: [n.x, n.y, n.z],
|
|
1539
1540
|
orientation: [r.x, r.y, r.z]
|
|
1540
1541
|
};
|
|
1541
1542
|
}
|
|
1542
|
-
function
|
|
1543
|
+
function Mt(e, t) {
|
|
1543
1544
|
const o = e == null ? void 0 : e[t];
|
|
1544
1545
|
if (!o)
|
|
1545
1546
|
throw new Error(
|
|
@@ -1551,7 +1552,7 @@ function Et(e, t) {
|
|
|
1551
1552
|
orientation_type: "ROTATION_VECTOR"
|
|
1552
1553
|
};
|
|
1553
1554
|
}
|
|
1554
|
-
function
|
|
1555
|
+
function Ji({
|
|
1555
1556
|
inputPose: e,
|
|
1556
1557
|
selectedTcpId: t,
|
|
1557
1558
|
selectedCoordinateSystemId: o,
|
|
@@ -1560,24 +1561,24 @@ function _i({
|
|
|
1560
1561
|
}) {
|
|
1561
1562
|
const r = t && t !== e.tcpId ? {
|
|
1562
1563
|
...e,
|
|
1563
|
-
pose:
|
|
1564
|
+
pose: Kt(
|
|
1564
1565
|
e.pose,
|
|
1565
|
-
|
|
1566
|
-
|
|
1566
|
+
Mt(i, e.tcpId),
|
|
1567
|
+
Mt(i, t)
|
|
1567
1568
|
),
|
|
1568
1569
|
tcpId: t
|
|
1569
1570
|
} : e;
|
|
1570
|
-
return o ?
|
|
1571
|
+
return o ? rt(
|
|
1571
1572
|
r,
|
|
1572
1573
|
o,
|
|
1573
1574
|
n
|
|
1574
1575
|
) : r;
|
|
1575
1576
|
}
|
|
1576
|
-
function
|
|
1577
|
+
function Yt(e) {
|
|
1577
1578
|
var t, o, i, n, r;
|
|
1578
1579
|
if (typeof e == "string") {
|
|
1579
|
-
const a =
|
|
1580
|
-
return a ?
|
|
1580
|
+
const a = R(e);
|
|
1581
|
+
return a ? Yt(a) : e;
|
|
1581
1582
|
}
|
|
1582
1583
|
if (e && typeof e == "object") {
|
|
1583
1584
|
const a = e;
|
|
@@ -1590,7 +1591,7 @@ function Bt(e) {
|
|
|
1590
1591
|
}
|
|
1591
1592
|
return "Jogging motion failed";
|
|
1592
1593
|
}
|
|
1593
|
-
const
|
|
1594
|
+
const co = [
|
|
1594
1595
|
// Trajectory-planning failure causes, identified by the error_feedback_name
|
|
1595
1596
|
// of a PlanTrajectoryFailedResponse (see extractJogErrorMessage)
|
|
1596
1597
|
{
|
|
@@ -1620,12 +1621,12 @@ const ro = [
|
|
|
1620
1621
|
translationKey: "Jogging.StreamStateSection.Error.PlanningFailed.lb"
|
|
1621
1622
|
}
|
|
1622
1623
|
];
|
|
1623
|
-
function
|
|
1624
|
+
function go(e) {
|
|
1624
1625
|
var t;
|
|
1625
|
-
return ((t =
|
|
1626
|
+
return ((t = co.find(({ pattern: o }) => o.test(e))) == null ? void 0 : t.translationKey) ?? null;
|
|
1626
1627
|
}
|
|
1627
|
-
const
|
|
1628
|
-
function
|
|
1628
|
+
const ho = 5, uo = 250;
|
|
1629
|
+
function mo(e) {
|
|
1629
1630
|
var i, n, r, a;
|
|
1630
1631
|
const t = [
|
|
1631
1632
|
(n = (i = e == null ? void 0 : e.manual_t1_limits) == null ? void 0 : i.tcp) == null ? void 0 : n.velocity,
|
|
@@ -1633,69 +1634,77 @@ function co(e) {
|
|
|
1633
1634
|
].filter(
|
|
1634
1635
|
(s) => typeof s == "number" && Number.isFinite(s) && s > 0
|
|
1635
1636
|
);
|
|
1636
|
-
return Math.min(
|
|
1637
|
+
return Math.min(uo, ...t) / 10;
|
|
1637
1638
|
}
|
|
1638
1639
|
const gt = [
|
|
1639
1640
|
{ id: "0.1", mm: 0.1, degrees: 0.05 },
|
|
1640
1641
|
{ id: "1", mm: 1, degrees: 0.5 },
|
|
1641
1642
|
{ id: "5", mm: 5, degrees: 2.5 },
|
|
1642
1643
|
{ id: "10", mm: 10, degrees: 5 }
|
|
1643
|
-
],
|
|
1644
|
+
], po = [
|
|
1644
1645
|
{ id: "continuous" },
|
|
1645
1646
|
...gt
|
|
1646
|
-
],
|
|
1647
|
-
class
|
|
1648
|
-
constructor(t, o, i, n, r) {
|
|
1649
|
-
var
|
|
1650
|
-
this.jogger = t, this.coordSystems = o, this.motionGroupDescription = i, this.tcps = n, this.inverseSolverValue = r, this.selectedTabId = "cartesian", this.locks = /* @__PURE__ */ new Set(), this.blocked = !1, this.selectedCoordSystemId = "world", this.jogCoordSystemId = "world", this.selectedTcpId = "", this.tcpChangeInProgress = !1, this.selectedOrientation = "coordsys", this.selectedIncrementId = "continuous", this.selectedCartesianMotionType = "translate", this.incrementJogInProgress = null, this.lastJogError = null, this.onBeforeActivate = null, this.rotationVelocityDegPerSec =
|
|
1651
|
-
for (const
|
|
1652
|
-
if (
|
|
1653
|
-
|
|
1647
|
+
], fo = ["coordsys", "tool"], Et = "joggingToolStore", yo = () => typeof localStorage > "u" ? void 0 : localStorage;
|
|
1648
|
+
class at {
|
|
1649
|
+
constructor(t, o, i, n, r, a = {}) {
|
|
1650
|
+
var d, u, h;
|
|
1651
|
+
this.jogger = t, this.coordSystems = o, this.motionGroupDescription = i, this.tcps = n, this.inverseSolverValue = r, this.selectedTabId = "cartesian", this.locks = /* @__PURE__ */ new Set(), this.blocked = !1, this.selectedCoordSystemId = "world", this.jogCoordSystemId = "world", this.selectedTcpId = "", this.tcpChangeInProgress = !1, this.selectedOrientation = "coordsys", this.selectedIncrementId = "continuous", this.selectedCartesianMotionType = "translate", this.incrementJogInProgress = null, this.lastJogError = null, this.onBeforeActivate = null, this.rotationVelocityDegPerSec = ho, this.minTranslationVelocityMmPerSec = 1, this.maxTranslationVelocityMmPerSec = 250, this.minRotationVelocityDegPerSec = 1, this.maxRotationVelocityDegPerSec = 60, this.showCoordSystemSelect = !1, this.showTcpSelect = !0, this.showOrientationSelect = !0, this.showIncrementSelect = !0, this.showTabIcons = !1, this.showVelocitySliderLabel = !0, this.showVelocityLegend = !1, this.showJointsLegend = !1, this.disposers = [], this.inverseSolver = void 0, this.jointType = D.RevoluteJoint, this.storage = a.storage ?? yo();
|
|
1652
|
+
for (const m of o)
|
|
1653
|
+
if (m.coordinate_system === "") {
|
|
1654
|
+
m.coordinate_system = "world";
|
|
1654
1655
|
break;
|
|
1655
1656
|
}
|
|
1656
|
-
this.selectedCoordSystemId = ((
|
|
1657
|
+
this.selectedCoordSystemId = ((d = o[0]) == null ? void 0 : d.coordinate_system) || "world", this.jogCoordSystemId = this.selectedCoordSystemId, this.selectedTcpId = t.motionStream.rapidlyChangingMotionState.tcp ?? "", this.tcpChangeInProgress = this.tcps.length > 0 && !this.selectedTcpId, this.inverseSolver = r, this.translationVelocityMmPerSec = mo(
|
|
1657
1658
|
i == null ? void 0 : i.operation_limits
|
|
1658
|
-
), this.jointType = ((
|
|
1659
|
+
), this.jointType = ((h = (u = i == null ? void 0 : i.dh_parameters) == null ? void 0 : u[0]) == null ? void 0 : h.type) ?? D.RevoluteJoint, Z(
|
|
1660
|
+
this,
|
|
1661
|
+
{ storage: !1 },
|
|
1662
|
+
{ autoBind: !0 }
|
|
1663
|
+
), this.jogger.onBlocked = () => {
|
|
1659
1664
|
this.block();
|
|
1660
1665
|
};
|
|
1661
|
-
const
|
|
1662
|
-
this.jogger.onError = (
|
|
1663
|
-
this.setLastJogError(
|
|
1666
|
+
const s = this.jogger.onError;
|
|
1667
|
+
this.jogger.onError = (m) => {
|
|
1668
|
+
this.setLastJogError(Yt(m)), s == null || s(m);
|
|
1664
1669
|
}, this.loadFromLocalStorage(), this.disposers.push(yt(() => this.saveToLocalStorage())), this.disposers.push(
|
|
1665
1670
|
yt(() => {
|
|
1666
|
-
const
|
|
1667
|
-
|
|
1668
|
-
this.selectedTcpId =
|
|
1671
|
+
const m = this.jogger.motionStream.rapidlyChangingMotionState.tcp;
|
|
1672
|
+
m && m !== this.selectedTcpId && S(() => {
|
|
1673
|
+
this.selectedTcpId = m, this.tcpChangeInProgress = !1;
|
|
1669
1674
|
});
|
|
1670
1675
|
})
|
|
1671
|
-
)
|
|
1676
|
+
);
|
|
1672
1677
|
}
|
|
1673
1678
|
/**
|
|
1674
1679
|
* Load a jogging store with the relevant data it needs
|
|
1675
1680
|
* from the backend
|
|
1676
1681
|
*/
|
|
1677
|
-
static async loadFor(t) {
|
|
1678
|
-
const { nova:
|
|
1682
|
+
static async loadFor(t, o = {}) {
|
|
1683
|
+
const { nova: i, cellId: n } = t, [r, a] = await Promise.all([
|
|
1679
1684
|
// Fetch coord systems so user can select between them
|
|
1680
|
-
|
|
1681
|
-
|
|
1685
|
+
i.api.controller.listCoordinateSystems(
|
|
1686
|
+
n,
|
|
1682
1687
|
t.motionStream.controllerId,
|
|
1683
1688
|
"ROTATION_VECTOR"
|
|
1684
1689
|
),
|
|
1685
1690
|
// Same for TCPs and other info from description
|
|
1686
|
-
|
|
1687
|
-
|
|
1691
|
+
i.api.motionGroup.getMotionGroupDescription(
|
|
1692
|
+
n,
|
|
1688
1693
|
t.motionStream.controllerId,
|
|
1689
1694
|
t.motionGroupId
|
|
1690
1695
|
)
|
|
1691
|
-
]),
|
|
1692
|
-
|
|
1696
|
+
]), s = await i.api.motionGroupModels.getMotionGroupKinematicModel(
|
|
1697
|
+
a.motion_group_model
|
|
1698
|
+
);
|
|
1699
|
+
return at.create(
|
|
1700
|
+
t,
|
|
1701
|
+
{
|
|
1702
|
+
coordinateSystems: r || [],
|
|
1703
|
+
description: a,
|
|
1704
|
+
kinematicModel: s
|
|
1705
|
+
},
|
|
1706
|
+
o
|
|
1693
1707
|
);
|
|
1694
|
-
return nt.create(t, {
|
|
1695
|
-
coordinateSystems: n || [],
|
|
1696
|
-
description: r,
|
|
1697
|
-
kinematicModel: a
|
|
1698
|
-
});
|
|
1699
1708
|
}
|
|
1700
1709
|
/**
|
|
1701
1710
|
* Make a jogging store from data that was loaded before: the coordinate
|
|
@@ -1703,19 +1712,20 @@ class nt {
|
|
|
1703
1712
|
* motion group. An app that loads them once for several stores uses this
|
|
1704
1713
|
* instead of {@link JoggingStore.loadFor}.
|
|
1705
1714
|
*/
|
|
1706
|
-
static create(t, o) {
|
|
1707
|
-
const { coordinateSystems:
|
|
1708
|
-
id:
|
|
1709
|
-
readable_name:
|
|
1710
|
-
position:
|
|
1711
|
-
orientation:
|
|
1715
|
+
static create(t, o, i = {}) {
|
|
1716
|
+
const { coordinateSystems: n, description: r, kinematicModel: a } = o, s = Object.entries(r.tcps || {}).map(([d, u]) => ({
|
|
1717
|
+
id: d,
|
|
1718
|
+
readable_name: u.name,
|
|
1719
|
+
position: u.pose.position,
|
|
1720
|
+
orientation: u.pose.orientation
|
|
1712
1721
|
}));
|
|
1713
|
-
return new
|
|
1722
|
+
return new at(
|
|
1714
1723
|
t,
|
|
1715
|
-
i,
|
|
1716
1724
|
n,
|
|
1717
|
-
|
|
1718
|
-
|
|
1725
|
+
r,
|
|
1726
|
+
s,
|
|
1727
|
+
a.inverse_solver,
|
|
1728
|
+
i
|
|
1719
1729
|
);
|
|
1720
1730
|
}
|
|
1721
1731
|
dispose() {
|
|
@@ -1724,7 +1734,7 @@ class nt {
|
|
|
1724
1734
|
this.jogger.dispose();
|
|
1725
1735
|
}
|
|
1726
1736
|
get coordSystemCountByName() {
|
|
1727
|
-
return
|
|
1737
|
+
return Se(this.coordSystems, (t) => t.name);
|
|
1728
1738
|
}
|
|
1729
1739
|
async deactivate() {
|
|
1730
1740
|
this.jogger.mode === "jogging" && await this.jogger.setJoggingMode("off");
|
|
@@ -1741,15 +1751,22 @@ class nt {
|
|
|
1741
1751
|
orientation: this.selectedOrientation
|
|
1742
1752
|
}), this.jogger.coordinateSystem = this.jogCoordSystem, this.activeDiscreteIncrement ? await this.jogger.setJoggingMode("trajectory") : await this.jogger.setJoggingMode("jogging")) : await this.jogger.setJoggingMode("jogging"), this.jogger;
|
|
1743
1753
|
}
|
|
1754
|
+
/**
|
|
1755
|
+
* Takes the user's settings from the storage (see
|
|
1756
|
+
* {@link JoggingStoreOptions}), which is `localStorage` only by default
|
|
1757
|
+
*/
|
|
1744
1758
|
loadFromLocalStorage() {
|
|
1745
|
-
|
|
1746
|
-
|
|
1759
|
+
var i;
|
|
1760
|
+
const t = (i = this.storage) == null ? void 0 : i.getItem(Et), o = t ? R(t) : void 0;
|
|
1761
|
+
o && (this.tabsById[o.selectedTabId] && (this.selectedTabId = o.selectedTabId), this.coordSystemsById[o.selectedCoordSystemId] && (this.selectedCoordSystemId = o.selectedCoordSystemId), this.coordSystemsById[o.jogCoordSystemId] && (this.jogCoordSystemId = o.jogCoordSystemId), this.incrementOptionsById[o.selectedIncrementId] && (this.selectedIncrementId = o.selectedIncrementId), ["translate", "rotate"].includes(o.selectedCartesianMotionType) && (this.selectedCartesianMotionType = o.selectedCartesianMotionType), ["coordsys", "tool"].includes(o.selectedOrientation) && (this.selectedOrientation = o.selectedOrientation));
|
|
1747
1762
|
}
|
|
1763
|
+
/**
|
|
1764
|
+
* Keeps the user's settings in the storage (see
|
|
1765
|
+
* {@link JoggingStoreOptions}), which is `localStorage` only by default
|
|
1766
|
+
*/
|
|
1748
1767
|
saveToLocalStorage() {
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
JSON.stringify(this.localStorageSave)
|
|
1752
|
-
);
|
|
1768
|
+
var t;
|
|
1769
|
+
(t = this.storage) == null || t.setItem(Et, JSON.stringify(this.localStorageSave));
|
|
1753
1770
|
}
|
|
1754
1771
|
get isLocked() {
|
|
1755
1772
|
return this.locks.size > 0;
|
|
@@ -1762,7 +1779,7 @@ class nt {
|
|
|
1762
1779
|
* shown as-is).
|
|
1763
1780
|
*/
|
|
1764
1781
|
get lastJogErrorTranslationKey() {
|
|
1765
|
-
return this.lastJogError ?
|
|
1782
|
+
return this.lastJogError ? go(this.lastJogError) : null;
|
|
1766
1783
|
}
|
|
1767
1784
|
get localStorageSave() {
|
|
1768
1785
|
return {
|
|
@@ -1796,16 +1813,16 @@ class nt {
|
|
|
1796
1813
|
}), t;
|
|
1797
1814
|
}
|
|
1798
1815
|
get incrementOptions() {
|
|
1799
|
-
return
|
|
1816
|
+
return po;
|
|
1800
1817
|
}
|
|
1801
1818
|
get discreteIncrementOptions() {
|
|
1802
1819
|
return gt;
|
|
1803
1820
|
}
|
|
1804
1821
|
get incrementOptionsById() {
|
|
1805
|
-
return
|
|
1822
|
+
return H(this.incrementOptions, (t) => t.id);
|
|
1806
1823
|
}
|
|
1807
1824
|
get tabsById() {
|
|
1808
|
-
return
|
|
1825
|
+
return H(this.tabs, (t) => t.id);
|
|
1809
1826
|
}
|
|
1810
1827
|
get currentTab() {
|
|
1811
1828
|
return this.tabsById[this.selectedTabId] || this.tabs[0];
|
|
@@ -1814,7 +1831,7 @@ class nt {
|
|
|
1814
1831
|
return this.tabs.indexOf(this.currentTab);
|
|
1815
1832
|
}
|
|
1816
1833
|
get coordSystemsById() {
|
|
1817
|
-
return
|
|
1834
|
+
return H(this.coordSystems, (t) => t.coordinate_system);
|
|
1818
1835
|
}
|
|
1819
1836
|
/**
|
|
1820
1837
|
* The id of the coordinate system to use for jogging.
|
|
@@ -1826,7 +1843,7 @@ class nt {
|
|
|
1826
1843
|
}
|
|
1827
1844
|
/** The coordinate system to jog along, resolved relative to world */
|
|
1828
1845
|
get jogCoordSystem() {
|
|
1829
|
-
return
|
|
1846
|
+
return lo(
|
|
1830
1847
|
this.jogCoordSystemId,
|
|
1831
1848
|
this.coordSystems
|
|
1832
1849
|
);
|
|
@@ -1839,7 +1856,7 @@ class nt {
|
|
|
1839
1856
|
*/
|
|
1840
1857
|
get tcpPoseInSelectedCoordSystem() {
|
|
1841
1858
|
const { tcp_pose: t, coordinate_system: o } = this.jogger.motionStream.readoutState;
|
|
1842
|
-
return !(t != null && t.position) || !t.orientation ? t :
|
|
1859
|
+
return !(t != null && t.position) || !t.orientation ? t : rt(
|
|
1843
1860
|
{
|
|
1844
1861
|
pose: {
|
|
1845
1862
|
position: t.position,
|
|
@@ -1852,7 +1869,7 @@ class nt {
|
|
|
1852
1869
|
).pose;
|
|
1853
1870
|
}
|
|
1854
1871
|
get tcpsById() {
|
|
1855
|
-
return
|
|
1872
|
+
return H(this.tcps, (t) => t.id);
|
|
1856
1873
|
}
|
|
1857
1874
|
/**
|
|
1858
1875
|
* The streamed TCP pose (its readout) as the pose of a TCP, relative to a
|
|
@@ -1864,9 +1881,9 @@ class nt {
|
|
|
1864
1881
|
const { tcp_pose: i, tcp: n, coordinate_system: r } = this.jogger.motionStream.readoutState, a = this.tcpsById[n || this.selectedTcpId], s = this.tcpsById[t];
|
|
1865
1882
|
if (!(!(i != null && i.position) || !i.orientation) && !(!a || !s))
|
|
1866
1883
|
try {
|
|
1867
|
-
return
|
|
1884
|
+
return rt(
|
|
1868
1885
|
{
|
|
1869
|
-
pose:
|
|
1886
|
+
pose: Kt(i, a, s),
|
|
1870
1887
|
coordinateSystemId: r || "world"
|
|
1871
1888
|
},
|
|
1872
1889
|
o,
|
|
@@ -1951,7 +1968,7 @@ class nt {
|
|
|
1951
1968
|
return new Promise((i) => {
|
|
1952
1969
|
const n = setTimeout(() => {
|
|
1953
1970
|
r(), i(!1);
|
|
1954
|
-
}, o), r =
|
|
1971
|
+
}, o), r = ot(
|
|
1955
1972
|
() => this.jogger.motionStream.rapidlyChangingMotionState.tcp === t,
|
|
1956
1973
|
() => {
|
|
1957
1974
|
clearTimeout(n), i(!0);
|
|
@@ -2007,7 +2024,7 @@ class nt {
|
|
|
2007
2024
|
}
|
|
2008
2025
|
/** Lock the UI until the given async callback resolves */
|
|
2009
2026
|
async withMotionLock(t) {
|
|
2010
|
-
const o =
|
|
2027
|
+
const o = Me();
|
|
2011
2028
|
this.lock(o);
|
|
2012
2029
|
try {
|
|
2013
2030
|
return await t();
|
|
@@ -2016,10 +2033,10 @@ class nt {
|
|
|
2016
2033
|
}
|
|
2017
2034
|
}
|
|
2018
2035
|
}
|
|
2019
|
-
const
|
|
2036
|
+
const So = M(
|
|
2020
2037
|
({ store: e, useDegree: t }) => {
|
|
2021
2038
|
var a;
|
|
2022
|
-
const { t: o } =
|
|
2039
|
+
const { t: o } = P(), i = ae(), n = [];
|
|
2023
2040
|
function r(s) {
|
|
2024
2041
|
switch (s) {
|
|
2025
2042
|
case "coordsys":
|
|
@@ -2032,7 +2049,7 @@ const mo = E(
|
|
|
2032
2049
|
}
|
|
2033
2050
|
return e.showCoordSystemSelect && n.push(
|
|
2034
2051
|
/* @__PURE__ */ c(
|
|
2035
|
-
|
|
2052
|
+
X,
|
|
2036
2053
|
{
|
|
2037
2054
|
labelId: `jogging-coord-select-${i}`,
|
|
2038
2055
|
labelValue: o("Jogging.CoordinateSystem.hlb"),
|
|
@@ -2041,13 +2058,13 @@ const mo = E(
|
|
|
2041
2058
|
variant: "filled",
|
|
2042
2059
|
displayEmpty: !0,
|
|
2043
2060
|
onChange: (s) => e.setSelectedCoordSystemId(s.target.value),
|
|
2044
|
-
children: e.coordSystems.map((s) => /* @__PURE__ */ c(
|
|
2061
|
+
children: e.coordSystems.map((s) => /* @__PURE__ */ c($, { value: s.coordinate_system, children: s.name && e.coordSystemCountByName[s.name] > 1 ? `${s.name} / ${s.coordinate_system}` : s.name || s.coordinate_system }, s.coordinate_system))
|
|
2045
2062
|
},
|
|
2046
2063
|
"coord"
|
|
2047
2064
|
)
|
|
2048
2065
|
), e.showTcpSelect && n.push(
|
|
2049
2066
|
/* @__PURE__ */ c(
|
|
2050
|
-
|
|
2067
|
+
X,
|
|
2051
2068
|
{
|
|
2052
2069
|
labelId: `jogging-tcp-select-${i}`,
|
|
2053
2070
|
labelValue: "TCP",
|
|
@@ -2056,31 +2073,31 @@ const mo = E(
|
|
|
2056
2073
|
variant: "filled",
|
|
2057
2074
|
displayEmpty: e.tcpChangeInProgress,
|
|
2058
2075
|
onChange: (s) => {
|
|
2059
|
-
e.requestTcpChange(s.target.value).catch((
|
|
2060
|
-
console.error("Failed to change TCP:",
|
|
2076
|
+
e.requestTcpChange(s.target.value).catch((d) => {
|
|
2077
|
+
console.error("Failed to change TCP:", d);
|
|
2061
2078
|
});
|
|
2062
2079
|
},
|
|
2063
2080
|
disabled: e.tcpChangeInProgress,
|
|
2064
|
-
endAdornment: e.tcpChangeInProgress ? /* @__PURE__ */ c(
|
|
2065
|
-
children: e.tcps.map((s) => /* @__PURE__ */ c(
|
|
2081
|
+
endAdornment: e.tcpChangeInProgress ? /* @__PURE__ */ c(xe, { position: "end", children: /* @__PURE__ */ c(Pt, { size: 16 }) }) : void 0,
|
|
2082
|
+
children: e.tcps.map((s) => /* @__PURE__ */ c($, { value: s.id, children: s.id }, s.id))
|
|
2066
2083
|
},
|
|
2067
2084
|
"tcp"
|
|
2068
2085
|
)
|
|
2069
2086
|
), e.showOrientationSelect && n.push(
|
|
2070
2087
|
/* @__PURE__ */ c(
|
|
2071
|
-
|
|
2088
|
+
X,
|
|
2072
2089
|
{
|
|
2073
2090
|
labelValue: o("Jogging.Cartesian.Orientation.lb"),
|
|
2074
2091
|
labelId: `orientation-select-${i}`,
|
|
2075
2092
|
value: e.selectedOrientation,
|
|
2076
2093
|
onChange: (s) => e.setSelectedOrientation(s.target.value),
|
|
2077
|
-
children:
|
|
2094
|
+
children: fo.map((s) => /* @__PURE__ */ c($, { value: s, children: r(s) }, s))
|
|
2078
2095
|
},
|
|
2079
2096
|
"orientation"
|
|
2080
2097
|
)
|
|
2081
2098
|
), e.showIncrementSelect && n.push(
|
|
2082
2099
|
/* @__PURE__ */ y(
|
|
2083
|
-
|
|
2100
|
+
X,
|
|
2084
2101
|
{
|
|
2085
2102
|
labelValue: o("Jogging.Increment.hlb"),
|
|
2086
2103
|
labelId: `jogging-increment-select-${i}`,
|
|
@@ -2091,14 +2108,14 @@ const mo = E(
|
|
|
2091
2108
|
s.target.value
|
|
2092
2109
|
),
|
|
2093
2110
|
children: [
|
|
2094
|
-
/* @__PURE__ */ c(
|
|
2095
|
-
e.discreteIncrementOptions.map((s) => /* @__PURE__ */ c(
|
|
2111
|
+
/* @__PURE__ */ c($, { value: "continuous", children: o("Jogging.Increment.Continuous.dd") }, "continuous"),
|
|
2112
|
+
e.discreteIncrementOptions.map((s) => /* @__PURE__ */ c($, { value: s.id, children: t ? `${s.degrees}°` : `${s.mm}mm` }, s.id))
|
|
2096
2113
|
]
|
|
2097
2114
|
},
|
|
2098
2115
|
"increment"
|
|
2099
2116
|
)
|
|
2100
2117
|
), /* @__PURE__ */ c(
|
|
2101
|
-
|
|
2118
|
+
V,
|
|
2102
2119
|
{
|
|
2103
2120
|
component: "div",
|
|
2104
2121
|
"data-testid": "jogging-options",
|
|
@@ -2110,20 +2127,20 @@ const mo = E(
|
|
|
2110
2127
|
gridAutoRows: "min-content",
|
|
2111
2128
|
"& label": { opacity: 0.7, fontSize: "12px", marginBottom: "4px" }
|
|
2112
2129
|
},
|
|
2113
|
-
children: n.map((s,
|
|
2114
|
-
|
|
2130
|
+
children: n.map((s, d) => /* @__PURE__ */ c(
|
|
2131
|
+
V,
|
|
2115
2132
|
{
|
|
2116
2133
|
sx: {
|
|
2117
|
-
gridColumn: n.length % 2 === 1 &&
|
|
2134
|
+
gridColumn: n.length % 2 === 1 && d === n.length - 1 ? "span 2" : "auto"
|
|
2118
2135
|
},
|
|
2119
2136
|
children: s
|
|
2120
2137
|
},
|
|
2121
|
-
|
|
2138
|
+
d
|
|
2122
2139
|
))
|
|
2123
2140
|
}
|
|
2124
2141
|
);
|
|
2125
2142
|
}
|
|
2126
|
-
),
|
|
2143
|
+
), bo = Lt(Ee)(({ theme: e }) => {
|
|
2127
2144
|
var t;
|
|
2128
2145
|
return {
|
|
2129
2146
|
"&.MuiToggleButtonGroup-root": {
|
|
@@ -2145,14 +2162,14 @@ const mo = E(
|
|
|
2145
2162
|
}
|
|
2146
2163
|
}
|
|
2147
2164
|
};
|
|
2148
|
-
}),
|
|
2149
|
-
|
|
2150
|
-
const { store: t } = e, { t: o } =
|
|
2165
|
+
}), vo = Q(
|
|
2166
|
+
M((e) => {
|
|
2167
|
+
const { store: t } = e, { t: o } = P();
|
|
2151
2168
|
function i(n, r) {
|
|
2152
|
-
r === e.velocity || !
|
|
2169
|
+
r === e.velocity || !Te(r) || e.onVelocityChange(r, e.useDegree);
|
|
2153
2170
|
}
|
|
2154
2171
|
return /* @__PURE__ */ y(
|
|
2155
|
-
|
|
2172
|
+
_,
|
|
2156
2173
|
{
|
|
2157
2174
|
direction: "row",
|
|
2158
2175
|
gap: 2,
|
|
@@ -2161,17 +2178,17 @@ const mo = E(
|
|
|
2161
2178
|
"aria-label": "velocity-slider",
|
|
2162
2179
|
children: [
|
|
2163
2180
|
t.showVelocityLegend && /* @__PURE__ */ c(
|
|
2164
|
-
|
|
2181
|
+
I,
|
|
2165
2182
|
{
|
|
2166
2183
|
sx: {
|
|
2167
|
-
color:
|
|
2184
|
+
color: _e,
|
|
2168
2185
|
fontSize: "14px"
|
|
2169
2186
|
},
|
|
2170
2187
|
children: o("Jogging.Velocity.bt")
|
|
2171
2188
|
}
|
|
2172
2189
|
),
|
|
2173
2190
|
/* @__PURE__ */ c(
|
|
2174
|
-
|
|
2191
|
+
Vt,
|
|
2175
2192
|
{
|
|
2176
2193
|
value: e.velocity,
|
|
2177
2194
|
color: "secondary",
|
|
@@ -2189,17 +2206,17 @@ const mo = E(
|
|
|
2189
2206
|
}
|
|
2190
2207
|
}
|
|
2191
2208
|
),
|
|
2192
|
-
t.showVelocitySliderLabel && (e.renderValue ? e.renderValue(e.velocity) : /* @__PURE__ */ c(
|
|
2209
|
+
t.showVelocitySliderLabel && (e.renderValue ? e.renderValue(e.velocity) : /* @__PURE__ */ c(Qt, { value: e.velocity.toString() }))
|
|
2193
2210
|
]
|
|
2194
2211
|
}
|
|
2195
2212
|
);
|
|
2196
2213
|
})
|
|
2197
2214
|
);
|
|
2198
|
-
function
|
|
2215
|
+
function Qt({ value: e, sx: t }) {
|
|
2199
2216
|
var i;
|
|
2200
|
-
const o =
|
|
2217
|
+
const o = z();
|
|
2201
2218
|
return /* @__PURE__ */ c(
|
|
2202
|
-
|
|
2219
|
+
_,
|
|
2203
2220
|
{
|
|
2204
2221
|
direction: "row",
|
|
2205
2222
|
justifyContent: "center",
|
|
@@ -2213,7 +2230,7 @@ function zt({ value: e, sx: t }) {
|
|
|
2213
2230
|
...t
|
|
2214
2231
|
},
|
|
2215
2232
|
children: /* @__PURE__ */ c(
|
|
2216
|
-
|
|
2233
|
+
I,
|
|
2217
2234
|
{
|
|
2218
2235
|
component: "span",
|
|
2219
2236
|
sx: {
|
|
@@ -2229,14 +2246,14 @@ function zt({ value: e, sx: t }) {
|
|
|
2229
2246
|
}
|
|
2230
2247
|
);
|
|
2231
2248
|
}
|
|
2232
|
-
const
|
|
2249
|
+
const Zt = M(
|
|
2233
2250
|
({ store: e, useDegree: t }) => {
|
|
2234
|
-
const { t: o } =
|
|
2251
|
+
const { t: o } = P();
|
|
2235
2252
|
function i(n, r) {
|
|
2236
2253
|
return r ? `ω = ${o("Jogging.Cartesian.Rotation.velocityDegPerSec.lb", { amount: n })}` : `v = ${o("Jogging.Cartesian.Translation.velocityMmPerSec.lb", { amount: n })}`;
|
|
2237
2254
|
}
|
|
2238
2255
|
return /* @__PURE__ */ c(
|
|
2239
|
-
|
|
2256
|
+
vo,
|
|
2240
2257
|
{
|
|
2241
2258
|
store: e,
|
|
2242
2259
|
velocity: e.velocityInDisplayUnits(t),
|
|
@@ -2246,7 +2263,7 @@ const Ut = E(
|
|
|
2246
2263
|
useDegree: t,
|
|
2247
2264
|
disabled: e.isLocked,
|
|
2248
2265
|
renderValue: (n) => /* @__PURE__ */ c(
|
|
2249
|
-
|
|
2266
|
+
Qt,
|
|
2250
2267
|
{
|
|
2251
2268
|
value: i(n, t),
|
|
2252
2269
|
sx: {
|
|
@@ -2260,11 +2277,11 @@ const Ut = E(
|
|
|
2260
2277
|
}
|
|
2261
2278
|
);
|
|
2262
2279
|
}
|
|
2263
|
-
),
|
|
2264
|
-
var a, s,
|
|
2265
|
-
const { t } =
|
|
2280
|
+
), Xt = M(({ store: e }) => {
|
|
2281
|
+
var a, s, d;
|
|
2282
|
+
const { t } = P(), o = z(), i = ((d = (s = (a = e.jogger.motionStream.rapidlyChangingMotionState.execute) == null ? void 0 : a.details) == null ? void 0 : s.state) == null ? void 0 : d.kind) ?? "KIND_UNKNOWN", n = e.lastJogError, r = e.lastJogErrorTranslationKey;
|
|
2266
2283
|
return /* @__PURE__ */ y(
|
|
2267
|
-
|
|
2284
|
+
V,
|
|
2268
2285
|
{
|
|
2269
2286
|
sx: {
|
|
2270
2287
|
display: "flex",
|
|
@@ -2274,7 +2291,7 @@ const Ut = E(
|
|
|
2274
2291
|
},
|
|
2275
2292
|
children: [
|
|
2276
2293
|
/* @__PURE__ */ c(
|
|
2277
|
-
|
|
2294
|
+
I,
|
|
2278
2295
|
{
|
|
2279
2296
|
variant: "body2",
|
|
2280
2297
|
sx: {
|
|
@@ -2286,7 +2303,7 @@ const Ut = E(
|
|
|
2286
2303
|
}
|
|
2287
2304
|
),
|
|
2288
2305
|
/* @__PURE__ */ c(
|
|
2289
|
-
|
|
2306
|
+
I,
|
|
2290
2307
|
{
|
|
2291
2308
|
variant: "body2",
|
|
2292
2309
|
color: n ? "error" : void 0,
|
|
@@ -2303,35 +2320,35 @@ const Ut = E(
|
|
|
2303
2320
|
]
|
|
2304
2321
|
}
|
|
2305
2322
|
);
|
|
2306
|
-
}),
|
|
2323
|
+
}), Co = M(
|
|
2307
2324
|
({
|
|
2308
2325
|
store: e,
|
|
2309
2326
|
children: t
|
|
2310
2327
|
}) => {
|
|
2311
|
-
const { t: o } =
|
|
2312
|
-
function r(
|
|
2328
|
+
const { t: o } = P(), i = z(), n = st(0);
|
|
2329
|
+
function r(g, l) {
|
|
2313
2330
|
(l === "translate" || l === "rotate") && e.setSelectedCartesianMotionType(l);
|
|
2314
2331
|
}
|
|
2315
|
-
async function a(
|
|
2316
|
-
const f = await e.activate(), p = f.motionStream.rapidlyChangingMotionState.tcp_pose,
|
|
2332
|
+
async function a(g, l) {
|
|
2333
|
+
const f = await e.activate(), p = f.motionStream.rapidlyChangingMotionState.tcp_pose, v = f.motionStream.rapidlyChangingMotionState.joint_position;
|
|
2317
2334
|
p && await e.withMotionLock(async () => {
|
|
2318
2335
|
try {
|
|
2319
2336
|
e.setCurrentIncrementJog({
|
|
2320
|
-
axis:
|
|
2321
|
-
direction:
|
|
2337
|
+
axis: g.axis,
|
|
2338
|
+
direction: g.direction
|
|
2322
2339
|
}), await e.jogger.runIncrementalCartesianMotion({
|
|
2323
2340
|
currentTcpPose: p,
|
|
2324
|
-
currentJoints:
|
|
2341
|
+
currentJoints: v,
|
|
2325
2342
|
coordSystemId: e.activeCoordSystemId,
|
|
2326
2343
|
velocityInRelevantUnits: e.selectedCartesianMotionType === "translate" ? e.translationVelocityMmPerSec : e.rotationVelocityRadsPerSec,
|
|
2327
|
-
axis:
|
|
2328
|
-
direction:
|
|
2344
|
+
axis: g.axis,
|
|
2345
|
+
direction: g.direction,
|
|
2329
2346
|
motion: e.selectedCartesianMotionType === "translate" ? {
|
|
2330
2347
|
type: "translate",
|
|
2331
2348
|
distanceMm: l.mm
|
|
2332
2349
|
} : {
|
|
2333
2350
|
type: "rotate",
|
|
2334
|
-
distanceRads:
|
|
2351
|
+
distanceRads: he(l.degrees)
|
|
2335
2352
|
}
|
|
2336
2353
|
});
|
|
2337
2354
|
} finally {
|
|
@@ -2339,59 +2356,59 @@ const Ut = E(
|
|
|
2339
2356
|
}
|
|
2340
2357
|
});
|
|
2341
2358
|
}
|
|
2342
|
-
async function s(
|
|
2359
|
+
async function s(g) {
|
|
2343
2360
|
if (e.isLocked) return;
|
|
2344
2361
|
const l = ++n.current;
|
|
2345
2362
|
try {
|
|
2346
2363
|
if (await e.activate(), l !== n.current) return;
|
|
2347
2364
|
if (e.activeDiscreteIncrement)
|
|
2348
2365
|
return await a(
|
|
2349
|
-
|
|
2366
|
+
g,
|
|
2350
2367
|
e.activeDiscreteIncrement
|
|
2351
2368
|
);
|
|
2352
|
-
|
|
2353
|
-
axis:
|
|
2354
|
-
direction:
|
|
2369
|
+
g.motionType === "translate" ? await e.jogger.translateTCP({
|
|
2370
|
+
axis: g.axis,
|
|
2371
|
+
direction: g.direction,
|
|
2355
2372
|
velocityMmPerSec: e.translationVelocityMmPerSec
|
|
2356
2373
|
}) : await e.jogger.rotateTCP({
|
|
2357
|
-
axis:
|
|
2358
|
-
direction:
|
|
2374
|
+
axis: g.axis,
|
|
2375
|
+
direction: g.direction,
|
|
2359
2376
|
velocityRadsPerSec: e.rotationVelocityRadsPerSec
|
|
2360
2377
|
});
|
|
2361
2378
|
} catch (f) {
|
|
2362
2379
|
console.error("Jogging failed:", f);
|
|
2363
2380
|
}
|
|
2364
2381
|
}
|
|
2365
|
-
async function
|
|
2382
|
+
async function d() {
|
|
2366
2383
|
e.isLocked || e.activeDiscreteIncrement || (n.current++, await e.deactivate());
|
|
2367
2384
|
}
|
|
2368
|
-
const
|
|
2385
|
+
const u = [
|
|
2369
2386
|
{
|
|
2370
2387
|
id: "x",
|
|
2371
|
-
icon: /* @__PURE__ */ c(
|
|
2372
|
-
colors:
|
|
2388
|
+
icon: /* @__PURE__ */ c(Xe, {}),
|
|
2389
|
+
colors: lt.X
|
|
2373
2390
|
},
|
|
2374
2391
|
{
|
|
2375
2392
|
id: "y",
|
|
2376
|
-
icon: /* @__PURE__ */ c(
|
|
2377
|
-
colors:
|
|
2393
|
+
icon: /* @__PURE__ */ c(eo, {}),
|
|
2394
|
+
colors: lt.Y
|
|
2378
2395
|
},
|
|
2379
2396
|
{
|
|
2380
2397
|
id: "z",
|
|
2381
|
-
icon: /* @__PURE__ */ c(
|
|
2382
|
-
colors:
|
|
2398
|
+
icon: /* @__PURE__ */ c(io, {}),
|
|
2399
|
+
colors: lt.Z
|
|
2383
2400
|
}
|
|
2384
2401
|
];
|
|
2385
|
-
function g
|
|
2386
|
-
return o("General.mm.variable", { amount:
|
|
2402
|
+
function h(g) {
|
|
2403
|
+
return o("General.mm.variable", { amount: g.toFixed(1) });
|
|
2387
2404
|
}
|
|
2388
|
-
function
|
|
2405
|
+
function m(g) {
|
|
2389
2406
|
return o("General.degree.variable", {
|
|
2390
|
-
amount:
|
|
2407
|
+
amount: At(g).toFixed(1)
|
|
2391
2408
|
});
|
|
2392
2409
|
}
|
|
2393
2410
|
return /* @__PURE__ */ y(
|
|
2394
|
-
|
|
2411
|
+
_,
|
|
2395
2412
|
{
|
|
2396
2413
|
"data-testid": "jogging-cartesian-tab",
|
|
2397
2414
|
"aria-label": "jogging-cartesian-tab",
|
|
@@ -2399,25 +2416,25 @@ const Ut = E(
|
|
|
2399
2416
|
gap: 2,
|
|
2400
2417
|
sx: { padding: "18px 24px" },
|
|
2401
2418
|
children: [
|
|
2402
|
-
/* @__PURE__ */ y(
|
|
2419
|
+
/* @__PURE__ */ y(_, { gap: 2, children: [
|
|
2403
2420
|
/* @__PURE__ */ c(
|
|
2404
|
-
|
|
2421
|
+
So,
|
|
2405
2422
|
{
|
|
2406
2423
|
store: e,
|
|
2407
2424
|
useDegree: e.selectedCartesianMotionType === "rotate"
|
|
2408
2425
|
}
|
|
2409
2426
|
),
|
|
2410
2427
|
/* @__PURE__ */ c(
|
|
2411
|
-
|
|
2428
|
+
Zt,
|
|
2412
2429
|
{
|
|
2413
2430
|
store: e,
|
|
2414
2431
|
useDegree: e.selectedCartesianMotionType === "rotate"
|
|
2415
2432
|
}
|
|
2416
2433
|
),
|
|
2417
|
-
/* @__PURE__ */ c(
|
|
2434
|
+
/* @__PURE__ */ c(F, {})
|
|
2418
2435
|
] }),
|
|
2419
2436
|
/* @__PURE__ */ c(
|
|
2420
|
-
|
|
2437
|
+
_,
|
|
2421
2438
|
{
|
|
2422
2439
|
marginLeft: "auto",
|
|
2423
2440
|
marginRight: "auto",
|
|
@@ -2425,7 +2442,7 @@ const Ut = E(
|
|
|
2425
2442
|
justifyContent: "center",
|
|
2426
2443
|
sx: { flexGrow: "1" },
|
|
2427
2444
|
children: /* @__PURE__ */ y(
|
|
2428
|
-
|
|
2445
|
+
_,
|
|
2429
2446
|
{
|
|
2430
2447
|
alignItems: "center",
|
|
2431
2448
|
justifyContent: "center",
|
|
@@ -2433,7 +2450,7 @@ const Ut = E(
|
|
|
2433
2450
|
sx: { flexGrow: 1 },
|
|
2434
2451
|
children: [
|
|
2435
2452
|
/* @__PURE__ */ y(
|
|
2436
|
-
|
|
2453
|
+
bo,
|
|
2437
2454
|
{
|
|
2438
2455
|
value: e.selectedCartesianMotionType,
|
|
2439
2456
|
onChange: r,
|
|
@@ -2441,87 +2458,87 @@ const Ut = E(
|
|
|
2441
2458
|
"aria-label": o("Jogging.Cartesian.MotionType.lb"),
|
|
2442
2459
|
sx: { justifyContent: "center" },
|
|
2443
2460
|
children: [
|
|
2444
|
-
/* @__PURE__ */ c(
|
|
2445
|
-
/* @__PURE__ */ c(
|
|
2461
|
+
/* @__PURE__ */ c(Ct, { value: "translate", children: o("Jogging.Cartesian.Translation.bt") }),
|
|
2462
|
+
/* @__PURE__ */ c(Ct, { value: "rotate", children: o("Jogging.Cartesian.Rotation.bt") })
|
|
2446
2463
|
]
|
|
2447
2464
|
}
|
|
2448
2465
|
),
|
|
2449
|
-
e.selectedCartesianMotionType === "translate" &&
|
|
2466
|
+
e.selectedCartesianMotionType === "translate" && u.map((g) => {
|
|
2450
2467
|
var l, f;
|
|
2451
2468
|
return /* @__PURE__ */ c(
|
|
2452
|
-
|
|
2469
|
+
xt,
|
|
2453
2470
|
{
|
|
2454
|
-
"data-testid": `jogging-cartesian-axis-control-${
|
|
2455
|
-
"aria-label": `jogging-cartesian-axis-control-${
|
|
2456
|
-
colors:
|
|
2471
|
+
"data-testid": `jogging-cartesian-axis-control-${g.id}`,
|
|
2472
|
+
"aria-label": `jogging-cartesian-axis-control-${g.id}`,
|
|
2473
|
+
colors: g.colors,
|
|
2457
2474
|
disabled: e.isLocked,
|
|
2458
|
-
activeJoggingDirection: ((l = e.incrementJogInProgress) == null ? void 0 : l.axis) ===
|
|
2459
|
-
label: /* @__PURE__ */ y(
|
|
2460
|
-
|
|
2475
|
+
activeJoggingDirection: ((l = e.incrementJogInProgress) == null ? void 0 : l.axis) === g.id ? e.incrementJogInProgress.direction : void 0,
|
|
2476
|
+
label: /* @__PURE__ */ y(tt, { children: [
|
|
2477
|
+
g.icon,
|
|
2461
2478
|
/* @__PURE__ */ c(
|
|
2462
|
-
|
|
2479
|
+
I,
|
|
2463
2480
|
{
|
|
2464
2481
|
sx: {
|
|
2465
2482
|
fontSize: "24px",
|
|
2466
|
-
color: ((f =
|
|
2483
|
+
color: ((f = g.colors) == null ? void 0 : f.labelColor) ?? i.palette.text.primary
|
|
2467
2484
|
},
|
|
2468
|
-
children:
|
|
2485
|
+
children: g.id.toUpperCase()
|
|
2469
2486
|
}
|
|
2470
2487
|
)
|
|
2471
2488
|
] }),
|
|
2472
2489
|
getDisplayedValue: () => {
|
|
2473
|
-
var p,
|
|
2474
|
-
return
|
|
2475
|
-
((
|
|
2490
|
+
var p, v;
|
|
2491
|
+
return h(
|
|
2492
|
+
((v = (p = e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose) == null ? void 0 : p.position) == null ? void 0 : v[St[g.id]]) || 0
|
|
2476
2493
|
);
|
|
2477
2494
|
},
|
|
2478
2495
|
startJogging: (p) => s({
|
|
2479
|
-
axis:
|
|
2496
|
+
axis: g.id,
|
|
2480
2497
|
motionType: "translate",
|
|
2481
2498
|
direction: p
|
|
2482
2499
|
}),
|
|
2483
|
-
stopJogging:
|
|
2500
|
+
stopJogging: d
|
|
2484
2501
|
},
|
|
2485
|
-
|
|
2502
|
+
g.id
|
|
2486
2503
|
);
|
|
2487
2504
|
}),
|
|
2488
|
-
e.selectedCartesianMotionType === "rotate" &&
|
|
2505
|
+
e.selectedCartesianMotionType === "rotate" && u.map((g) => {
|
|
2489
2506
|
var l, f;
|
|
2490
2507
|
return /* @__PURE__ */ c(
|
|
2491
|
-
|
|
2508
|
+
xt,
|
|
2492
2509
|
{
|
|
2493
|
-
"data-testid": `jogging-cartesian-axis-control-${
|
|
2494
|
-
"aria-label": `jogging-cartesian-axis-control-${
|
|
2495
|
-
colors:
|
|
2510
|
+
"data-testid": `jogging-cartesian-axis-control-${g.id}`,
|
|
2511
|
+
"aria-label": `jogging-cartesian-axis-control-${g.id}`,
|
|
2512
|
+
colors: g.colors,
|
|
2496
2513
|
disabled: e.isLocked,
|
|
2497
|
-
activeJoggingDirection: ((l = e.incrementJogInProgress) == null ? void 0 : l.axis) ===
|
|
2498
|
-
label: /* @__PURE__ */ y(
|
|
2499
|
-
/* @__PURE__ */ c(
|
|
2514
|
+
activeJoggingDirection: ((l = e.incrementJogInProgress) == null ? void 0 : l.axis) === g.id ? e.incrementJogInProgress.direction : void 0,
|
|
2515
|
+
label: /* @__PURE__ */ y(tt, { children: [
|
|
2516
|
+
/* @__PURE__ */ c(ro, {}),
|
|
2500
2517
|
/* @__PURE__ */ c(
|
|
2501
|
-
|
|
2518
|
+
I,
|
|
2502
2519
|
{
|
|
2503
2520
|
sx: {
|
|
2504
2521
|
fontSize: "24px",
|
|
2505
|
-
color: ((f =
|
|
2522
|
+
color: ((f = g.colors) == null ? void 0 : f.labelColor) ?? i.palette.text.primary
|
|
2506
2523
|
},
|
|
2507
|
-
children:
|
|
2524
|
+
children: g.id.toUpperCase()
|
|
2508
2525
|
}
|
|
2509
2526
|
)
|
|
2510
2527
|
] }),
|
|
2511
2528
|
getDisplayedValue: () => {
|
|
2512
|
-
var p,
|
|
2513
|
-
return
|
|
2514
|
-
((
|
|
2529
|
+
var p, v;
|
|
2530
|
+
return m(
|
|
2531
|
+
((v = (p = e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose) == null ? void 0 : p.orientation) == null ? void 0 : v[St[g.id]]) || 0
|
|
2515
2532
|
);
|
|
2516
2533
|
},
|
|
2517
2534
|
startJogging: (p) => s({
|
|
2518
|
-
axis:
|
|
2535
|
+
axis: g.id,
|
|
2519
2536
|
motionType: "rotate",
|
|
2520
2537
|
direction: p
|
|
2521
2538
|
}),
|
|
2522
|
-
stopJogging:
|
|
2539
|
+
stopJogging: d
|
|
2523
2540
|
},
|
|
2524
|
-
|
|
2541
|
+
g.id
|
|
2525
2542
|
);
|
|
2526
2543
|
})
|
|
2527
2544
|
]
|
|
@@ -2529,18 +2546,18 @@ const Ut = E(
|
|
|
2529
2546
|
)
|
|
2530
2547
|
}
|
|
2531
2548
|
),
|
|
2532
|
-
/* @__PURE__ */ c(
|
|
2533
|
-
/* @__PURE__ */ c(
|
|
2534
|
-
/* @__PURE__ */ c(
|
|
2535
|
-
t && /* @__PURE__ */ c(
|
|
2549
|
+
/* @__PURE__ */ c(Wt, { store: e }),
|
|
2550
|
+
/* @__PURE__ */ c(F, {}),
|
|
2551
|
+
/* @__PURE__ */ c(Xt, { store: e }),
|
|
2552
|
+
t && /* @__PURE__ */ c(F, {}),
|
|
2536
2553
|
t
|
|
2537
2554
|
]
|
|
2538
2555
|
}
|
|
2539
2556
|
);
|
|
2540
2557
|
}
|
|
2541
|
-
),
|
|
2558
|
+
), _o = M(
|
|
2542
2559
|
({ store: e, children: t }) => {
|
|
2543
|
-
const o =
|
|
2560
|
+
const o = z(), i = st(0);
|
|
2544
2561
|
async function n(a) {
|
|
2545
2562
|
const s = ++i.current;
|
|
2546
2563
|
try {
|
|
@@ -2548,18 +2565,18 @@ const Ut = E(
|
|
|
2548
2565
|
await e.jogger.rotateJoints({
|
|
2549
2566
|
joint: a.joint,
|
|
2550
2567
|
direction: a.direction,
|
|
2551
|
-
velocityUnit: e.jointType ===
|
|
2552
|
-
velocityValue: e.jointType ===
|
|
2568
|
+
velocityUnit: e.jointType === D.PrismaticJoint ? "mm/s" : "rad/s",
|
|
2569
|
+
velocityValue: e.jointType === D.PrismaticJoint ? e.translationVelocityMmPerSec : e.rotationVelocityRadsPerSec
|
|
2553
2570
|
});
|
|
2554
|
-
} catch (
|
|
2555
|
-
console.error("Jogging failed:",
|
|
2571
|
+
} catch (d) {
|
|
2572
|
+
console.error("Jogging failed:", d);
|
|
2556
2573
|
}
|
|
2557
2574
|
}
|
|
2558
2575
|
async function r() {
|
|
2559
2576
|
i.current++, await e.jogger.stop(), await e.deactivate();
|
|
2560
2577
|
}
|
|
2561
2578
|
return /* @__PURE__ */ y(
|
|
2562
|
-
|
|
2579
|
+
_,
|
|
2563
2580
|
{
|
|
2564
2581
|
"data-testid": "jogging-joint-tab",
|
|
2565
2582
|
"aria-label": "jogging-joint-tab",
|
|
@@ -2568,31 +2585,31 @@ const Ut = E(
|
|
|
2568
2585
|
sx: { padding: "18px 24px" },
|
|
2569
2586
|
children: [
|
|
2570
2587
|
/* @__PURE__ */ c(
|
|
2571
|
-
|
|
2588
|
+
Zt,
|
|
2572
2589
|
{
|
|
2573
2590
|
store: e,
|
|
2574
|
-
useDegree: e.jointType ===
|
|
2591
|
+
useDegree: e.jointType === D.RevoluteJoint
|
|
2575
2592
|
}
|
|
2576
2593
|
),
|
|
2577
|
-
/* @__PURE__ */ c(
|
|
2594
|
+
/* @__PURE__ */ c(F, {}),
|
|
2578
2595
|
/* @__PURE__ */ c(
|
|
2579
|
-
|
|
2596
|
+
_,
|
|
2580
2597
|
{
|
|
2581
2598
|
justifyContent: "center",
|
|
2582
2599
|
alignItems: "stretch",
|
|
2583
2600
|
sx: { flexGrow: "1" },
|
|
2584
2601
|
children: /* @__PURE__ */ c(
|
|
2585
|
-
|
|
2602
|
+
_,
|
|
2586
2603
|
{
|
|
2587
2604
|
"data-testid": "jogging-joint-value-controls-wrapper",
|
|
2588
2605
|
"aria-label": "jogging-joint-value-controls-wrapper",
|
|
2589
2606
|
alignItems: "center",
|
|
2590
2607
|
gap: "24px",
|
|
2591
2608
|
children: e.jogger.motionStream.joints.map((a) => {
|
|
2592
|
-
var
|
|
2593
|
-
const s = (
|
|
2609
|
+
var d, u, h;
|
|
2610
|
+
const s = (h = (u = (d = e.motionGroupDescription.operation_limits.auto_limits) == null ? void 0 : d.joints) == null ? void 0 : u[a.index]) == null ? void 0 : h.position;
|
|
2594
2611
|
return /* @__PURE__ */ y(
|
|
2595
|
-
|
|
2612
|
+
_,
|
|
2596
2613
|
{
|
|
2597
2614
|
"data-testid": `jogging-joint-value-control-${a.index}`,
|
|
2598
2615
|
"aria-label": `jogging-joint-value-control-${a.index}`,
|
|
@@ -2603,26 +2620,26 @@ const Ut = E(
|
|
|
2603
2620
|
width: "100%",
|
|
2604
2621
|
children: [
|
|
2605
2622
|
e.showJointsLegend && /* @__PURE__ */ c(
|
|
2606
|
-
|
|
2623
|
+
I,
|
|
2607
2624
|
{
|
|
2608
2625
|
color: e.isLocked ? o.palette.text.disabled : o.palette.text.secondary,
|
|
2609
2626
|
children: `G${a.index + 1}`
|
|
2610
2627
|
}
|
|
2611
2628
|
),
|
|
2612
2629
|
/* @__PURE__ */ c(
|
|
2613
|
-
|
|
2630
|
+
Be,
|
|
2614
2631
|
{
|
|
2615
2632
|
disabled: e.isLocked,
|
|
2616
2633
|
lowerLimit: s == null ? void 0 : s.lower_limit,
|
|
2617
2634
|
upperLimit: s == null ? void 0 : s.upper_limit,
|
|
2618
|
-
useDegree: e.jointType ===
|
|
2635
|
+
useDegree: e.jointType === D.RevoluteJoint,
|
|
2619
2636
|
getValue: () => {
|
|
2620
|
-
const
|
|
2621
|
-
return
|
|
2637
|
+
const m = e.jogger.motionStream.rapidlyChangingMotionState.joint_position[a.index];
|
|
2638
|
+
return m !== void 0 ? m : void 0;
|
|
2622
2639
|
},
|
|
2623
|
-
startJogging: (
|
|
2640
|
+
startJogging: (m) => n({
|
|
2624
2641
|
joint: a.index,
|
|
2625
|
-
direction:
|
|
2642
|
+
direction: m
|
|
2626
2643
|
}),
|
|
2627
2644
|
stopJogging: r
|
|
2628
2645
|
}
|
|
@@ -2636,22 +2653,22 @@ const Ut = E(
|
|
|
2636
2653
|
)
|
|
2637
2654
|
}
|
|
2638
2655
|
),
|
|
2639
|
-
/* @__PURE__ */ c(
|
|
2640
|
-
/* @__PURE__ */ c(
|
|
2641
|
-
/* @__PURE__ */ c(
|
|
2642
|
-
t && /* @__PURE__ */ c(
|
|
2656
|
+
/* @__PURE__ */ c(Wt, { store: e }),
|
|
2657
|
+
/* @__PURE__ */ c(F, {}),
|
|
2658
|
+
/* @__PURE__ */ c(Xt, { store: e }),
|
|
2659
|
+
t && /* @__PURE__ */ c(F, {}),
|
|
2643
2660
|
t
|
|
2644
2661
|
]
|
|
2645
2662
|
}
|
|
2646
2663
|
);
|
|
2647
2664
|
}
|
|
2648
|
-
),
|
|
2649
|
-
|
|
2650
|
-
const t =
|
|
2665
|
+
), Ai = Q(
|
|
2666
|
+
M((e) => {
|
|
2667
|
+
const t = Rt(() => ({
|
|
2651
2668
|
joggingStore: null,
|
|
2652
2669
|
loadingError: null
|
|
2653
2670
|
}));
|
|
2654
|
-
return
|
|
2671
|
+
return et(() => {
|
|
2655
2672
|
let o = !1, i;
|
|
2656
2673
|
async function n() {
|
|
2657
2674
|
S(() => {
|
|
@@ -2672,7 +2689,7 @@ const Ut = E(
|
|
|
2672
2689
|
return;
|
|
2673
2690
|
}
|
|
2674
2691
|
try {
|
|
2675
|
-
r = await
|
|
2692
|
+
r = await at.loadFor(a);
|
|
2676
2693
|
} catch (s) {
|
|
2677
2694
|
throw a.dispose(), s;
|
|
2678
2695
|
}
|
|
@@ -2694,11 +2711,11 @@ const Ut = E(
|
|
|
2694
2711
|
return n(), () => {
|
|
2695
2712
|
o = !0, i == null || i.dispose();
|
|
2696
2713
|
};
|
|
2697
|
-
}, [e.store, e.nova, e.motionGroupId, e.cellId]),
|
|
2714
|
+
}, [e.store, e.nova, e.motionGroupId, e.cellId]), et(() => {
|
|
2698
2715
|
const o = t.joggingStore;
|
|
2699
2716
|
o && (e.locked ? o.lock("external") : o.unlock("external"));
|
|
2700
2717
|
}, [t.joggingStore, e.locked]), /* @__PURE__ */ c(
|
|
2701
|
-
|
|
2718
|
+
_,
|
|
2702
2719
|
{
|
|
2703
2720
|
"data-testid": "jogging-panel",
|
|
2704
2721
|
"aria-label": "jogging-panel",
|
|
@@ -2708,25 +2725,25 @@ const Ut = E(
|
|
|
2708
2725
|
position: "relative",
|
|
2709
2726
|
...e.sx
|
|
2710
2727
|
},
|
|
2711
|
-
children: t.joggingStore ? /* @__PURE__ */ c(
|
|
2728
|
+
children: t.joggingStore ? /* @__PURE__ */ c(xo, { store: t.joggingStore, children: e.children }) : /* @__PURE__ */ c(Ke, { message: "Loading jogging", error: t.loadingError })
|
|
2712
2729
|
}
|
|
2713
2730
|
);
|
|
2714
2731
|
})
|
|
2715
|
-
),
|
|
2732
|
+
), xo = M(
|
|
2716
2733
|
({
|
|
2717
2734
|
store: e,
|
|
2718
2735
|
children: t
|
|
2719
2736
|
}) => {
|
|
2720
|
-
const { t: o } =
|
|
2737
|
+
const { t: o } = P();
|
|
2721
2738
|
function i() {
|
|
2722
2739
|
if (e.currentTab.id === "cartesian")
|
|
2723
|
-
return /* @__PURE__ */ c(
|
|
2740
|
+
return /* @__PURE__ */ c(Co, { store: e, children: t });
|
|
2724
2741
|
if (e.currentTab.id === "joint")
|
|
2725
|
-
return /* @__PURE__ */ c(
|
|
2742
|
+
return /* @__PURE__ */ c(_o, { store: e, children: t });
|
|
2726
2743
|
}
|
|
2727
|
-
return /* @__PURE__ */ y(
|
|
2744
|
+
return /* @__PURE__ */ y(_, { flexGrow: 1, sx: { overflow: "hidden" }, children: [
|
|
2728
2745
|
/* @__PURE__ */ c(
|
|
2729
|
-
|
|
2746
|
+
de,
|
|
2730
2747
|
{
|
|
2731
2748
|
"data-testid": "jogging-tabs",
|
|
2732
2749
|
"aria-label": "jogging-tabs",
|
|
@@ -2734,13 +2751,13 @@ const Ut = E(
|
|
|
2734
2751
|
onChange: e.onTabChange,
|
|
2735
2752
|
variant: "fullWidth",
|
|
2736
2753
|
children: e.tabs.map((n) => {
|
|
2737
|
-
const r = n.label === "Cartesian" ? o("Jogging.Cartesian.bt") : o("Jogging.Joints.bt"), a = n.label === "cartesian" ? /* @__PURE__ */ c(
|
|
2754
|
+
const r = n.label === "Cartesian" ? o("Jogging.Cartesian.bt") : o("Jogging.Joints.bt"), a = n.label === "cartesian" ? /* @__PURE__ */ c(se, { fontSize: "small", sx: { mr: 1 } }) : /* @__PURE__ */ c(le, { fontSize: "small", sx: { mr: 1 } });
|
|
2738
2755
|
return /* @__PURE__ */ c(
|
|
2739
|
-
|
|
2756
|
+
ce,
|
|
2740
2757
|
{
|
|
2741
2758
|
"data-testid": `jogging-tab-${n.id}`,
|
|
2742
2759
|
"aria-label": `jogging-tab-${n.id}`,
|
|
2743
|
-
label: e.showTabIcons ? /* @__PURE__ */ y(
|
|
2760
|
+
label: e.showTabIcons ? /* @__PURE__ */ y(_, { direction: "row", alignItems: "center", children: [
|
|
2744
2761
|
a,
|
|
2745
2762
|
r
|
|
2746
2763
|
] }) : r,
|
|
@@ -2753,7 +2770,7 @@ const Ut = E(
|
|
|
2753
2770
|
}
|
|
2754
2771
|
),
|
|
2755
2772
|
/* @__PURE__ */ c(
|
|
2756
|
-
|
|
2773
|
+
_,
|
|
2757
2774
|
{
|
|
2758
2775
|
flexGrow: 1,
|
|
2759
2776
|
position: "relative",
|
|
@@ -2761,23 +2778,23 @@ const Ut = E(
|
|
|
2761
2778
|
children: i()
|
|
2762
2779
|
}
|
|
2763
2780
|
),
|
|
2764
|
-
e.blocked && /* @__PURE__ */ c(
|
|
2781
|
+
e.blocked && /* @__PURE__ */ c(Qe, { store: e })
|
|
2765
2782
|
] });
|
|
2766
2783
|
}
|
|
2767
2784
|
);
|
|
2768
|
-
function
|
|
2785
|
+
function Io() {
|
|
2769
2786
|
const e = window.location.href;
|
|
2770
2787
|
return e.substring(
|
|
2771
2788
|
0,
|
|
2772
2789
|
e.indexOf("/", e.indexOf("//") + 2)
|
|
2773
2790
|
);
|
|
2774
2791
|
}
|
|
2775
|
-
function
|
|
2776
|
-
baseUrl: e =
|
|
2792
|
+
function Pi({
|
|
2793
|
+
baseUrl: e = Io(),
|
|
2777
2794
|
...t
|
|
2778
2795
|
}) {
|
|
2779
2796
|
return /* @__PURE__ */ y(
|
|
2780
|
-
|
|
2797
|
+
Je,
|
|
2781
2798
|
{
|
|
2782
2799
|
"aria-labelledby": "no-motion-group-modal-title",
|
|
2783
2800
|
open: !0,
|
|
@@ -2797,9 +2814,9 @@ function Ii({
|
|
|
2797
2814
|
}
|
|
2798
2815
|
},
|
|
2799
2816
|
children: [
|
|
2800
|
-
/* @__PURE__ */ c(
|
|
2817
|
+
/* @__PURE__ */ c(Le, { id: "no-motion-group-modal-title", children: "No motion group found" }),
|
|
2801
2818
|
/* @__PURE__ */ y(
|
|
2802
|
-
|
|
2819
|
+
Pe,
|
|
2803
2820
|
{
|
|
2804
2821
|
sx: {
|
|
2805
2822
|
marginTop: "3rem",
|
|
@@ -2807,12 +2824,12 @@ function Ii({
|
|
|
2807
2824
|
textAlign: "center"
|
|
2808
2825
|
},
|
|
2809
2826
|
children: [
|
|
2810
|
-
/* @__PURE__ */ c(
|
|
2811
|
-
/* @__PURE__ */ c(
|
|
2827
|
+
/* @__PURE__ */ c(I, { color: "#fff", children: "Found no devices to connect to." }),
|
|
2828
|
+
/* @__PURE__ */ c(I, { color: "#fff", children: "Please ensure a motion group has been created." })
|
|
2812
2829
|
]
|
|
2813
2830
|
}
|
|
2814
2831
|
),
|
|
2815
|
-
/* @__PURE__ */ c(
|
|
2832
|
+
/* @__PURE__ */ c(Ae, { children: /* @__PURE__ */ y(_, { width: "100%", maxWidth: "300px", margin: "auto", marginBottom: "2rem", children: [
|
|
2816
2833
|
/* @__PURE__ */ c(
|
|
2817
2834
|
ct,
|
|
2818
2835
|
{
|
|
@@ -2844,7 +2861,7 @@ function Ii({
|
|
|
2844
2861
|
}
|
|
2845
2862
|
);
|
|
2846
2863
|
}
|
|
2847
|
-
const
|
|
2864
|
+
const Tt = 1e-4, wo = {
|
|
2848
2865
|
a: 0,
|
|
2849
2866
|
d: 0,
|
|
2850
2867
|
alpha: 0,
|
|
@@ -2852,30 +2869,30 @@ const Mt = 1e-4, Co = {
|
|
|
2852
2869
|
reverse_rotation_direction: !1
|
|
2853
2870
|
};
|
|
2854
2871
|
class ht {
|
|
2855
|
-
constructor(t, o, i, n, r, a, s,
|
|
2856
|
-
this.controller = o, this.motionGroup = i, this.initialMotionState = n, this.motionStateSocket = r, this.isVirtual = a, this.tcps = s, this.description =
|
|
2872
|
+
constructor(t, o, i, n, r, a, s, d, u, h, m = "cell") {
|
|
2873
|
+
this.controller = o, this.motionGroup = i, this.initialMotionState = n, this.motionStateSocket = r, this.isVirtual = a, this.tcps = s, this.description = d, this.initialControllerState = u, this.controllerStateSocket = h, this.cellId = m, this.connectedJoggingSocket = null, this.joggingVelocity = 10, this.activationState = "inactive", this.nova = N(t), this.rapidlyChangingMotionState = n, this.controllerState = u, h.addEventListener("message", (g) => {
|
|
2857
2874
|
var f;
|
|
2858
|
-
const l = (f =
|
|
2875
|
+
const l = (f = R(g.data)) == null ? void 0 : f.result;
|
|
2859
2876
|
l && S(() => {
|
|
2860
2877
|
this.controllerState = l;
|
|
2861
2878
|
});
|
|
2862
|
-
}), r.addEventListener("message", (
|
|
2879
|
+
}), r.addEventListener("message", (g) => {
|
|
2863
2880
|
var f;
|
|
2864
|
-
const l = (f =
|
|
2881
|
+
const l = (f = R(g.data)) == null ? void 0 : f.result;
|
|
2865
2882
|
if (!l)
|
|
2866
2883
|
throw new Error(
|
|
2867
|
-
`Failed to get motion state for ${this.motionGroupId}: ${
|
|
2884
|
+
`Failed to get motion state for ${this.motionGroupId}: ${g.data}`
|
|
2868
2885
|
);
|
|
2869
|
-
|
|
2886
|
+
Nt(
|
|
2870
2887
|
this.rapidlyChangingMotionState.joint_position,
|
|
2871
2888
|
l.joint_position,
|
|
2872
|
-
|
|
2889
|
+
Tt
|
|
2873
2890
|
) || S(() => {
|
|
2874
2891
|
this.rapidlyChangingMotionState.joint_position = l.joint_position;
|
|
2875
|
-
}),
|
|
2892
|
+
}), Bt(
|
|
2876
2893
|
this.rapidlyChangingMotionState,
|
|
2877
2894
|
l,
|
|
2878
|
-
|
|
2895
|
+
Tt
|
|
2879
2896
|
) || S(() => {
|
|
2880
2897
|
this.rapidlyChangingMotionState.tcp_pose = l.tcp_pose;
|
|
2881
2898
|
}), l.tcp !== void 0 && this.rapidlyChangingMotionState.tcp !== l.tcp && S(() => {
|
|
@@ -2883,10 +2900,10 @@ class ht {
|
|
|
2883
2900
|
}), this.rapidlyChangingMotionState.standstill !== l.standstill && S(() => {
|
|
2884
2901
|
this.rapidlyChangingMotionState.standstill = l.standstill;
|
|
2885
2902
|
});
|
|
2886
|
-
}),
|
|
2903
|
+
}), Z(this);
|
|
2887
2904
|
}
|
|
2888
2905
|
static async connectMultiple(t, o, i = {}) {
|
|
2889
|
-
const n =
|
|
2906
|
+
const n = N(t), r = i.cellId ?? it(t);
|
|
2890
2907
|
return Promise.all(
|
|
2891
2908
|
o.map(
|
|
2892
2909
|
(a) => ht.connect(n, a, {
|
|
@@ -2898,64 +2915,64 @@ class ht {
|
|
|
2898
2915
|
}
|
|
2899
2916
|
static async connect(t, o, i = {}) {
|
|
2900
2917
|
var T, k;
|
|
2901
|
-
const n =
|
|
2918
|
+
const n = N(t), r = i.cellId ?? it(t) ?? "cell", [a, s] = o.split("@"), d = await n.api.controller.getCurrentRobotControllerState(
|
|
2902
2919
|
r,
|
|
2903
2920
|
s
|
|
2904
|
-
),
|
|
2905
|
-
(
|
|
2921
|
+
), u = d == null ? void 0 : d.motion_groups.find(
|
|
2922
|
+
(x) => x.motion_group === o
|
|
2906
2923
|
);
|
|
2907
|
-
if (!
|
|
2924
|
+
if (!d || !u)
|
|
2908
2925
|
throw new Error(
|
|
2909
2926
|
`Controller ${s} or motion group ${o} not found`
|
|
2910
2927
|
);
|
|
2911
|
-
const
|
|
2928
|
+
const h = n.openReconnectingWebsocket(
|
|
2912
2929
|
`/cells/${r}/controllers/${s}/motion-groups/${o}/state-stream`
|
|
2913
|
-
),
|
|
2914
|
-
if (!
|
|
2930
|
+
), m = await h.firstMessage(), g = (T = R(m.data)) == null ? void 0 : T.result;
|
|
2931
|
+
if (!g)
|
|
2915
2932
|
throw new Error(
|
|
2916
|
-
`Unable to parse initial motion state message ${
|
|
2933
|
+
`Unable to parse initial motion state message ${m.data}`
|
|
2917
2934
|
);
|
|
2918
2935
|
console.log(
|
|
2919
|
-
`Connected motion state websocket to motion group ${
|
|
2936
|
+
`Connected motion state websocket to motion group ${u.motion_group}. Initial state:
|
|
2920
2937
|
`,
|
|
2921
|
-
|
|
2938
|
+
g
|
|
2922
2939
|
);
|
|
2923
2940
|
const f = (await n.api.controller.getRobotController(
|
|
2924
2941
|
r,
|
|
2925
|
-
|
|
2942
|
+
d.controller
|
|
2926
2943
|
)).configuration.kind === "VirtualController", p = await n.api.motionGroup.getMotionGroupDescription(
|
|
2927
2944
|
r,
|
|
2928
2945
|
s,
|
|
2929
|
-
|
|
2930
|
-
),
|
|
2931
|
-
([
|
|
2932
|
-
id:
|
|
2933
|
-
readable_name:
|
|
2934
|
-
position:
|
|
2935
|
-
orientation:
|
|
2946
|
+
u.motion_group
|
|
2947
|
+
), v = Object.entries(p.tcps || {}).map(
|
|
2948
|
+
([x, O]) => ({
|
|
2949
|
+
id: x,
|
|
2950
|
+
readable_name: O.name,
|
|
2951
|
+
position: O.pose.position,
|
|
2952
|
+
orientation: O.pose.orientation
|
|
2936
2953
|
})
|
|
2937
|
-
),
|
|
2938
|
-
`/cells/${r}/controllers/${
|
|
2939
|
-
),
|
|
2940
|
-
if (!
|
|
2954
|
+
), j = n.openReconnectingWebsocket(
|
|
2955
|
+
`/cells/${r}/controllers/${d.controller}/state-stream?response_rate=1000`
|
|
2956
|
+
), w = await j.firstMessage(), E = (k = R(w.data)) == null ? void 0 : k.result;
|
|
2957
|
+
if (!E)
|
|
2941
2958
|
throw new Error(
|
|
2942
|
-
`Unable to parse initial controller state message ${
|
|
2959
|
+
`Unable to parse initial controller state message ${w.data}`
|
|
2943
2960
|
);
|
|
2944
2961
|
return console.log(
|
|
2945
|
-
`Connected controller state websocket to controller ${
|
|
2962
|
+
`Connected controller state websocket to controller ${d.controller}. Initial state:
|
|
2946
2963
|
`,
|
|
2947
|
-
|
|
2964
|
+
E
|
|
2948
2965
|
), new ht(
|
|
2949
2966
|
n,
|
|
2950
|
-
h,
|
|
2951
|
-
m,
|
|
2952
2967
|
d,
|
|
2968
|
+
u,
|
|
2953
2969
|
g,
|
|
2970
|
+
h,
|
|
2954
2971
|
f,
|
|
2955
|
-
|
|
2972
|
+
v,
|
|
2956
2973
|
p,
|
|
2957
|
-
|
|
2958
|
-
|
|
2974
|
+
E,
|
|
2975
|
+
j,
|
|
2959
2976
|
r
|
|
2960
2977
|
);
|
|
2961
2978
|
}
|
|
@@ -2981,7 +2998,7 @@ class ht {
|
|
|
2981
2998
|
get dhParameters() {
|
|
2982
2999
|
if (this.description.dh_parameters !== void 0)
|
|
2983
3000
|
return this.description.dh_parameters.map((t) => ({
|
|
2984
|
-
...
|
|
3001
|
+
...wo,
|
|
2985
3002
|
...t
|
|
2986
3003
|
}));
|
|
2987
3004
|
}
|
|
@@ -2999,11 +3016,11 @@ class ht {
|
|
|
2999
3016
|
}
|
|
3000
3017
|
/** Gets the robot mounting position rotation in 3D viz coordinates */
|
|
3001
3018
|
get mountingQuaternion() {
|
|
3002
|
-
var n, r, a, s,
|
|
3019
|
+
var n, r, a, s, d, u;
|
|
3003
3020
|
const t = new bt.Vector3(
|
|
3004
3021
|
((r = (n = this.description.mounting) == null ? void 0 : n.orientation) == null ? void 0 : r[0]) || 0,
|
|
3005
3022
|
((s = (a = this.description.mounting) == null ? void 0 : a.orientation) == null ? void 0 : s[1]) || 0,
|
|
3006
|
-
((
|
|
3023
|
+
((u = (d = this.description.mounting) == null ? void 0 : d.orientation) == null ? void 0 : u[2]) || 0
|
|
3007
3024
|
), o = t.length(), i = t.normalize();
|
|
3008
3025
|
return new bt.Quaternion().setFromAxisAngle(i, o);
|
|
3009
3026
|
}
|
|
@@ -3099,23 +3116,246 @@ class ht {
|
|
|
3099
3116
|
this.joggingVelocity = t;
|
|
3100
3117
|
}
|
|
3101
3118
|
}
|
|
3102
|
-
const
|
|
3119
|
+
const jo = 1e-4, Mo = /* @__PURE__ */ new Set([
|
|
3120
|
+
"timestamp",
|
|
3121
|
+
"sequence_number",
|
|
3122
|
+
"joint_position",
|
|
3123
|
+
"joint_torque",
|
|
3124
|
+
"joint_current",
|
|
3125
|
+
"flange_pose",
|
|
3126
|
+
"tcp_pose",
|
|
3127
|
+
"flange_velocity",
|
|
3128
|
+
"tcp_velocity"
|
|
3129
|
+
]), Eo = 1, kt = (e) => Array.isArray(e) && e.length === 3 && e.every((t) => typeof t == "number");
|
|
3130
|
+
class Li {
|
|
3131
|
+
constructor(t, o, i, n = {}) {
|
|
3132
|
+
this.source = t, this.motionGroupId = o, this.lastMessageReceivedAt = Date.now(), this.lastInvalidStateMessage = null, this.connectionQuality = "good";
|
|
3133
|
+
const r = i.motion_groups.find(
|
|
3134
|
+
(a) => a.motion_group === o
|
|
3135
|
+
);
|
|
3136
|
+
if (!r)
|
|
3137
|
+
throw new Error(
|
|
3138
|
+
`Motion group ${o} not found in initial controller state`
|
|
3139
|
+
);
|
|
3140
|
+
this.isVirtual = n.isVirtual ?? !1, this.onError = n.onError, this.reconnectsOnFocus = (n.reconnectOnFocus ?? !0) && typeof window < "u", this.rapidlyChangingMotionState = r, this.lastValidStateMessage = {
|
|
3141
|
+
receivedAt: Date.now(),
|
|
3142
|
+
data: i
|
|
3143
|
+
}, Z(
|
|
3144
|
+
this,
|
|
3145
|
+
{
|
|
3146
|
+
source: !1,
|
|
3147
|
+
lastMessageReceivedAt: !1,
|
|
3148
|
+
connectionQualityInterval: !1,
|
|
3149
|
+
isVirtual: !1,
|
|
3150
|
+
onError: !1,
|
|
3151
|
+
reconnectsOnFocus: !1,
|
|
3152
|
+
// keepAlive: a computed nobody observes is recomputed on every read
|
|
3153
|
+
// without consulting `equals`, so the hold would depend on a component
|
|
3154
|
+
// happening to observe the readout at the time.
|
|
3155
|
+
readoutState: Jt({ equals: Gt, keepAlive: !0 })
|
|
3156
|
+
},
|
|
3157
|
+
{ autoBind: !0 }
|
|
3158
|
+
), this.source.addEventListener("message", this.handleMessage), this.connectionQualityInterval = setInterval(
|
|
3159
|
+
this.updateConnectionQuality,
|
|
3160
|
+
500
|
|
3161
|
+
), this.reconnectsOnFocus && window.addEventListener("focus", this.handleWindowFocus);
|
|
3162
|
+
}
|
|
3163
|
+
/** The controller's state as of the last message that changed it */
|
|
3164
|
+
get controllerState() {
|
|
3165
|
+
return this.lastValidStateMessage.data;
|
|
3166
|
+
}
|
|
3167
|
+
/**
|
|
3168
|
+
* What pose and joint readouts show. Holds the previous reading while the
|
|
3169
|
+
* joints only jitter, see {@link readoutsEqual}; kept alive so it also holds
|
|
3170
|
+
* for untracked reads.
|
|
3171
|
+
*/
|
|
3172
|
+
get readoutState() {
|
|
3173
|
+
return Ut(this.rapidlyChangingMotionState);
|
|
3174
|
+
}
|
|
3175
|
+
/** The motion group's state in the next message of the source */
|
|
3176
|
+
async nextMotionState() {
|
|
3177
|
+
var i, n;
|
|
3178
|
+
const t = await this.source.nextMessage(), o = (n = (i = this.source.parse(t.data)) == null ? void 0 : i.motion_groups) == null ? void 0 : n.find((r) => r.motion_group === this.motionGroupId);
|
|
3179
|
+
if (!o)
|
|
3180
|
+
throw new Error(
|
|
3181
|
+
`Failed to get motion state for ${this.motionGroupId}: ${t.data}`
|
|
3182
|
+
);
|
|
3183
|
+
return o;
|
|
3184
|
+
}
|
|
3185
|
+
setLastInvalidStateMessage(t) {
|
|
3186
|
+
this.lastInvalidStateMessage = {
|
|
3187
|
+
receivedAt: Date.now(),
|
|
3188
|
+
data: t
|
|
3189
|
+
};
|
|
3190
|
+
}
|
|
3191
|
+
setLastValidStateMessage(t) {
|
|
3192
|
+
this.lastValidStateMessage = {
|
|
3193
|
+
receivedAt: Date.now(),
|
|
3194
|
+
data: t
|
|
3195
|
+
};
|
|
3196
|
+
}
|
|
3197
|
+
/**
|
|
3198
|
+
* Merge the latest motion state onto the existing object instead of replacing
|
|
3199
|
+
* it, so this stream owns exactly one live motion state object for the whole
|
|
3200
|
+
* time it is connected.
|
|
3201
|
+
*
|
|
3202
|
+
* Consumers subscribe to *properties* of the object they are holding — the 3D
|
|
3203
|
+
* animators keep it in a ref and read `joint_position` inside a MobX
|
|
3204
|
+
* reaction. Replacing the object leaves those reactions subscribed to an
|
|
3205
|
+
* orphan that never changes again, so the robot model stopped getting joint
|
|
3206
|
+
* targets from the stream and only moved when React happened to re-render it
|
|
3207
|
+
* (~5 updates/s against a ~134/s stream).
|
|
3208
|
+
*
|
|
3209
|
+
* Only fields whose value actually changed are written. A blanket
|
|
3210
|
+
* `Object.assign` puts a fresh object into every nested field, and MobX
|
|
3211
|
+
* compares with `===`, so each of `flange_pose`, `tcp_pose` and
|
|
3212
|
+
* `joint_limit_reached` would notify its observers on every message of a
|
|
3213
|
+
* ~134/s stream even while standing still. This mirrors how
|
|
3214
|
+
* MotionStreamConnection guards each of its own field writes.
|
|
3215
|
+
*
|
|
3216
|
+
* Fields the message does not carry are removed rather than left behind: a
|
|
3217
|
+
* merge must not make a stale pose read as the current one, which replacing
|
|
3218
|
+
* the whole object never did.
|
|
3219
|
+
*
|
|
3220
|
+
* Runs as a MobX action (see `makeAutoObservable` with `autoBind` above), so
|
|
3221
|
+
* the per-field writes notify observers once, as a single batch.
|
|
3222
|
+
*
|
|
3223
|
+
* `skipFields` leaves the named fields exactly as they are — neither updated
|
|
3224
|
+
* nor removed — which is how a standstill message updates the discrete state
|
|
3225
|
+
* without churning the jittery pose readings.
|
|
3226
|
+
*/
|
|
3227
|
+
updateRapidlyChangingMotionState(t, o) {
|
|
3228
|
+
const i = this.rapidlyChangingMotionState, n = t;
|
|
3229
|
+
for (const r of Object.keys(n))
|
|
3230
|
+
o != null && o.has(r) || Dt(i[r], n[r]) || (i[r] = n[r]);
|
|
3231
|
+
for (const r of Object.keys(i))
|
|
3232
|
+
o != null && o.has(r) || r in n || delete i[r];
|
|
3233
|
+
}
|
|
3234
|
+
setConnectionQuality(t) {
|
|
3235
|
+
this.connectionQuality = t;
|
|
3236
|
+
}
|
|
3237
|
+
handleWindowFocus() {
|
|
3238
|
+
this.source.reconnect();
|
|
3239
|
+
}
|
|
3240
|
+
updateConnectionQuality() {
|
|
3241
|
+
const t = Date.now() - this.lastMessageReceivedAt, o = this.isVirtual ? 3e3 : 1e3, i = this.isVirtual ? 6e3 : 3e3;
|
|
3242
|
+
if (t > i) {
|
|
3243
|
+
this.source.readyState === Eo && this.source.reconnect(), this.setConnectionQuality("critical");
|
|
3244
|
+
return;
|
|
3245
|
+
}
|
|
3246
|
+
if (t > o) {
|
|
3247
|
+
this.setConnectionQuality("struggling");
|
|
3248
|
+
return;
|
|
3249
|
+
}
|
|
3250
|
+
this.setConnectionQuality("good");
|
|
3251
|
+
}
|
|
3252
|
+
/** Stops listening to the source; the source's owner closes it */
|
|
3253
|
+
dispose() {
|
|
3254
|
+
this.source.removeEventListener("message", this.handleMessage), clearInterval(this.connectionQualityInterval), this.reconnectsOnFocus && window.removeEventListener("focus", this.handleWindowFocus);
|
|
3255
|
+
}
|
|
3256
|
+
handleMessage(t) {
|
|
3257
|
+
var u, h;
|
|
3258
|
+
const o = this.source.parse(t.data);
|
|
3259
|
+
if (!(o != null && o.motion_groups)) {
|
|
3260
|
+
(u = this.onError) == null || u.call(this, {
|
|
3261
|
+
message: ue(t.data),
|
|
3262
|
+
url: this.source.url
|
|
3263
|
+
}), this.setLastInvalidStateMessage(t.data);
|
|
3264
|
+
return;
|
|
3265
|
+
}
|
|
3266
|
+
this.lastMessageReceivedAt = Date.now();
|
|
3267
|
+
const i = this.lastValidStateMessage.data;
|
|
3268
|
+
(i.safety_state !== o.safety_state || i.operation_mode !== o.operation_mode || i.mode !== o.mode) && this.setLastValidStateMessage(o);
|
|
3269
|
+
const n = o.motion_groups.find(
|
|
3270
|
+
(m) => m.motion_group === this.motionGroupId
|
|
3271
|
+
);
|
|
3272
|
+
if (!n) {
|
|
3273
|
+
(h = this.onError) == null || h.call(this, {
|
|
3274
|
+
message: `Motion group ${this.motionGroupId} not found in controller state: ${JSON.stringify(t.data)}`,
|
|
3275
|
+
url: this.source.url
|
|
3276
|
+
}), this.setLastInvalidStateMessage(t.data);
|
|
3277
|
+
return;
|
|
3278
|
+
}
|
|
3279
|
+
const r = !$t(
|
|
3280
|
+
this.rapidlyChangingMotionState.joint_position,
|
|
3281
|
+
n.joint_position,
|
|
3282
|
+
jo
|
|
3283
|
+
), a = this.rapidlyChangingMotionState.tcp !== n.tcp;
|
|
3284
|
+
if (!r && !a) {
|
|
3285
|
+
this.updateRapidlyChangingMotionState(
|
|
3286
|
+
n,
|
|
3287
|
+
Mo
|
|
3288
|
+
);
|
|
3289
|
+
return;
|
|
3290
|
+
}
|
|
3291
|
+
const s = this.rapidlyChangingMotionState.flange_pose, d = n.flange_pose;
|
|
3292
|
+
if ((d == null ? void 0 : d.orientation) == null || !kt(d.orientation)) {
|
|
3293
|
+
const m = d == null ? void 0 : d.orientation;
|
|
3294
|
+
throw new Error(
|
|
3295
|
+
`Invalid newFlangePose.orientation: expected [number, number, number] (got ${m == null ? "null" : m.length})`
|
|
3296
|
+
);
|
|
3297
|
+
}
|
|
3298
|
+
if ((s == null ? void 0 : s.orientation) == null || !kt(s.orientation)) {
|
|
3299
|
+
const m = s == null ? void 0 : s.orientation;
|
|
3300
|
+
throw new Error(
|
|
3301
|
+
`Invalid oldFlangePose.orientation: expected [number, number, number] (got ${m == null ? "null" : m.length})`
|
|
3302
|
+
);
|
|
3303
|
+
}
|
|
3304
|
+
d.orientation = zt(
|
|
3305
|
+
d.orientation,
|
|
3306
|
+
s.orientation
|
|
3307
|
+
), this.updateRapidlyChangingMotionState(n);
|
|
3308
|
+
}
|
|
3309
|
+
}
|
|
3310
|
+
function To(e) {
|
|
3311
|
+
return {
|
|
3312
|
+
get url() {
|
|
3313
|
+
return e.url;
|
|
3314
|
+
},
|
|
3315
|
+
get readyState() {
|
|
3316
|
+
return e.readyState;
|
|
3317
|
+
},
|
|
3318
|
+
addEventListener: (t, o) => e.addEventListener(t, o),
|
|
3319
|
+
removeEventListener: (t, o) => e.removeEventListener(t, o),
|
|
3320
|
+
firstMessage: () => e.firstMessage(),
|
|
3321
|
+
nextMessage: () => e.nextMessage(),
|
|
3322
|
+
reconnect: () => e.reconnect(),
|
|
3323
|
+
close: () => e.close(),
|
|
3324
|
+
parse: (t) => {
|
|
3325
|
+
var o;
|
|
3326
|
+
return (o = De(t)) == null ? void 0 : o.result;
|
|
3327
|
+
}
|
|
3328
|
+
};
|
|
3329
|
+
}
|
|
3330
|
+
function Di(e, {
|
|
3331
|
+
controllerId: t,
|
|
3332
|
+
cellId: o,
|
|
3333
|
+
responseRateMs: i
|
|
3334
|
+
}) {
|
|
3335
|
+
const n = N(e), r = o ?? it(e) ?? "cell", a = i === void 0 ? "" : `?response_rate=${i}`;
|
|
3336
|
+
return To(
|
|
3337
|
+
n.openReconnectingWebsocket(
|
|
3338
|
+
`/cells/${r}/controllers/${t}/state-stream${a}`
|
|
3339
|
+
)
|
|
3340
|
+
);
|
|
3341
|
+
}
|
|
3342
|
+
const ko = [
|
|
3103
3343
|
"FeedbackOutOfWorkspace",
|
|
3104
3344
|
"FeedbackJointLimitExceeded",
|
|
3105
3345
|
"FeedbackAxisRangeExceeded",
|
|
3106
3346
|
"FeedbackNoSolutionInCurrentConfiguration"
|
|
3107
3347
|
];
|
|
3108
|
-
function
|
|
3109
|
-
return e === "FeedbackSingularity" ? "Jogging.TargetPose.Error.Singularity.lb" : e === "FeedbackCollision" ? "Jogging.TargetPose.Error.Collision.lb" :
|
|
3348
|
+
function Vi(e) {
|
|
3349
|
+
return e === "FeedbackSingularity" ? "Jogging.TargetPose.Error.Singularity.lb" : e === "FeedbackCollision" ? "Jogging.TargetPose.Error.Collision.lb" : ko.includes(e) ? "Jogging.TargetPose.Error.NotReachable.lb" : "Jogging.TargetPose.Error.PlanningFailed.lb";
|
|
3110
3350
|
}
|
|
3111
|
-
class
|
|
3351
|
+
class $i {
|
|
3112
3352
|
constructor(t) {
|
|
3113
|
-
this.options = t, this.plannedTrajectory = null, this.trajectoryState = "idle", this.lastError = null, this.disposers = [], this.logger = t.logger ?? console,
|
|
3353
|
+
this.options = t, this.plannedTrajectory = null, this.trajectoryState = "idle", this.lastError = null, this.disposers = [], this.logger = t.logger ?? console, Z(
|
|
3114
3354
|
this,
|
|
3115
3355
|
{ socket: !1, disposers: !1, logger: !1, options: !1 },
|
|
3116
3356
|
{ autoBind: !0 }
|
|
3117
3357
|
), this.socket = this.openSocket(), this.disposers.push(
|
|
3118
|
-
|
|
3358
|
+
ge(
|
|
3119
3359
|
() => this.executionState,
|
|
3120
3360
|
(o) => {
|
|
3121
3361
|
o === "END_OF_TRAJECTORY" && this.reset();
|
|
@@ -3144,31 +3384,31 @@ class Ei {
|
|
|
3144
3384
|
* the robot and when the planner cannot be reached.
|
|
3145
3385
|
*/
|
|
3146
3386
|
async planTrajectory(t) {
|
|
3147
|
-
var
|
|
3148
|
-
if ((
|
|
3387
|
+
var j, w, E, T, k;
|
|
3388
|
+
if ((w = (j = this.options).isLocked) != null && w.call(j))
|
|
3149
3389
|
throw this.reset(), new Error("Cannot plan trajectory: the robot is locked");
|
|
3150
3390
|
await this.ensureMovementOwnership();
|
|
3151
|
-
const o = this.motionStream.rapidlyChangingMotionState.joint_position ?? [], { cycle_time: i, mounting: n, motion_group_model: r, tcps: a } = this.motionStream.description, s = this.joggingStore.selectedTcpId,
|
|
3391
|
+
const o = this.motionStream.rapidlyChangingMotionState.joint_position ?? [], { cycle_time: i, mounting: n, motion_group_model: r, tcps: a } = this.motionStream.description, s = this.joggingStore.selectedTcpId, d = s ? (E = a == null ? void 0 : a[s]) == null ? void 0 : E.pose : void 0, u = {
|
|
3152
3392
|
// The model the jogger plans step jogs with: the custom copy that holds
|
|
3153
3393
|
// this robot's data, if the app gave one
|
|
3154
3394
|
motion_group_model: ((T = this.jogger.options) == null ? void 0 : T.motionGroupModel) ?? r,
|
|
3155
3395
|
cycle_time: i ?? 0,
|
|
3156
3396
|
mounting: n,
|
|
3157
|
-
...
|
|
3397
|
+
...d && { tcp_offset: d }
|
|
3158
3398
|
};
|
|
3159
|
-
let
|
|
3399
|
+
let h;
|
|
3160
3400
|
if (t.type === "cartesian") {
|
|
3161
|
-
let
|
|
3162
|
-
const
|
|
3163
|
-
if (
|
|
3401
|
+
let x = t.pose;
|
|
3402
|
+
const O = t.coordinateSystemId || "world";
|
|
3403
|
+
if (O !== "world")
|
|
3164
3404
|
try {
|
|
3165
|
-
|
|
3405
|
+
x = rt(
|
|
3166
3406
|
{
|
|
3167
3407
|
pose: {
|
|
3168
|
-
position:
|
|
3169
|
-
orientation:
|
|
3408
|
+
position: x.position ?? [0, 0, 0],
|
|
3409
|
+
orientation: x.orientation ?? [0, 0, 0]
|
|
3170
3410
|
},
|
|
3171
|
-
coordinateSystemId:
|
|
3411
|
+
coordinateSystemId: O
|
|
3172
3412
|
},
|
|
3173
3413
|
"world",
|
|
3174
3414
|
this.joggingStore.coordSystems
|
|
@@ -3176,17 +3416,17 @@ class Ei {
|
|
|
3176
3416
|
} catch {
|
|
3177
3417
|
return this.reset(), { ok: !1, errorFeedbackName: "FeedbackUnknown" };
|
|
3178
3418
|
}
|
|
3179
|
-
|
|
3419
|
+
h = {
|
|
3180
3420
|
limits_override: {
|
|
3181
3421
|
tcp_velocity_limit: this.joggingStore.translationVelocityMmPerSec
|
|
3182
3422
|
},
|
|
3183
3423
|
path: {
|
|
3184
|
-
target_pose:
|
|
3424
|
+
target_pose: x,
|
|
3185
3425
|
path_definition_name: "PathCartesianPTP"
|
|
3186
3426
|
}
|
|
3187
3427
|
};
|
|
3188
3428
|
} else
|
|
3189
|
-
|
|
3429
|
+
h = {
|
|
3190
3430
|
limits_override: {
|
|
3191
3431
|
joint_velocity_limits: Array(o.length).fill(
|
|
3192
3432
|
this.joggingStore.rotationVelocityRadsPerSec
|
|
@@ -3200,37 +3440,37 @@ class Ei {
|
|
|
3200
3440
|
S(() => {
|
|
3201
3441
|
this.lastError = null, this.trajectoryState = "planning";
|
|
3202
3442
|
});
|
|
3203
|
-
let
|
|
3443
|
+
let m;
|
|
3204
3444
|
try {
|
|
3205
|
-
|
|
3445
|
+
m = await this.jogger.nova.api.trajectoryPlanning.planTrajectory(
|
|
3206
3446
|
this.jogger.cellId,
|
|
3207
3447
|
{
|
|
3208
|
-
motion_group_setup:
|
|
3448
|
+
motion_group_setup: u,
|
|
3209
3449
|
start_joint_position: o,
|
|
3210
|
-
motion_commands: [
|
|
3450
|
+
motion_commands: [h]
|
|
3211
3451
|
}
|
|
3212
3452
|
);
|
|
3213
|
-
} catch (
|
|
3214
|
-
throw this.reset(),
|
|
3453
|
+
} catch (x) {
|
|
3454
|
+
throw this.reset(), x;
|
|
3215
3455
|
}
|
|
3216
|
-
const
|
|
3217
|
-
if ("error_feedback" in
|
|
3218
|
-
const
|
|
3219
|
-
return this.reset(), { ok: !1, errorFeedbackName:
|
|
3456
|
+
const g = m.response;
|
|
3457
|
+
if ("error_feedback" in g) {
|
|
3458
|
+
const x = ((k = g.error_feedback) == null ? void 0 : k.error_feedback_name) ?? "FeedbackUnknown";
|
|
3459
|
+
return this.reset(), { ok: !1, errorFeedbackName: x };
|
|
3220
3460
|
}
|
|
3221
|
-
const l =
|
|
3461
|
+
const l = g.joint_positions, f = l[0], p = l[l.length - 1];
|
|
3222
3462
|
if (!f || !p)
|
|
3223
3463
|
throw this.reset(), new Error("Trajectory returned invalid joint positions");
|
|
3224
|
-
const
|
|
3464
|
+
const v = {
|
|
3225
3465
|
message_type: "InitializeMovementRequest",
|
|
3226
3466
|
trajectory: {
|
|
3227
3467
|
message_type: "TrajectoryData",
|
|
3228
3468
|
motion_group: this.jogger.motionGroupId,
|
|
3229
3469
|
tcp: s || void 0,
|
|
3230
|
-
data:
|
|
3470
|
+
data: g
|
|
3231
3471
|
}
|
|
3232
3472
|
};
|
|
3233
|
-
return this.socket.sendJson(
|
|
3473
|
+
return this.socket.sendJson(v), S(() => {
|
|
3234
3474
|
this.plannedTrajectory = { startJoints: f, endJoints: p };
|
|
3235
3475
|
}), { ok: !0 };
|
|
3236
3476
|
}
|
|
@@ -3311,11 +3551,11 @@ class Ei {
|
|
|
3311
3551
|
}
|
|
3312
3552
|
/** Resolves once the motion stream reports that the robot stands still */
|
|
3313
3553
|
async waitUntilStopped() {
|
|
3314
|
-
await
|
|
3554
|
+
await ot(() => this.motionStream.rapidlyChangingMotionState.standstill);
|
|
3315
3555
|
}
|
|
3316
3556
|
handleMessage(t) {
|
|
3317
3557
|
var i, n;
|
|
3318
|
-
const o = (i =
|
|
3558
|
+
const o = (i = R(t.data)) == null ? void 0 : i.result;
|
|
3319
3559
|
if (o)
|
|
3320
3560
|
switch (o.kind) {
|
|
3321
3561
|
case "INITIALIZE_RECEIVED":
|
|
@@ -3343,29 +3583,32 @@ class Ei {
|
|
|
3343
3583
|
}
|
|
3344
3584
|
}
|
|
3345
3585
|
export {
|
|
3346
|
-
|
|
3586
|
+
Ri as A,
|
|
3347
3587
|
ht as C,
|
|
3348
3588
|
pt as J,
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
$
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3589
|
+
Ke as L,
|
|
3590
|
+
jo as M,
|
|
3591
|
+
Pi as N,
|
|
3592
|
+
$i as T,
|
|
3593
|
+
vo as V,
|
|
3594
|
+
Li as a,
|
|
3595
|
+
xt as b,
|
|
3596
|
+
Be as c,
|
|
3597
|
+
Ai as d,
|
|
3598
|
+
at as e,
|
|
3599
|
+
Ye as f,
|
|
3600
|
+
mt as g,
|
|
3601
|
+
Qt as h,
|
|
3602
|
+
Di as i,
|
|
3603
|
+
Ji as j,
|
|
3604
|
+
$t as k,
|
|
3605
|
+
Nt as l,
|
|
3606
|
+
Ue as m,
|
|
3607
|
+
Gt as n,
|
|
3608
|
+
lo as o,
|
|
3609
|
+
Vi as p,
|
|
3610
|
+
rt as q,
|
|
3611
|
+
Ut as r,
|
|
3612
|
+
Bt as t,
|
|
3613
|
+
zt as u
|
|
3371
3614
|
};
|