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