@wandelbots/wandelbots-js-react-components 4.4.1 → 4.5.0
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.js +1 -1
- package/dist/3d.es.js +1 -1
- package/dist/MotionGroupVisualizer-COKQraKa.cjs +2 -0
- package/dist/MotionGroupVisualizer-COKQraKa.cjs.map +1 -0
- package/dist/{MotionGroupVisualizer-Catdk92m.js → MotionGroupVisualizer-Ce9kTMPy.js} +380 -368
- package/dist/MotionGroupVisualizer-Ce9kTMPy.js.map +1 -0
- package/dist/components/3d-viewport/SafetyZonesRenderer.d.ts +2 -1
- package/dist/components/3d-viewport/SafetyZonesRenderer.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/package.json +1 -1
- package/src/components/3d-viewport/SafetyZonesRenderer.tsx +106 -45
- package/dist/MotionGroupVisualizer-Catdk92m.js.map +0 -1
- package/dist/MotionGroupVisualizer-DePl371W.cjs +0 -2
- package/dist/MotionGroupVisualizer-DePl371W.cjs.map +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { j as t, e as C } from "./externalizeComponent-Dc3fViZA.js";
|
|
2
2
|
import * as x from "three";
|
|
3
|
-
import { Matrix4 as w, Vector3 as
|
|
3
|
+
import { Matrix4 as w, Vector3 as T, Quaternion as E } from "three";
|
|
4
4
|
import { ConvexGeometry as re } from "three-stdlib";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import { useTranslation as
|
|
11
|
-
import { N as
|
|
5
|
+
import Me, { useEffect as v, useMemo as z, useRef as R, useCallback as V, useState as A, Suspense as oe } from "react";
|
|
6
|
+
import { useThree as se, useFrame as ie, Canvas as q } from "@react-three/fiber";
|
|
7
|
+
import { Environment as _e, Lightformer as L, Line as J, useGLTF as Ve, Bounds as X } from "@react-three/drei";
|
|
8
|
+
import { useTheme as Te, Card as Ae, Box as b, Typography as K, Divider as Q, Button as Z } from "@mui/material";
|
|
9
|
+
import { observer as Le } from "mobx-react-lite";
|
|
10
|
+
import { useTranslation as Ge } from "react-i18next";
|
|
11
|
+
import { N as Se, V as ae, c as le, b as ee, M, J as I } from "./interpolation-Chyc6Hfo.js";
|
|
12
12
|
import { ErrorBoundary as ce } from "react-error-boundary";
|
|
13
|
-
function
|
|
13
|
+
function ke(e) {
|
|
14
14
|
switch (e.shape_type) {
|
|
15
15
|
case "convex_hull":
|
|
16
16
|
return new re(
|
|
@@ -47,40 +47,40 @@ function Pe(e) {
|
|
|
47
47
|
return console.warn(`${e.shape_type} is not supported`), new x.BufferGeometry();
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function Fe({
|
|
51
51
|
name: e,
|
|
52
52
|
collider: r,
|
|
53
53
|
children: n
|
|
54
54
|
}) {
|
|
55
|
-
var
|
|
56
|
-
const
|
|
55
|
+
var f, s;
|
|
56
|
+
const l = ((f = r.pose) == null ? void 0 : f.position) ?? [0, 0, 0], o = ((s = r.pose) == null ? void 0 : s.orientation) ?? [0, 0, 0];
|
|
57
57
|
return r.margin && console.warn(`${e} margin is not supported`), /* @__PURE__ */ t.jsx(
|
|
58
58
|
"mesh",
|
|
59
59
|
{
|
|
60
60
|
name: e,
|
|
61
61
|
position: new x.Vector3(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
l[0],
|
|
63
|
+
l[1],
|
|
64
|
+
l[2]
|
|
65
65
|
).divideScalar(1e3),
|
|
66
66
|
rotation: new x.Euler(o[0], o[1], o[2], "XYZ"),
|
|
67
|
-
geometry:
|
|
67
|
+
geometry: ke(r.shape),
|
|
68
68
|
children: n
|
|
69
69
|
}
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function Pe({
|
|
73
73
|
name: e,
|
|
74
74
|
colliders: r,
|
|
75
75
|
meshChildrenProvider: n,
|
|
76
|
-
...
|
|
76
|
+
...l
|
|
77
77
|
}) {
|
|
78
|
-
return /* @__PURE__ */ t.jsx("group", { name: e, ...
|
|
79
|
-
|
|
78
|
+
return /* @__PURE__ */ t.jsx("group", { name: e, ...l, children: Object.entries(r).map(([o, f]) => /* @__PURE__ */ t.jsx(
|
|
79
|
+
Fe,
|
|
80
80
|
{
|
|
81
81
|
name: o,
|
|
82
|
-
collider:
|
|
83
|
-
children: n(o,
|
|
82
|
+
collider: f,
|
|
83
|
+
children: n(o, f)
|
|
84
84
|
},
|
|
85
85
|
o
|
|
86
86
|
)) });
|
|
@@ -91,7 +91,7 @@ function ot({
|
|
|
91
91
|
}) {
|
|
92
92
|
const n = e.colliders;
|
|
93
93
|
return /* @__PURE__ */ t.jsx("group", { children: n && /* @__PURE__ */ t.jsx(
|
|
94
|
-
|
|
94
|
+
Pe,
|
|
95
95
|
{
|
|
96
96
|
meshChildrenProvider: r,
|
|
97
97
|
colliders: n
|
|
@@ -99,12 +99,12 @@ function ot({
|
|
|
99
99
|
) });
|
|
100
100
|
}
|
|
101
101
|
function te() {
|
|
102
|
-
return /* @__PURE__ */ t.jsx(
|
|
102
|
+
return /* @__PURE__ */ t.jsx(_e, { children: /* @__PURE__ */ t.jsx(Ie, {}) });
|
|
103
103
|
}
|
|
104
104
|
function Ie({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
|
|
105
105
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
106
106
|
/* @__PURE__ */ t.jsx(
|
|
107
|
-
|
|
107
|
+
L,
|
|
108
108
|
{
|
|
109
109
|
intensity: 5,
|
|
110
110
|
"rotation-x": Math.PI / 2,
|
|
@@ -113,7 +113,7 @@ function Ie({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
|
|
|
113
113
|
}
|
|
114
114
|
),
|
|
115
115
|
/* @__PURE__ */ t.jsx("group", { rotation: [0, 0.5, 0], children: /* @__PURE__ */ t.jsx("group", { children: e.map((r, n) => /* @__PURE__ */ t.jsx(
|
|
116
|
-
|
|
116
|
+
L,
|
|
117
117
|
{
|
|
118
118
|
form: "circle",
|
|
119
119
|
intensity: 5,
|
|
@@ -124,7 +124,7 @@ function Ie({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
|
|
|
124
124
|
n
|
|
125
125
|
)) }) }),
|
|
126
126
|
/* @__PURE__ */ t.jsx(
|
|
127
|
-
|
|
127
|
+
L,
|
|
128
128
|
{
|
|
129
129
|
intensity: 40,
|
|
130
130
|
"rotation-y": Math.PI / 2,
|
|
@@ -133,7 +133,7 @@ function Ie({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
|
|
|
133
133
|
}
|
|
134
134
|
),
|
|
135
135
|
/* @__PURE__ */ t.jsx(
|
|
136
|
-
|
|
136
|
+
L,
|
|
137
137
|
{
|
|
138
138
|
intensity: 20,
|
|
139
139
|
"rotation-y": -Math.PI,
|
|
@@ -142,7 +142,7 @@ function Ie({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
|
|
|
142
142
|
}
|
|
143
143
|
),
|
|
144
144
|
/* @__PURE__ */ t.jsx(
|
|
145
|
-
|
|
145
|
+
L,
|
|
146
146
|
{
|
|
147
147
|
"rotation-y": Math.PI / 2,
|
|
148
148
|
position: [-5, -1, -1],
|
|
@@ -151,7 +151,7 @@ function Ie({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
|
|
|
151
151
|
}
|
|
152
152
|
),
|
|
153
153
|
/* @__PURE__ */ t.jsx(
|
|
154
|
-
|
|
154
|
+
L,
|
|
155
155
|
{
|
|
156
156
|
"rotation-y": -Math.PI / 2,
|
|
157
157
|
position: [10, 1, 0],
|
|
@@ -160,7 +160,7 @@ function Ie({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
|
|
|
160
160
|
}
|
|
161
161
|
),
|
|
162
162
|
/* @__PURE__ */ t.jsx(
|
|
163
|
-
|
|
163
|
+
L,
|
|
164
164
|
{
|
|
165
165
|
form: "ring",
|
|
166
166
|
color: "white",
|
|
@@ -172,64 +172,76 @@ function Ie({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
|
|
|
172
172
|
)
|
|
173
173
|
] });
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function ze(e) {
|
|
176
176
|
if (e.length < 3)
|
|
177
177
|
return console.log("Not enough vertices to define a plane"), { isCoplanar: !1 };
|
|
178
|
-
const r = new x.Vector3(e[0].x, e[0].y, e[0].z), n = new x.Vector3(e[1].x, e[1].y, e[1].z),
|
|
179
|
-
for (let
|
|
180
|
-
const
|
|
181
|
-
if (Math.abs(
|
|
178
|
+
const r = new x.Vector3(e[0].x, e[0].y, e[0].z), n = new x.Vector3(e[1].x, e[1].y, e[1].z), l = new x.Vector3(e[2].x, e[2].y, e[2].z), o = new x.Vector3().subVectors(n, r), f = new x.Vector3().subVectors(l, r), s = new x.Vector3().crossVectors(o, f).normalize();
|
|
179
|
+
for (let u = 3; u < e.length; u++) {
|
|
180
|
+
const a = new x.Vector3(e[u].x, e[u].y, e[u].z), d = new x.Vector3().subVectors(a, r), m = s.dot(d);
|
|
181
|
+
if (Math.abs(m) > 1e-6)
|
|
182
182
|
return console.log("Vertices are not on the same plane"), { isCoplanar: !1 };
|
|
183
183
|
}
|
|
184
|
-
return { isCoplanar: !0, normal:
|
|
184
|
+
return { isCoplanar: !0, normal: s };
|
|
185
185
|
}
|
|
186
186
|
function st({
|
|
187
187
|
safetyZones: e,
|
|
188
188
|
...r
|
|
189
189
|
}) {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
"
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
190
|
+
v(() => {
|
|
191
|
+
Array.isArray(e) && console.warn("SafetyZonesRenderer: The support of V1 safety zones is deprecated. Please migrate to V2 safety zones.");
|
|
192
|
+
}, [e]);
|
|
193
|
+
const n = (s, u) => {
|
|
194
|
+
const a = ze(s);
|
|
195
|
+
if (a.isCoplanar && a.normal) {
|
|
196
|
+
const i = new x.Vector3().addVectors(
|
|
197
|
+
s[0],
|
|
198
|
+
a.normal.multiplyScalar(1e-4)
|
|
199
|
+
);
|
|
200
|
+
s.push(i);
|
|
201
|
+
}
|
|
202
|
+
let d;
|
|
203
|
+
try {
|
|
204
|
+
d = new re(s);
|
|
205
|
+
} catch (m) {
|
|
206
|
+
return console.log("Error creating ConvexGeometry:", m), null;
|
|
207
|
+
}
|
|
208
|
+
return /* @__PURE__ */ t.jsx("mesh", { geometry: d, children: /* @__PURE__ */ t.jsx(
|
|
209
|
+
"meshStandardMaterial",
|
|
210
|
+
{
|
|
211
|
+
attach: "material",
|
|
212
|
+
color: "#009f4d",
|
|
213
|
+
opacity: 0.2,
|
|
214
|
+
depthTest: !1,
|
|
215
|
+
depthWrite: !1,
|
|
216
|
+
transparent: !0,
|
|
217
|
+
polygonOffset: !0,
|
|
218
|
+
polygonOffsetFactor: -u
|
|
219
|
+
},
|
|
220
|
+
`safety-zone-material-${u}`
|
|
221
|
+
) }, `safety-zone-mesh-${u}`);
|
|
222
|
+
}, l = () => Object.values(e ?? {}).map((s, u) => {
|
|
223
|
+
let a = [];
|
|
224
|
+
Object.keys(s.shape).includes("vertices") && (a = s.shape.vertices);
|
|
225
|
+
const d = a.map((m) => new x.Vector3(m[0] / 1e3, m[1] / 1e3, m[2] / 1e3));
|
|
226
|
+
return n(d, u);
|
|
227
|
+
}), o = () => Array.isArray(e) ? e.map((s, u) => {
|
|
228
|
+
let a = [];
|
|
229
|
+
return s.geometry && (s.geometry.compound ? a = s.geometry.compound.child_geometries : s.geometry.convex_hull && (a = [s.geometry])), a.map((d, m) => {
|
|
230
|
+
if (!d.convex_hull) return null;
|
|
231
|
+
const i = d.convex_hull.vertices.map(
|
|
232
|
+
(c) => new x.Vector3(c.x / 1e3, c.y / 1e3, c.z / 1e3)
|
|
233
|
+
);
|
|
234
|
+
return n(i, u * 1e3 + m);
|
|
224
235
|
});
|
|
225
|
-
})
|
|
236
|
+
}) : null, f = z(() => Array.isArray(e) ? o() : l(), [e, o, l]);
|
|
237
|
+
return /* @__PURE__ */ t.jsx("group", { ...r, children: f });
|
|
226
238
|
}
|
|
227
239
|
function it({
|
|
228
240
|
trajectory: e,
|
|
229
241
|
...r
|
|
230
242
|
}) {
|
|
231
|
-
var
|
|
232
|
-
const n = ((
|
|
243
|
+
var l;
|
|
244
|
+
const n = ((l = e.trajectory) == null ? void 0 : l.map((o) => o.tcp_pose ? new x.Vector3(
|
|
233
245
|
o.tcp_pose.position.x / 1e3,
|
|
234
246
|
o.tcp_pose.position.z / 1e3,
|
|
235
247
|
-o.tcp_pose.position.y / 1e3
|
|
@@ -250,24 +262,24 @@ async function D(e, r) {
|
|
|
250
262
|
if (U.has(e))
|
|
251
263
|
return U.get(e);
|
|
252
264
|
const n = (async () => {
|
|
253
|
-
var
|
|
254
|
-
const
|
|
255
|
-
(
|
|
256
|
-
var
|
|
257
|
-
return (
|
|
265
|
+
var s;
|
|
266
|
+
const l = r || "", o = new Se({ instanceUrl: l }), f = o.api.motionGroupModels;
|
|
267
|
+
(s = f.axios) != null && s.interceptors && f.axios.interceptors.request.use((u) => {
|
|
268
|
+
var a;
|
|
269
|
+
return (a = u.url) != null && a.includes("/glb") && (u.responseType = "blob"), u;
|
|
258
270
|
});
|
|
259
271
|
try {
|
|
260
|
-
const
|
|
261
|
-
return URL.createObjectURL(
|
|
262
|
-
} catch (
|
|
263
|
-
throw console.error("Failed to fetch model:",
|
|
272
|
+
const u = await o.api.motionGroupModels.getMotionGroupGlbModel(e);
|
|
273
|
+
return URL.createObjectURL(u);
|
|
274
|
+
} catch (u) {
|
|
275
|
+
throw console.error("Failed to fetch model:", u), u;
|
|
264
276
|
}
|
|
265
277
|
})();
|
|
266
278
|
return U.set(e, n), n;
|
|
267
279
|
}
|
|
268
280
|
function ue(e) {
|
|
269
281
|
function r(n) {
|
|
270
|
-
return n.children.length === 0 ? [n] : [n, ...n.children.flatMap((
|
|
282
|
+
return n.children.length === 0 ? [n] : [n, ...n.children.flatMap((l) => r(l))];
|
|
271
283
|
}
|
|
272
284
|
return r(e).filter((n) => de(n));
|
|
273
285
|
}
|
|
@@ -277,9 +289,9 @@ function fe(e) {
|
|
|
277
289
|
function de(e) {
|
|
278
290
|
return /_J[0-9]+$/.test(e.name);
|
|
279
291
|
}
|
|
280
|
-
function
|
|
292
|
+
function Ce(e, r) {
|
|
281
293
|
let n;
|
|
282
|
-
function
|
|
294
|
+
function l(o) {
|
|
283
295
|
if (fe(o)) {
|
|
284
296
|
if (n)
|
|
285
297
|
throw Error(
|
|
@@ -287,9 +299,9 @@ function De(e, r) {
|
|
|
287
299
|
);
|
|
288
300
|
n = o;
|
|
289
301
|
}
|
|
290
|
-
de(o), o.children.map(
|
|
302
|
+
de(o), o.children.map(l);
|
|
291
303
|
}
|
|
292
|
-
if (
|
|
304
|
+
if (l(e.scene), !n)
|
|
293
305
|
throw Error(
|
|
294
306
|
`No flange group found in robot model ${r}. Flange must be identified with a name ending in _FLG.`
|
|
295
307
|
);
|
|
@@ -299,90 +311,90 @@ function me({
|
|
|
299
311
|
rapidlyChangingMotionState: e,
|
|
300
312
|
dhParameters: r,
|
|
301
313
|
onRotationChanged: n,
|
|
302
|
-
children:
|
|
314
|
+
children: l
|
|
303
315
|
}) {
|
|
304
|
-
const o = R([]),
|
|
305
|
-
|
|
306
|
-
const
|
|
307
|
-
(
|
|
316
|
+
const o = R([]), f = R([]), s = R(null), { invalidate: u } = se();
|
|
317
|
+
v(() => {
|
|
318
|
+
const i = e.joint_position.filter(
|
|
319
|
+
(c) => c !== void 0
|
|
308
320
|
);
|
|
309
|
-
return
|
|
321
|
+
return s.current = new ae(i, {
|
|
310
322
|
tension: 120,
|
|
311
323
|
// Controls spring stiffness - higher values create faster, more responsive motion
|
|
312
324
|
friction: 20,
|
|
313
325
|
// Controls damping - higher values reduce oscillation and create smoother settling
|
|
314
326
|
threshold: 1e-3
|
|
315
327
|
}), () => {
|
|
316
|
-
var
|
|
317
|
-
(
|
|
328
|
+
var c;
|
|
329
|
+
(c = s.current) == null || c.destroy();
|
|
318
330
|
};
|
|
319
|
-
}, []),
|
|
320
|
-
if (
|
|
321
|
-
const
|
|
322
|
-
d(),
|
|
331
|
+
}, []), ie((i, c) => {
|
|
332
|
+
if (s.current) {
|
|
333
|
+
const h = s.current.update(c);
|
|
334
|
+
d(), h || u();
|
|
323
335
|
}
|
|
324
336
|
});
|
|
325
|
-
function
|
|
326
|
-
|
|
337
|
+
function a(i) {
|
|
338
|
+
i && (f.current = ue(i), d(), u());
|
|
327
339
|
}
|
|
328
340
|
function d() {
|
|
329
|
-
var
|
|
330
|
-
const
|
|
341
|
+
var c;
|
|
342
|
+
const i = ((c = s.current) == null ? void 0 : c.getCurrentValues()) || [];
|
|
331
343
|
if (n)
|
|
332
|
-
n(
|
|
344
|
+
n(f.current, i);
|
|
333
345
|
else
|
|
334
|
-
for (const [
|
|
335
|
-
const p = r[
|
|
336
|
-
y.rotation.y = g * (
|
|
346
|
+
for (const [h, y] of f.current.entries()) {
|
|
347
|
+
const p = r[h], j = p.theta || 0, g = p.reverse_rotation_direction ? -1 : 1;
|
|
348
|
+
y.rotation.y = g * (i[h] || 0) + j;
|
|
337
349
|
}
|
|
338
350
|
}
|
|
339
|
-
const
|
|
340
|
-
const
|
|
341
|
-
(
|
|
351
|
+
const m = V(() => {
|
|
352
|
+
const i = e.joint_position.filter(
|
|
353
|
+
(c) => c !== void 0
|
|
342
354
|
);
|
|
343
355
|
requestAnimationFrame(() => {
|
|
344
|
-
var
|
|
345
|
-
o.current =
|
|
356
|
+
var c;
|
|
357
|
+
o.current = i, (c = s.current) == null || c.setTarget(i);
|
|
346
358
|
});
|
|
347
359
|
}, [e]);
|
|
348
|
-
return
|
|
349
|
-
|
|
350
|
-
}, [e,
|
|
351
|
-
|
|
352
|
-
}), /* @__PURE__ */ t.jsx("group", { ref:
|
|
360
|
+
return v(() => {
|
|
361
|
+
m();
|
|
362
|
+
}, [e, m]), le(() => {
|
|
363
|
+
m();
|
|
364
|
+
}), /* @__PURE__ */ t.jsx("group", { ref: a, children: l });
|
|
353
365
|
}
|
|
354
|
-
const
|
|
366
|
+
const De = "line", Oe = "mesh";
|
|
355
367
|
function Ue({
|
|
356
368
|
rapidlyChangingMotionState: e,
|
|
357
369
|
dhParameters: r,
|
|
358
370
|
...n
|
|
359
371
|
}) {
|
|
360
|
-
const
|
|
361
|
-
|
|
362
|
-
o.current = new Array(r.length).fill(null),
|
|
372
|
+
const l = new w(), o = R([]), f = R([]);
|
|
373
|
+
Me.useEffect(() => {
|
|
374
|
+
o.current = new Array(r.length).fill(null), f.current = new Array(r.length).fill(null);
|
|
363
375
|
}, [r.length]);
|
|
364
|
-
function
|
|
365
|
-
const
|
|
366
|
-
|
|
367
|
-
const y =
|
|
368
|
-
d.theta +
|
|
376
|
+
function s(d, m) {
|
|
377
|
+
const i = new T(), c = new E(), h = new T();
|
|
378
|
+
l.decompose(i, c, h);
|
|
379
|
+
const y = i.clone(), p = new w().makeRotationY(
|
|
380
|
+
d.theta + m * (d.reverse_rotation_direction ? -1 : 1)
|
|
369
381
|
).multiply(new w().makeTranslation(0, d.d / 1e3, 0)).multiply(new w().makeTranslation(d.a / 1e3, 0, 0)).multiply(new w().makeRotationX(d.alpha));
|
|
370
|
-
return
|
|
382
|
+
return l.multiply(p), l.decompose(i, c, h), { a: y, b: i };
|
|
371
383
|
}
|
|
372
|
-
function
|
|
384
|
+
function u(d, m, i, c) {
|
|
373
385
|
if (!r)
|
|
374
386
|
return;
|
|
375
|
-
const
|
|
376
|
-
if (!
|
|
387
|
+
const h = r[d];
|
|
388
|
+
if (!h)
|
|
377
389
|
return;
|
|
378
|
-
const { a: y, b: p } =
|
|
379
|
-
|
|
390
|
+
const { a: y, b: p } = s(h, c);
|
|
391
|
+
m.geometry.setPositions([y.toArray(), p.toArray()].flat()), i.position.set(p.x, p.y, p.z);
|
|
380
392
|
}
|
|
381
|
-
function
|
|
382
|
-
|
|
383
|
-
for (let
|
|
384
|
-
const
|
|
385
|
-
|
|
393
|
+
function a(d, m) {
|
|
394
|
+
l.identity();
|
|
395
|
+
for (let i = 0; i < Math.min(d.length, m.length); i++) {
|
|
396
|
+
const c = o.current[i], h = f.current[i];
|
|
397
|
+
c && h && u(i, c, h, m[i]);
|
|
386
398
|
}
|
|
387
399
|
}
|
|
388
400
|
return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsx(
|
|
@@ -390,26 +402,26 @@ function Ue({
|
|
|
390
402
|
{
|
|
391
403
|
rapidlyChangingMotionState: e,
|
|
392
404
|
dhParameters: r,
|
|
393
|
-
onRotationChanged:
|
|
405
|
+
onRotationChanged: a,
|
|
394
406
|
children: /* @__PURE__ */ t.jsxs("group", { ...n, name: "Scene", children: [
|
|
395
407
|
/* @__PURE__ */ t.jsxs("mesh", { children: [
|
|
396
408
|
/* @__PURE__ */ t.jsx("sphereGeometry", { args: [0.01, 32, 32] }),
|
|
397
409
|
/* @__PURE__ */ t.jsx("meshStandardMaterial", { color: "black", depthTest: !0 })
|
|
398
410
|
] }),
|
|
399
|
-
r.map((d,
|
|
400
|
-
const { a:
|
|
411
|
+
r.map((d, m) => {
|
|
412
|
+
const { a: i, b: c } = s(
|
|
401
413
|
d,
|
|
402
|
-
e.joint_position[
|
|
403
|
-
),
|
|
404
|
-
return /* @__PURE__ */ t.jsxs("group", { name:
|
|
414
|
+
e.joint_position[m] ?? 0
|
|
415
|
+
), h = `dhrobot_J0${m}`;
|
|
416
|
+
return /* @__PURE__ */ t.jsxs("group", { name: h, children: [
|
|
405
417
|
/* @__PURE__ */ t.jsx(
|
|
406
418
|
J,
|
|
407
419
|
{
|
|
408
420
|
ref: (y) => {
|
|
409
|
-
o.current[
|
|
421
|
+
o.current[m] = y;
|
|
410
422
|
},
|
|
411
|
-
name:
|
|
412
|
-
points: [
|
|
423
|
+
name: De,
|
|
424
|
+
points: [i, c],
|
|
413
425
|
color: "white",
|
|
414
426
|
lineWidth: 5
|
|
415
427
|
}
|
|
@@ -418,18 +430,18 @@ function Ue({
|
|
|
418
430
|
"mesh",
|
|
419
431
|
{
|
|
420
432
|
ref: (y) => {
|
|
421
|
-
|
|
433
|
+
f.current[m] = y;
|
|
422
434
|
},
|
|
423
435
|
name: Oe,
|
|
424
|
-
position:
|
|
436
|
+
position: c,
|
|
425
437
|
children: [
|
|
426
438
|
/* @__PURE__ */ t.jsx("sphereGeometry", { args: [0.01, 32, 32] }),
|
|
427
439
|
/* @__PURE__ */ t.jsx("meshStandardMaterial", { color: "black", depthTest: !0 })
|
|
428
440
|
]
|
|
429
441
|
},
|
|
430
|
-
"mesh_" +
|
|
442
|
+
"mesh_" + m
|
|
431
443
|
)
|
|
432
|
-
] },
|
|
444
|
+
] }, h);
|
|
433
445
|
})
|
|
434
446
|
] })
|
|
435
447
|
}
|
|
@@ -437,7 +449,7 @@ function Ue({
|
|
|
437
449
|
}
|
|
438
450
|
const Ee = console.warn;
|
|
439
451
|
function he() {
|
|
440
|
-
return
|
|
452
|
+
return v(() => {
|
|
441
453
|
console.warn = (e) => {
|
|
442
454
|
e !== "Cannot call the manual advancement of rafz whilst frameLoop is not set as demand" && Ee(e);
|
|
443
455
|
};
|
|
@@ -450,68 +462,68 @@ function Be({
|
|
|
450
462
|
url: e,
|
|
451
463
|
flangeRef: r,
|
|
452
464
|
postModelRender: n,
|
|
453
|
-
...
|
|
465
|
+
...l
|
|
454
466
|
}) {
|
|
455
|
-
const o =
|
|
456
|
-
let
|
|
467
|
+
const o = Ve(e);
|
|
468
|
+
let f;
|
|
457
469
|
try {
|
|
458
|
-
|
|
459
|
-
} catch (
|
|
460
|
-
throw
|
|
470
|
+
f = Ce(o, "robot.glb").gltf;
|
|
471
|
+
} catch (a) {
|
|
472
|
+
throw a;
|
|
461
473
|
}
|
|
462
|
-
const
|
|
463
|
-
(
|
|
464
|
-
|
|
474
|
+
const s = V(
|
|
475
|
+
(a) => {
|
|
476
|
+
a && n && n();
|
|
465
477
|
},
|
|
466
478
|
[n]
|
|
467
479
|
);
|
|
468
|
-
function
|
|
480
|
+
function u(a) {
|
|
469
481
|
try {
|
|
470
|
-
return Je(
|
|
482
|
+
return Je(a) ? a.geometry ? /* @__PURE__ */ t.jsx(
|
|
471
483
|
"mesh",
|
|
472
484
|
{
|
|
473
|
-
name:
|
|
474
|
-
geometry:
|
|
475
|
-
material:
|
|
476
|
-
position:
|
|
477
|
-
rotation:
|
|
485
|
+
name: a.name,
|
|
486
|
+
geometry: a.geometry,
|
|
487
|
+
material: a.material,
|
|
488
|
+
position: a.position,
|
|
489
|
+
rotation: a.rotation
|
|
478
490
|
},
|
|
479
|
-
|
|
480
|
-
) : /* @__PURE__ */ t.jsx("group", { name:
|
|
491
|
+
a.uuid
|
|
492
|
+
) : /* @__PURE__ */ t.jsx("group", { name: a.name, position: a.position, rotation: a.rotation }, a.uuid) : /* @__PURE__ */ t.jsx(
|
|
481
493
|
"group",
|
|
482
494
|
{
|
|
483
|
-
name:
|
|
484
|
-
position:
|
|
485
|
-
rotation:
|
|
486
|
-
ref: fe(
|
|
487
|
-
children:
|
|
495
|
+
name: a.name,
|
|
496
|
+
position: a.position,
|
|
497
|
+
rotation: a.rotation,
|
|
498
|
+
ref: fe(a) ? r : void 0,
|
|
499
|
+
children: a.children.map(u)
|
|
488
500
|
},
|
|
489
|
-
|
|
501
|
+
a.uuid
|
|
490
502
|
);
|
|
491
503
|
} catch (d) {
|
|
492
|
-
return console.warn("Error rendering node",
|
|
504
|
+
return console.warn("Error rendering node", a.name, d), null;
|
|
493
505
|
}
|
|
494
506
|
}
|
|
495
|
-
return /* @__PURE__ */ t.jsx("group", { ...
|
|
507
|
+
return /* @__PURE__ */ t.jsx("group", { ...l, dispose: null, ref: s, children: u(f.scene) });
|
|
496
508
|
}
|
|
497
509
|
function pe({
|
|
498
510
|
modelURL: e,
|
|
499
511
|
flangeRef: r,
|
|
500
512
|
postModelRender: n,
|
|
501
|
-
...
|
|
513
|
+
...l
|
|
502
514
|
}) {
|
|
503
|
-
const [o,
|
|
504
|
-
return
|
|
515
|
+
const [o, f] = A(null);
|
|
516
|
+
return v(() => {
|
|
505
517
|
(async () => {
|
|
506
518
|
try {
|
|
507
519
|
if (typeof e == "string")
|
|
508
|
-
|
|
520
|
+
f(e);
|
|
509
521
|
else {
|
|
510
|
-
const
|
|
511
|
-
u
|
|
522
|
+
const u = await e;
|
|
523
|
+
f(u);
|
|
512
524
|
}
|
|
513
|
-
} catch (
|
|
514
|
-
console.error("Failed to resolve model URL:",
|
|
525
|
+
} catch (u) {
|
|
526
|
+
console.error("Failed to resolve model URL:", u);
|
|
515
527
|
}
|
|
516
528
|
})();
|
|
517
529
|
}, [e]), o ? /* @__PURE__ */ t.jsx(
|
|
@@ -520,7 +532,7 @@ function pe({
|
|
|
520
532
|
url: o,
|
|
521
533
|
flangeRef: r,
|
|
522
534
|
postModelRender: n,
|
|
523
|
-
...
|
|
535
|
+
...l
|
|
524
536
|
}
|
|
525
537
|
) : null;
|
|
526
538
|
}
|
|
@@ -528,15 +540,15 @@ const xe = (e, r) => {
|
|
|
528
540
|
e.userData.isGhost || (e.traverse((n) => {
|
|
529
541
|
if (n instanceof x.Mesh) {
|
|
530
542
|
n.material instanceof x.Material && (n.material.colorWrite = !1);
|
|
531
|
-
const
|
|
532
|
-
|
|
543
|
+
const l = n.clone(), o = n.clone();
|
|
544
|
+
l.material = new x.MeshStandardMaterial({
|
|
533
545
|
depthTest: !0,
|
|
534
546
|
depthWrite: !0,
|
|
535
547
|
colorWrite: !1,
|
|
536
548
|
polygonOffset: !0,
|
|
537
549
|
polygonOffsetFactor: -1,
|
|
538
550
|
side: x.DoubleSide
|
|
539
|
-
}),
|
|
551
|
+
}), l.userData.isGhost = !0, o.material = new x.MeshStandardMaterial({
|
|
540
552
|
color: r,
|
|
541
553
|
opacity: 0.3,
|
|
542
554
|
depthTest: !0,
|
|
@@ -545,15 +557,15 @@ const xe = (e, r) => {
|
|
|
545
557
|
polygonOffset: !0,
|
|
546
558
|
polygonOffsetFactor: -2,
|
|
547
559
|
side: x.DoubleSide
|
|
548
|
-
}), o.userData.isGhost = !0, n.parent && (n.parent.add(
|
|
560
|
+
}), o.userData.isGhost = !0, n.parent && (n.parent.add(l), n.parent.add(o));
|
|
549
561
|
}
|
|
550
562
|
}), e.userData.isGhost = !0);
|
|
551
563
|
}, ye = (e) => {
|
|
552
564
|
if (!e.userData.isGhost) return;
|
|
553
565
|
const r = [];
|
|
554
566
|
e.traverse((n) => {
|
|
555
|
-
var
|
|
556
|
-
n instanceof x.Mesh && ((
|
|
567
|
+
var l;
|
|
568
|
+
n instanceof x.Mesh && ((l = n.userData) != null && l.isGhost ? r.push(n) : n.material instanceof x.Material && (n.material.colorWrite = !0));
|
|
557
569
|
}), r.forEach((n) => {
|
|
558
570
|
n.parent && n.parent.remove(n);
|
|
559
571
|
}), e.userData.isGhost = !1;
|
|
@@ -562,36 +574,36 @@ const xe = (e, r) => {
|
|
|
562
574
|
rapidlyChangingMotionState: e,
|
|
563
575
|
modelFromController: r,
|
|
564
576
|
dhParameters: n,
|
|
565
|
-
getModel:
|
|
577
|
+
getModel: l = D,
|
|
566
578
|
flangeRef: o,
|
|
567
|
-
postModelRender:
|
|
568
|
-
transparentColor:
|
|
569
|
-
instanceUrl:
|
|
570
|
-
...
|
|
579
|
+
postModelRender: f,
|
|
580
|
+
transparentColor: s,
|
|
581
|
+
instanceUrl: u,
|
|
582
|
+
...a
|
|
571
583
|
}) => {
|
|
572
|
-
const [d,
|
|
573
|
-
h
|
|
584
|
+
const [d, m] = A(null), i = V((h) => {
|
|
585
|
+
m(h);
|
|
574
586
|
}, []);
|
|
575
|
-
|
|
576
|
-
d && (
|
|
577
|
-
}, [d,
|
|
578
|
-
const
|
|
587
|
+
v(() => {
|
|
588
|
+
d && (s ? xe(d, s) : ye(d));
|
|
589
|
+
}, [d, s]);
|
|
590
|
+
const c = /* @__PURE__ */ t.jsx(
|
|
579
591
|
Ue,
|
|
580
592
|
{
|
|
581
593
|
rapidlyChangingMotionState: e,
|
|
582
594
|
dhParameters: n,
|
|
583
|
-
...
|
|
595
|
+
...a
|
|
584
596
|
}
|
|
585
597
|
);
|
|
586
598
|
return /* @__PURE__ */ t.jsxs(
|
|
587
599
|
ce,
|
|
588
600
|
{
|
|
589
|
-
fallback:
|
|
590
|
-
onError: (
|
|
591
|
-
console.warn(
|
|
601
|
+
fallback: c,
|
|
602
|
+
onError: (h) => {
|
|
603
|
+
console.warn(h);
|
|
592
604
|
},
|
|
593
605
|
children: [
|
|
594
|
-
/* @__PURE__ */ t.jsx(
|
|
606
|
+
/* @__PURE__ */ t.jsx(oe, { fallback: c, children: /* @__PURE__ */ t.jsx("group", { ref: i, children: /* @__PURE__ */ t.jsx(
|
|
595
607
|
me,
|
|
596
608
|
{
|
|
597
609
|
rapidlyChangingMotionState: e,
|
|
@@ -600,16 +612,16 @@ const xe = (e, r) => {
|
|
|
600
612
|
pe,
|
|
601
613
|
{
|
|
602
614
|
modelURL: (() => {
|
|
603
|
-
const
|
|
604
|
-
if (!
|
|
615
|
+
const h = l(r, u);
|
|
616
|
+
if (!h) {
|
|
605
617
|
const y = new Blob([], { type: "model/gltf-binary" }), p = new File([y], `${r}.glb`, { type: "model/gltf-binary" });
|
|
606
618
|
return Promise.resolve(URL.createObjectURL(p));
|
|
607
619
|
}
|
|
608
|
-
return
|
|
620
|
+
return h;
|
|
609
621
|
})(),
|
|
610
|
-
postModelRender:
|
|
622
|
+
postModelRender: f,
|
|
611
623
|
flangeRef: o,
|
|
612
|
-
...
|
|
624
|
+
...a
|
|
613
625
|
}
|
|
614
626
|
)
|
|
615
627
|
}
|
|
@@ -624,9 +636,9 @@ function We({
|
|
|
624
636
|
connectedMotionGroup: e,
|
|
625
637
|
getModel: r = D,
|
|
626
638
|
flangeRef: n,
|
|
627
|
-
transparentColor:
|
|
639
|
+
transparentColor: l,
|
|
628
640
|
postModelRender: o,
|
|
629
|
-
...
|
|
641
|
+
...f
|
|
630
642
|
}) {
|
|
631
643
|
return e.dhParameters ? /* @__PURE__ */ t.jsx(
|
|
632
644
|
ge,
|
|
@@ -636,56 +648,56 @@ function We({
|
|
|
636
648
|
dhParameters: e.dhParameters,
|
|
637
649
|
getModel: r,
|
|
638
650
|
flangeRef: n,
|
|
639
|
-
transparentColor:
|
|
651
|
+
transparentColor: l,
|
|
640
652
|
postModelRender: o,
|
|
641
|
-
...
|
|
653
|
+
...f
|
|
642
654
|
}
|
|
643
655
|
) : null;
|
|
644
656
|
}
|
|
645
657
|
const at = C(
|
|
646
|
-
|
|
658
|
+
Le(
|
|
647
659
|
({
|
|
648
660
|
robotName: e,
|
|
649
661
|
programState: r,
|
|
650
662
|
safetyState: n,
|
|
651
|
-
operationMode:
|
|
663
|
+
operationMode: l,
|
|
652
664
|
driveToHomeEnabled: o = !1,
|
|
653
|
-
onDriveToHomePress:
|
|
654
|
-
onDriveToHomeRelease:
|
|
655
|
-
connectedMotionGroup:
|
|
656
|
-
robotComponent:
|
|
665
|
+
onDriveToHomePress: f,
|
|
666
|
+
onDriveToHomeRelease: s,
|
|
667
|
+
connectedMotionGroup: u,
|
|
668
|
+
robotComponent: a = We,
|
|
657
669
|
customContentComponent: d,
|
|
658
|
-
className:
|
|
670
|
+
className: m
|
|
659
671
|
}) => {
|
|
660
672
|
var $;
|
|
661
|
-
const
|
|
662
|
-
|
|
663
|
-
const
|
|
673
|
+
const i = Te(), { t: c } = Ge(), [h, y] = A(!1), p = R(null), j = R(null), [g, O] = A(!1), [G, Re] = A({ width: 400, height: 600 }), [He, ve] = A(0);
|
|
674
|
+
v(() => {
|
|
675
|
+
const P = () => {
|
|
664
676
|
if (j.current) {
|
|
665
677
|
const { offsetWidth: N, offsetHeight: Y } = j.current;
|
|
666
|
-
|
|
678
|
+
O(N > Y), Re({ width: N, height: Y });
|
|
667
679
|
}
|
|
668
680
|
};
|
|
669
|
-
|
|
670
|
-
const H = new ResizeObserver(
|
|
681
|
+
P();
|
|
682
|
+
const H = new ResizeObserver(P);
|
|
671
683
|
return j.current && H.observe(j.current), () => {
|
|
672
684
|
H.disconnect();
|
|
673
685
|
};
|
|
674
686
|
}, []);
|
|
675
|
-
const B =
|
|
676
|
-
ve((
|
|
677
|
-
}, []),
|
|
678
|
-
!o || !
|
|
679
|
-
}, [o,
|
|
680
|
-
!o || !
|
|
681
|
-
}, [o,
|
|
682
|
-
|
|
683
|
-
}, [
|
|
687
|
+
const B = V(() => {
|
|
688
|
+
ve((P) => P + 1);
|
|
689
|
+
}, []), S = V(() => {
|
|
690
|
+
!o || !f || (y(!0), f());
|
|
691
|
+
}, [o, f]), k = V(() => {
|
|
692
|
+
!o || !s || (y(!1), s());
|
|
693
|
+
}, [o, s]), W = V(() => {
|
|
694
|
+
h && s && (y(!1), s());
|
|
695
|
+
}, [h, s]), _ = g ? G.width < 350 : G.height < 200, F = g ? G.height < 310 : G.height < 450;
|
|
684
696
|
return /* @__PURE__ */ t.jsx(
|
|
685
|
-
|
|
697
|
+
Ae,
|
|
686
698
|
{
|
|
687
699
|
ref: j,
|
|
688
|
-
className:
|
|
700
|
+
className: m,
|
|
689
701
|
sx: {
|
|
690
702
|
width: "100%",
|
|
691
703
|
height: "100%",
|
|
@@ -696,10 +708,10 @@ const at = C(
|
|
|
696
708
|
minWidth: { xs: 180, sm: 220, md: 250 },
|
|
697
709
|
minHeight: g ? { xs: 200, sm: 240, md: 260 } : { xs: 150, sm: 180, md: 220 },
|
|
698
710
|
// Allow progressive hiding in portrait mode
|
|
699
|
-
border: `1px solid ${
|
|
711
|
+
border: `1px solid ${i.palette.divider}`,
|
|
700
712
|
borderRadius: "18px",
|
|
701
713
|
boxShadow: "none",
|
|
702
|
-
backgroundColor: (($ =
|
|
714
|
+
backgroundColor: (($ = i.palette.backgroundPaperElevation) == null ? void 0 : $[8]) || "#2A2A3F",
|
|
703
715
|
backgroundImage: "none"
|
|
704
716
|
// Override any gradient from elevation
|
|
705
717
|
},
|
|
@@ -731,7 +743,7 @@ const at = C(
|
|
|
731
743
|
shadows: !0,
|
|
732
744
|
frameloop: "demand",
|
|
733
745
|
style: {
|
|
734
|
-
borderRadius:
|
|
746
|
+
borderRadius: i.shape.borderRadius,
|
|
735
747
|
width: "100%",
|
|
736
748
|
height: "100%",
|
|
737
749
|
background: "transparent",
|
|
@@ -744,9 +756,9 @@ const at = C(
|
|
|
744
756
|
children: [
|
|
745
757
|
/* @__PURE__ */ t.jsx(te, {}),
|
|
746
758
|
/* @__PURE__ */ t.jsx(X, { fit: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ t.jsx(
|
|
747
|
-
|
|
759
|
+
a,
|
|
748
760
|
{
|
|
749
|
-
connectedMotionGroup:
|
|
761
|
+
connectedMotionGroup: u,
|
|
750
762
|
postModelRender: B
|
|
751
763
|
}
|
|
752
764
|
) })
|
|
@@ -781,7 +793,7 @@ const at = C(
|
|
|
781
793
|
{
|
|
782
794
|
programState: r,
|
|
783
795
|
safetyState: n,
|
|
784
|
-
operationMode:
|
|
796
|
+
operationMode: l
|
|
785
797
|
}
|
|
786
798
|
)
|
|
787
799
|
]
|
|
@@ -799,15 +811,15 @@ const at = C(
|
|
|
799
811
|
justifyContent: "space-between"
|
|
800
812
|
},
|
|
801
813
|
children: [
|
|
802
|
-
!
|
|
814
|
+
!F && d && /* @__PURE__ */ t.jsxs(b, { children: [
|
|
803
815
|
/* @__PURE__ */ t.jsx(d, {}),
|
|
804
816
|
/* @__PURE__ */ t.jsx(
|
|
805
|
-
|
|
817
|
+
Q,
|
|
806
818
|
{
|
|
807
819
|
sx: {
|
|
808
820
|
mt: 1,
|
|
809
821
|
mb: 0,
|
|
810
|
-
borderColor:
|
|
822
|
+
borderColor: i.palette.divider,
|
|
811
823
|
opacity: 0.5
|
|
812
824
|
}
|
|
813
825
|
}
|
|
@@ -817,7 +829,7 @@ const at = C(
|
|
|
817
829
|
b,
|
|
818
830
|
{
|
|
819
831
|
sx: {
|
|
820
|
-
mt: !
|
|
832
|
+
mt: !F && d ? "auto" : 0
|
|
821
833
|
},
|
|
822
834
|
children: /* @__PURE__ */ t.jsx(
|
|
823
835
|
b,
|
|
@@ -829,24 +841,24 @@ const at = C(
|
|
|
829
841
|
mb: { xs: 0.5, sm: 0.75, md: 1 }
|
|
830
842
|
},
|
|
831
843
|
children: /* @__PURE__ */ t.jsx(
|
|
832
|
-
|
|
844
|
+
Z,
|
|
833
845
|
{
|
|
834
846
|
ref: p,
|
|
835
847
|
variant: "contained",
|
|
836
848
|
color: "secondary",
|
|
837
849
|
size: "small",
|
|
838
850
|
disabled: !o,
|
|
839
|
-
onMouseDown:
|
|
840
|
-
onMouseUp:
|
|
851
|
+
onMouseDown: S,
|
|
852
|
+
onMouseUp: k,
|
|
841
853
|
onMouseLeave: W,
|
|
842
|
-
onTouchStart:
|
|
843
|
-
onTouchEnd:
|
|
854
|
+
onTouchStart: S,
|
|
855
|
+
onTouchEnd: k,
|
|
844
856
|
sx: {
|
|
845
857
|
textTransform: "none",
|
|
846
858
|
px: 1.5,
|
|
847
859
|
py: 0.5
|
|
848
860
|
},
|
|
849
|
-
children:
|
|
861
|
+
children: c("RobotCard.DriveToHome.bt")
|
|
850
862
|
}
|
|
851
863
|
)
|
|
852
864
|
}
|
|
@@ -876,7 +888,7 @@ const at = C(
|
|
|
876
888
|
{
|
|
877
889
|
programState: r,
|
|
878
890
|
safetyState: n,
|
|
879
|
-
operationMode:
|
|
891
|
+
operationMode: l
|
|
880
892
|
}
|
|
881
893
|
)
|
|
882
894
|
] }),
|
|
@@ -903,7 +915,7 @@ const at = C(
|
|
|
903
915
|
shadows: !0,
|
|
904
916
|
frameloop: "demand",
|
|
905
917
|
style: {
|
|
906
|
-
borderRadius:
|
|
918
|
+
borderRadius: i.shape.borderRadius,
|
|
907
919
|
width: "100%",
|
|
908
920
|
height: "100%",
|
|
909
921
|
background: "transparent",
|
|
@@ -914,9 +926,9 @@ const at = C(
|
|
|
914
926
|
children: [
|
|
915
927
|
/* @__PURE__ */ t.jsx(te, {}),
|
|
916
928
|
/* @__PURE__ */ t.jsx(X, { fit: !0, clip: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ t.jsx(
|
|
917
|
-
|
|
929
|
+
a,
|
|
918
930
|
{
|
|
919
|
-
connectedMotionGroup:
|
|
931
|
+
connectedMotionGroup: u,
|
|
920
932
|
postModelRender: B
|
|
921
933
|
}
|
|
922
934
|
) })
|
|
@@ -926,15 +938,15 @@ const at = C(
|
|
|
926
938
|
}
|
|
927
939
|
),
|
|
928
940
|
/* @__PURE__ */ t.jsxs(b, { children: [
|
|
929
|
-
!
|
|
941
|
+
!F && d && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
930
942
|
/* @__PURE__ */ t.jsx(d, {}),
|
|
931
943
|
/* @__PURE__ */ t.jsx(
|
|
932
|
-
|
|
944
|
+
Q,
|
|
933
945
|
{
|
|
934
946
|
sx: {
|
|
935
947
|
mt: 1,
|
|
936
948
|
mb: 0,
|
|
937
|
-
borderColor:
|
|
949
|
+
borderColor: i.palette.divider,
|
|
938
950
|
opacity: 0.5
|
|
939
951
|
}
|
|
940
952
|
}
|
|
@@ -946,28 +958,28 @@ const at = C(
|
|
|
946
958
|
sx: {
|
|
947
959
|
display: "flex",
|
|
948
960
|
justifyContent: "flex-start",
|
|
949
|
-
mt: !
|
|
961
|
+
mt: !F && d ? { xs: 1, sm: 2, md: 5 } : { xs: 0.5, sm: 1, md: 2 },
|
|
950
962
|
mb: { xs: 0.5, sm: 0.75, md: 1 }
|
|
951
963
|
},
|
|
952
964
|
children: /* @__PURE__ */ t.jsx(
|
|
953
|
-
|
|
965
|
+
Z,
|
|
954
966
|
{
|
|
955
967
|
ref: p,
|
|
956
968
|
variant: "contained",
|
|
957
969
|
color: "secondary",
|
|
958
970
|
size: "small",
|
|
959
971
|
disabled: !o,
|
|
960
|
-
onMouseDown:
|
|
961
|
-
onMouseUp:
|
|
972
|
+
onMouseDown: S,
|
|
973
|
+
onMouseUp: k,
|
|
962
974
|
onMouseLeave: W,
|
|
963
|
-
onTouchStart:
|
|
964
|
-
onTouchEnd:
|
|
975
|
+
onTouchStart: S,
|
|
976
|
+
onTouchEnd: k,
|
|
965
977
|
sx: {
|
|
966
978
|
textTransform: "none",
|
|
967
979
|
px: 1.5,
|
|
968
980
|
py: 0.5
|
|
969
981
|
},
|
|
970
|
-
children:
|
|
982
|
+
children: c("RobotCard.DriveToHome.bt")
|
|
971
983
|
}
|
|
972
984
|
)
|
|
973
985
|
}
|
|
@@ -985,66 +997,66 @@ function je({
|
|
|
985
997
|
rapidlyChangingMotionState: e,
|
|
986
998
|
dhParameters: r,
|
|
987
999
|
onTranslationChanged: n,
|
|
988
|
-
children:
|
|
1000
|
+
children: l
|
|
989
1001
|
}) {
|
|
990
|
-
const o = R([]),
|
|
991
|
-
|
|
992
|
-
const
|
|
993
|
-
(
|
|
1002
|
+
const o = R([]), f = R([]), s = R(null), { invalidate: u } = se();
|
|
1003
|
+
v(() => {
|
|
1004
|
+
const i = e.joint_position.filter(
|
|
1005
|
+
(c) => c !== void 0
|
|
994
1006
|
);
|
|
995
|
-
return
|
|
1007
|
+
return s.current = new ae(i, {
|
|
996
1008
|
tension: 120,
|
|
997
1009
|
// Controls spring stiffness - higher values create faster, more responsive motion
|
|
998
1010
|
friction: 20,
|
|
999
1011
|
// Controls damping - higher values reduce oscillation and create smoother settling
|
|
1000
1012
|
threshold: 1e-3
|
|
1001
1013
|
}), () => {
|
|
1002
|
-
var
|
|
1003
|
-
(
|
|
1014
|
+
var c;
|
|
1015
|
+
(c = s.current) == null || c.destroy();
|
|
1004
1016
|
};
|
|
1005
|
-
}, []),
|
|
1006
|
-
if (
|
|
1007
|
-
const
|
|
1008
|
-
d(),
|
|
1017
|
+
}, []), ie((i, c) => {
|
|
1018
|
+
if (s.current) {
|
|
1019
|
+
const h = s.current.update(c);
|
|
1020
|
+
d(), h || u();
|
|
1009
1021
|
}
|
|
1010
1022
|
});
|
|
1011
|
-
function
|
|
1012
|
-
|
|
1023
|
+
function a(i) {
|
|
1024
|
+
i && (f.current = ue(i), d(), u());
|
|
1013
1025
|
}
|
|
1014
1026
|
function d() {
|
|
1015
|
-
var
|
|
1016
|
-
const
|
|
1027
|
+
var c;
|
|
1028
|
+
const i = ((c = s.current) == null ? void 0 : c.getCurrentValues()) || [];
|
|
1017
1029
|
if (n)
|
|
1018
|
-
n(
|
|
1030
|
+
n(f.current, i);
|
|
1019
1031
|
else
|
|
1020
|
-
for (const [
|
|
1021
|
-
const j = r[
|
|
1022
|
-
y.position.y = j * (
|
|
1032
|
+
for (const [h, y] of f.current.entries()) {
|
|
1033
|
+
const j = r[h].reverse_rotation_direction ? -1 : 1;
|
|
1034
|
+
y.position.y = j * (i[h] || 0) / 1e3;
|
|
1023
1035
|
}
|
|
1024
1036
|
}
|
|
1025
|
-
const
|
|
1026
|
-
const
|
|
1027
|
-
(
|
|
1037
|
+
const m = V(() => {
|
|
1038
|
+
const i = e.joint_position.filter(
|
|
1039
|
+
(c) => c !== void 0
|
|
1028
1040
|
);
|
|
1029
1041
|
requestAnimationFrame(() => {
|
|
1030
|
-
var
|
|
1031
|
-
o.current =
|
|
1042
|
+
var c;
|
|
1043
|
+
o.current = i, (c = s.current) == null || c.setTarget(i);
|
|
1032
1044
|
});
|
|
1033
1045
|
}, [e]);
|
|
1034
|
-
return
|
|
1035
|
-
|
|
1036
|
-
}, [e,
|
|
1037
|
-
|
|
1038
|
-
}), /* @__PURE__ */ t.jsx("group", { ref:
|
|
1046
|
+
return v(() => {
|
|
1047
|
+
m();
|
|
1048
|
+
}, [e, m]), le(() => {
|
|
1049
|
+
m();
|
|
1050
|
+
}), /* @__PURE__ */ t.jsx("group", { ref: a, children: l });
|
|
1039
1051
|
}
|
|
1040
1052
|
function we({
|
|
1041
1053
|
rapidlyChangingMotionState: e,
|
|
1042
1054
|
dhParameters: r,
|
|
1043
1055
|
...n
|
|
1044
1056
|
}) {
|
|
1045
|
-
const
|
|
1046
|
-
function
|
|
1047
|
-
const
|
|
1057
|
+
const l = new w(), o = R(null), f = R(null);
|
|
1058
|
+
function s(d) {
|
|
1059
|
+
const m = new w();
|
|
1048
1060
|
for (let y = 0; y < r.length; y++) {
|
|
1049
1061
|
const p = r[y], j = d[y] ?? 0, g = new w().makeRotationY(p.theta).multiply(
|
|
1050
1062
|
new w().makeTranslation(
|
|
@@ -1053,29 +1065,29 @@ function we({
|
|
|
1053
1065
|
0
|
|
1054
1066
|
)
|
|
1055
1067
|
).multiply(new w().makeRotationX(p.alpha));
|
|
1056
|
-
|
|
1068
|
+
m.multiply(g);
|
|
1057
1069
|
}
|
|
1058
|
-
const
|
|
1059
|
-
return
|
|
1070
|
+
const i = new T(), c = new E(), h = new T();
|
|
1071
|
+
return m.decompose(i, c, h), i;
|
|
1060
1072
|
}
|
|
1061
|
-
const
|
|
1062
|
-
function
|
|
1063
|
-
|
|
1064
|
-
let
|
|
1073
|
+
const u = s(e.joint_position);
|
|
1074
|
+
function a(d, m) {
|
|
1075
|
+
l.identity();
|
|
1076
|
+
let i = new T();
|
|
1065
1077
|
for (let p = 0; p < r.length; p++) {
|
|
1066
|
-
const j =
|
|
1078
|
+
const j = m[p] ?? 0, g = r[p], O = new w().makeRotationY(g.theta).multiply(
|
|
1067
1079
|
new w().makeTranslation(
|
|
1068
1080
|
g.a / 1e3,
|
|
1069
1081
|
(g.d + j * (g.reverse_rotation_direction ? -1 : 1)) / 1e3,
|
|
1070
1082
|
0
|
|
1071
1083
|
)
|
|
1072
1084
|
).multiply(new w().makeRotationX(g.alpha));
|
|
1073
|
-
|
|
1085
|
+
l.multiply(O);
|
|
1074
1086
|
}
|
|
1075
|
-
const
|
|
1076
|
-
if (
|
|
1077
|
-
const p =
|
|
1078
|
-
p && p.setPositions && p.setPositions([0, 0, 0,
|
|
1087
|
+
const c = new T(), h = new E(), y = new T();
|
|
1088
|
+
if (l.decompose(c, h, y), i = c, o.current && o.current.position.set(i.x, i.y, i.z), f.current) {
|
|
1089
|
+
const p = f.current.geometry;
|
|
1090
|
+
p && p.setPositions && p.setPositions([0, 0, 0, i.x, i.y, i.z]);
|
|
1079
1091
|
}
|
|
1080
1092
|
}
|
|
1081
1093
|
return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsx(
|
|
@@ -1083,7 +1095,7 @@ function we({
|
|
|
1083
1095
|
{
|
|
1084
1096
|
rapidlyChangingMotionState: e,
|
|
1085
1097
|
dhParameters: r,
|
|
1086
|
-
onTranslationChanged:
|
|
1098
|
+
onTranslationChanged: a,
|
|
1087
1099
|
children: /* @__PURE__ */ t.jsxs("group", { ...n, name: "Scene", children: [
|
|
1088
1100
|
/* @__PURE__ */ t.jsxs("mesh", { name: "Base", position: [0, 0, 0], children: [
|
|
1089
1101
|
/* @__PURE__ */ t.jsx("sphereGeometry", { args: [0.02, 32, 32] }),
|
|
@@ -1092,13 +1104,13 @@ function we({
|
|
|
1092
1104
|
/* @__PURE__ */ t.jsx(
|
|
1093
1105
|
J,
|
|
1094
1106
|
{
|
|
1095
|
-
ref:
|
|
1096
|
-
points: [new
|
|
1107
|
+
ref: f,
|
|
1108
|
+
points: [new T(0, 0, 0), u],
|
|
1097
1109
|
color: "White",
|
|
1098
1110
|
lineWidth: 5
|
|
1099
1111
|
}
|
|
1100
1112
|
),
|
|
1101
|
-
/* @__PURE__ */ t.jsxs("mesh", { ref: o, name: "TCP", position:
|
|
1113
|
+
/* @__PURE__ */ t.jsxs("mesh", { ref: o, name: "TCP", position: u, children: [
|
|
1102
1114
|
/* @__PURE__ */ t.jsx("sphereGeometry", { args: [0.025, 32, 32] }),
|
|
1103
1115
|
/* @__PURE__ */ t.jsx("meshStandardMaterial", { color: "red", depthTest: !0 })
|
|
1104
1116
|
] })
|
|
@@ -1111,36 +1123,36 @@ const be = C(
|
|
|
1111
1123
|
rapidlyChangingMotionState: e,
|
|
1112
1124
|
modelFromController: r,
|
|
1113
1125
|
dhParameters: n,
|
|
1114
|
-
getModel:
|
|
1126
|
+
getModel: l = D,
|
|
1115
1127
|
flangeRef: o,
|
|
1116
|
-
postModelRender:
|
|
1117
|
-
transparentColor:
|
|
1118
|
-
instanceUrl:
|
|
1119
|
-
...
|
|
1128
|
+
postModelRender: f,
|
|
1129
|
+
transparentColor: s,
|
|
1130
|
+
instanceUrl: u,
|
|
1131
|
+
...a
|
|
1120
1132
|
}) => {
|
|
1121
|
-
const [d,
|
|
1122
|
-
h
|
|
1133
|
+
const [d, m] = A(null), i = V((h) => {
|
|
1134
|
+
m(h);
|
|
1123
1135
|
}, []);
|
|
1124
|
-
|
|
1125
|
-
d && (
|
|
1126
|
-
}, [d,
|
|
1127
|
-
const
|
|
1136
|
+
v(() => {
|
|
1137
|
+
d && (s ? xe(d, s) : ye(d));
|
|
1138
|
+
}, [d, s]);
|
|
1139
|
+
const c = /* @__PURE__ */ t.jsx(
|
|
1128
1140
|
we,
|
|
1129
1141
|
{
|
|
1130
1142
|
rapidlyChangingMotionState: e,
|
|
1131
1143
|
dhParameters: n,
|
|
1132
|
-
...
|
|
1144
|
+
...a
|
|
1133
1145
|
}
|
|
1134
1146
|
);
|
|
1135
1147
|
return /* @__PURE__ */ t.jsxs(
|
|
1136
1148
|
ce,
|
|
1137
1149
|
{
|
|
1138
|
-
fallback:
|
|
1139
|
-
onError: (
|
|
1140
|
-
console.warn(
|
|
1150
|
+
fallback: c,
|
|
1151
|
+
onError: (h) => {
|
|
1152
|
+
console.warn(h);
|
|
1141
1153
|
},
|
|
1142
1154
|
children: [
|
|
1143
|
-
/* @__PURE__ */ t.jsx(
|
|
1155
|
+
/* @__PURE__ */ t.jsx(oe, { fallback: c, children: /* @__PURE__ */ t.jsx("group", { ref: i, children: /* @__PURE__ */ t.jsx(
|
|
1144
1156
|
je,
|
|
1145
1157
|
{
|
|
1146
1158
|
rapidlyChangingMotionState: e,
|
|
@@ -1149,16 +1161,16 @@ const be = C(
|
|
|
1149
1161
|
pe,
|
|
1150
1162
|
{
|
|
1151
1163
|
modelURL: (() => {
|
|
1152
|
-
const
|
|
1153
|
-
if (!
|
|
1164
|
+
const h = l(r, u);
|
|
1165
|
+
if (!h) {
|
|
1154
1166
|
const y = new Blob([], { type: "model/gltf-binary" }), p = new File([y], `${r}.glb`, { type: "model/gltf-binary" });
|
|
1155
1167
|
return Promise.resolve(URL.createObjectURL(p));
|
|
1156
1168
|
}
|
|
1157
|
-
return
|
|
1169
|
+
return h;
|
|
1158
1170
|
})(),
|
|
1159
|
-
postModelRender:
|
|
1171
|
+
postModelRender: f,
|
|
1160
1172
|
flangeRef: o,
|
|
1161
|
-
...
|
|
1173
|
+
...a
|
|
1162
1174
|
}
|
|
1163
1175
|
)
|
|
1164
1176
|
}
|
|
@@ -1173,39 +1185,39 @@ function ct({
|
|
|
1173
1185
|
connectedMotionGroup: e,
|
|
1174
1186
|
getModel: r = D,
|
|
1175
1187
|
flangeRef: n,
|
|
1176
|
-
transparentColor:
|
|
1188
|
+
transparentColor: l,
|
|
1177
1189
|
postModelRender: o,
|
|
1178
|
-
...
|
|
1190
|
+
...f
|
|
1179
1191
|
}) {
|
|
1180
1192
|
if (!e.dhParameters)
|
|
1181
1193
|
return null;
|
|
1182
|
-
const
|
|
1183
|
-
return
|
|
1194
|
+
const s = e.modelFromController || "";
|
|
1195
|
+
return s && r(s) ? /* @__PURE__ */ t.jsx(
|
|
1184
1196
|
be,
|
|
1185
1197
|
{
|
|
1186
1198
|
rapidlyChangingMotionState: e.rapidlyChangingMotionState,
|
|
1187
|
-
modelFromController:
|
|
1199
|
+
modelFromController: s,
|
|
1188
1200
|
dhParameters: e.dhParameters,
|
|
1189
1201
|
getModel: r,
|
|
1190
1202
|
flangeRef: n,
|
|
1191
|
-
transparentColor:
|
|
1203
|
+
transparentColor: l,
|
|
1192
1204
|
postModelRender: o,
|
|
1193
|
-
...
|
|
1205
|
+
...f
|
|
1194
1206
|
}
|
|
1195
1207
|
) : /* @__PURE__ */ t.jsx(
|
|
1196
1208
|
we,
|
|
1197
1209
|
{
|
|
1198
1210
|
rapidlyChangingMotionState: e.rapidlyChangingMotionState,
|
|
1199
1211
|
dhParameters: e.dhParameters,
|
|
1200
|
-
...
|
|
1212
|
+
...f
|
|
1201
1213
|
}
|
|
1202
1214
|
);
|
|
1203
1215
|
}
|
|
1204
1216
|
const ne = {
|
|
1205
|
-
[
|
|
1206
|
-
[
|
|
1207
|
-
[
|
|
1208
|
-
[
|
|
1217
|
+
[M.Abb]: [0, 0, 0, 0, Math.PI / 2, 0, 0],
|
|
1218
|
+
[M.Fanuc]: [0, 0, 0, 0, -Math.PI / 2, 0, 0],
|
|
1219
|
+
[M.Yaskawa]: [0, 0, 0, 0, -Math.PI / 2, 0, 0],
|
|
1220
|
+
[M.Kuka]: [
|
|
1209
1221
|
0,
|
|
1210
1222
|
-Math.PI / 2,
|
|
1211
1223
|
Math.PI / 2,
|
|
@@ -1214,7 +1226,7 @@ const ne = {
|
|
|
1214
1226
|
0,
|
|
1215
1227
|
0
|
|
1216
1228
|
],
|
|
1217
|
-
[
|
|
1229
|
+
[M.Universalrobots]: [
|
|
1218
1230
|
0,
|
|
1219
1231
|
-Math.PI / 2,
|
|
1220
1232
|
-Math.PI / 2,
|
|
@@ -1228,15 +1240,15 @@ function $e(e) {
|
|
|
1228
1240
|
const [r] = e.split("_");
|
|
1229
1241
|
switch (r) {
|
|
1230
1242
|
case "ABB":
|
|
1231
|
-
return
|
|
1243
|
+
return M.Abb;
|
|
1232
1244
|
case "FANUC":
|
|
1233
|
-
return
|
|
1245
|
+
return M.Fanuc;
|
|
1234
1246
|
case "YASKAWA":
|
|
1235
|
-
return
|
|
1247
|
+
return M.Yaskawa;
|
|
1236
1248
|
case "KUKA":
|
|
1237
|
-
return
|
|
1249
|
+
return M.Kuka;
|
|
1238
1250
|
case "UniversalRobots":
|
|
1239
|
-
return
|
|
1251
|
+
return M.Universalrobots;
|
|
1240
1252
|
default:
|
|
1241
1253
|
return null;
|
|
1242
1254
|
}
|
|
@@ -1249,13 +1261,13 @@ const ft = C((e) => {
|
|
|
1249
1261
|
const {
|
|
1250
1262
|
inverseSolver: r,
|
|
1251
1263
|
dhParameters: n,
|
|
1252
|
-
...
|
|
1253
|
-
} = e, [o,
|
|
1254
|
-
|
|
1255
|
-
n.length &&
|
|
1264
|
+
...l
|
|
1265
|
+
} = e, [o, f] = A(I.RevoluteJoint);
|
|
1266
|
+
v(() => {
|
|
1267
|
+
n.length && f(n[0].type ?? I.RevoluteJoint);
|
|
1256
1268
|
}, [n]);
|
|
1257
|
-
const
|
|
1258
|
-
return
|
|
1269
|
+
const s = z(() => r === null && o === I.RevoluteJoint, [r, o]), u = z(() => r === null && o === I.PrismaticJoint, [r, o]);
|
|
1270
|
+
return z(() => !!r, [r]) || s ? /* @__PURE__ */ t.jsx(ge, { dhParameters: n, ...l }) : u ? /* @__PURE__ */ t.jsx(be, { dhParameters: n, ...l }) : /* @__PURE__ */ t.jsx(t.Fragment, {});
|
|
1259
1271
|
});
|
|
1260
1272
|
export {
|
|
1261
1273
|
ot as C,
|
|
@@ -1274,4 +1286,4 @@ export {
|
|
|
1274
1286
|
$e as g,
|
|
1275
1287
|
ut as h
|
|
1276
1288
|
};
|
|
1277
|
-
//# sourceMappingURL=MotionGroupVisualizer-
|
|
1289
|
+
//# sourceMappingURL=MotionGroupVisualizer-Ce9kTMPy.js.map
|