@wandelbots/wandelbots-js-react-components 4.4.0 → 4.4.1-pr.feat-RB-3263-safety-zone-renderer.534.4a76331
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-Catdk92m.js → MotionGroupVisualizer-G_LEBwiv.js} +142 -146
- package/dist/MotionGroupVisualizer-G_LEBwiv.js.map +1 -0
- package/dist/MotionGroupVisualizer-RIIc_o05.cjs +2 -0
- package/dist/MotionGroupVisualizer-RIIc_o05.cjs.map +1 -0
- package/dist/components/3d-viewport/SafetyZonesRenderer.d.ts +2 -2
- package/dist/components/3d-viewport/SafetyZonesRenderer.d.ts.map +1 -1
- package/dist/components/robots/MotionGroupVisualizer.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 +17 -22
- package/src/components/robots/MotionGroupVisualizer.tsx +4 -0
- package/dist/MotionGroupVisualizer-Catdk92m.js.map +0 -1
- package/dist/MotionGroupVisualizer-DePl371W.cjs +0 -2
- package/dist/MotionGroupVisualizer-DePl371W.cjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as t, e as
|
|
1
|
+
import { j as t, e as z } from "./externalizeComponent-Dc3fViZA.js";
|
|
2
2
|
import * as x from "three";
|
|
3
3
|
import { Matrix4 as w, Vector3 as L, Quaternion as E } from "three";
|
|
4
4
|
import { ConvexGeometry as re } from "three-stdlib";
|
|
@@ -7,8 +7,8 @@ import { Environment as Me, Lightformer as G, Line as J, useGLTF as _e, Bounds a
|
|
|
7
7
|
import { useTheme as Te, Card as Le, Box as b, Typography as K, Divider as Z, Button as Q } from "@mui/material";
|
|
8
8
|
import { observer as Ve } from "mobx-react-lite";
|
|
9
9
|
import Ge, { useRef as R, useEffect as M, useCallback as T, useState as V, Suspense as ie, useMemo as O } from "react";
|
|
10
|
-
import { useTranslation as
|
|
11
|
-
import { N as
|
|
10
|
+
import { useTranslation as ke } from "react-i18next";
|
|
11
|
+
import { N as Fe, V as ae, c as le, b as ee, M as v, J as I } from "./interpolation-Chyc6Hfo.js";
|
|
12
12
|
import { ErrorBoundary as ce } from "react-error-boundary";
|
|
13
13
|
function Pe(e) {
|
|
14
14
|
switch (e.shape_type) {
|
|
@@ -172,12 +172,12 @@ 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
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), i = new x.Vector3(e[2].x, e[2].y, e[2].z), o = new x.Vector3().subVectors(n, r), u = new x.Vector3().subVectors(i, r), a = new x.Vector3().crossVectors(o, u).normalize();
|
|
179
179
|
for (let f = 3; f < e.length; f++) {
|
|
180
|
-
const
|
|
180
|
+
const l = new x.Vector3(e[f].x, e[f].y, e[f].z), d = new x.Vector3().subVectors(l, r), h = a.dot(d);
|
|
181
181
|
if (Math.abs(h) > 1e-6)
|
|
182
182
|
return console.log("Vertices are not on the same plane"), { isCoplanar: !1 };
|
|
183
183
|
}
|
|
@@ -187,41 +187,37 @@ function st({
|
|
|
187
187
|
safetyZones: e,
|
|
188
188
|
...r
|
|
189
189
|
}) {
|
|
190
|
-
return /* @__PURE__ */ t.jsx("group", { ...r, children: e.map((n, i) => {
|
|
190
|
+
return /* @__PURE__ */ t.jsx("group", { ...r, children: Object.values(e ?? {}).map((n, i) => {
|
|
191
191
|
let o = [];
|
|
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
|
-
i
|
|
223
|
-
) }, `${i}-${a}`);
|
|
224
|
-
});
|
|
192
|
+
Object.keys(n.shape).includes("vertices") && (o = n.shape.vertices);
|
|
193
|
+
const u = o.map((l) => new x.Vector3(l[0] / 1e3, l[1] / 1e3, l[2] / 1e3)), a = ze(u);
|
|
194
|
+
if (a.isCoplanar && a.normal) {
|
|
195
|
+
const d = new x.Vector3().addVectors(
|
|
196
|
+
u[0],
|
|
197
|
+
a.normal.multiplyScalar(1e-4)
|
|
198
|
+
);
|
|
199
|
+
u.push(d);
|
|
200
|
+
}
|
|
201
|
+
let f;
|
|
202
|
+
try {
|
|
203
|
+
f = new re(u);
|
|
204
|
+
} catch (l) {
|
|
205
|
+
return console.log("Error creating ConvexGeometry:", l), null;
|
|
206
|
+
}
|
|
207
|
+
return /* @__PURE__ */ t.jsx("mesh", { geometry: f, children: /* @__PURE__ */ t.jsx(
|
|
208
|
+
"meshStandardMaterial",
|
|
209
|
+
{
|
|
210
|
+
attach: "material",
|
|
211
|
+
color: "#009f4d",
|
|
212
|
+
opacity: 0.2,
|
|
213
|
+
depthTest: !1,
|
|
214
|
+
depthWrite: !1,
|
|
215
|
+
transparent: !0,
|
|
216
|
+
polygonOffset: !0,
|
|
217
|
+
polygonOffsetFactor: -i
|
|
218
|
+
},
|
|
219
|
+
i
|
|
220
|
+
) }, `${i}}`);
|
|
225
221
|
}) });
|
|
226
222
|
}
|
|
227
223
|
function it({
|
|
@@ -246,15 +242,15 @@ function it({
|
|
|
246
242
|
) });
|
|
247
243
|
}
|
|
248
244
|
const U = /* @__PURE__ */ new Map();
|
|
249
|
-
async function
|
|
245
|
+
async function C(e, r) {
|
|
250
246
|
if (U.has(e))
|
|
251
247
|
return U.get(e);
|
|
252
248
|
const n = (async () => {
|
|
253
249
|
var a;
|
|
254
|
-
const i = r || "", o = new
|
|
250
|
+
const i = r || "", o = new Fe({ instanceUrl: i }), u = o.api.motionGroupModels;
|
|
255
251
|
(a = u.axios) != null && a.interceptors && u.axios.interceptors.request.use((f) => {
|
|
256
|
-
var
|
|
257
|
-
return (
|
|
252
|
+
var l;
|
|
253
|
+
return (l = f.url) != null && l.includes("/glb") && (f.responseType = "blob"), f;
|
|
258
254
|
});
|
|
259
255
|
try {
|
|
260
256
|
const f = await o.api.motionGroupModels.getMotionGroupGlbModel(e);
|
|
@@ -277,7 +273,7 @@ function fe(e) {
|
|
|
277
273
|
function de(e) {
|
|
278
274
|
return /_J[0-9]+$/.test(e.name);
|
|
279
275
|
}
|
|
280
|
-
function
|
|
276
|
+
function Ce(e, r) {
|
|
281
277
|
let n;
|
|
282
278
|
function i(o) {
|
|
283
279
|
if (fe(o)) {
|
|
@@ -304,7 +300,7 @@ function me({
|
|
|
304
300
|
const o = R([]), u = R([]), a = R(null), { invalidate: f } = oe();
|
|
305
301
|
M(() => {
|
|
306
302
|
const s = e.joint_position.filter(
|
|
307
|
-
(
|
|
303
|
+
(c) => c !== void 0
|
|
308
304
|
);
|
|
309
305
|
return a.current = new ae(s, {
|
|
310
306
|
tension: 120,
|
|
@@ -313,21 +309,21 @@ function me({
|
|
|
313
309
|
// Controls damping - higher values reduce oscillation and create smoother settling
|
|
314
310
|
threshold: 1e-3
|
|
315
311
|
}), () => {
|
|
316
|
-
var
|
|
317
|
-
(
|
|
312
|
+
var c;
|
|
313
|
+
(c = a.current) == null || c.destroy();
|
|
318
314
|
};
|
|
319
|
-
}, []), se((s,
|
|
315
|
+
}, []), se((s, c) => {
|
|
320
316
|
if (a.current) {
|
|
321
|
-
const m = a.current.update(
|
|
317
|
+
const m = a.current.update(c);
|
|
322
318
|
d(), m || f();
|
|
323
319
|
}
|
|
324
320
|
});
|
|
325
|
-
function
|
|
321
|
+
function l(s) {
|
|
326
322
|
s && (u.current = ue(s), d(), f());
|
|
327
323
|
}
|
|
328
324
|
function d() {
|
|
329
|
-
var
|
|
330
|
-
const s = ((
|
|
325
|
+
var c;
|
|
326
|
+
const s = ((c = a.current) == null ? void 0 : c.getCurrentValues()) || [];
|
|
331
327
|
if (n)
|
|
332
328
|
n(u.current, s);
|
|
333
329
|
else
|
|
@@ -338,20 +334,20 @@ function me({
|
|
|
338
334
|
}
|
|
339
335
|
const h = T(() => {
|
|
340
336
|
const s = e.joint_position.filter(
|
|
341
|
-
(
|
|
337
|
+
(c) => c !== void 0
|
|
342
338
|
);
|
|
343
339
|
requestAnimationFrame(() => {
|
|
344
|
-
var
|
|
345
|
-
o.current = s, (
|
|
340
|
+
var c;
|
|
341
|
+
o.current = s, (c = a.current) == null || c.setTarget(s);
|
|
346
342
|
});
|
|
347
343
|
}, [e]);
|
|
348
344
|
return M(() => {
|
|
349
345
|
h();
|
|
350
346
|
}, [e, h]), le(() => {
|
|
351
347
|
h();
|
|
352
|
-
}), /* @__PURE__ */ t.jsx("group", { ref:
|
|
348
|
+
}), /* @__PURE__ */ t.jsx("group", { ref: l, children: i });
|
|
353
349
|
}
|
|
354
|
-
const
|
|
350
|
+
const De = "line", Oe = "mesh";
|
|
355
351
|
function Ue({
|
|
356
352
|
rapidlyChangingMotionState: e,
|
|
357
353
|
dhParameters: r,
|
|
@@ -362,27 +358,27 @@ function Ue({
|
|
|
362
358
|
o.current = new Array(r.length).fill(null), u.current = new Array(r.length).fill(null);
|
|
363
359
|
}, [r.length]);
|
|
364
360
|
function a(d, h) {
|
|
365
|
-
const s = new L(),
|
|
366
|
-
i.decompose(s,
|
|
361
|
+
const s = new L(), c = new E(), m = new L();
|
|
362
|
+
i.decompose(s, c, m);
|
|
367
363
|
const y = s.clone(), p = new w().makeRotationY(
|
|
368
364
|
d.theta + h * (d.reverse_rotation_direction ? -1 : 1)
|
|
369
365
|
).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 i.multiply(p), i.decompose(s,
|
|
366
|
+
return i.multiply(p), i.decompose(s, c, m), { a: y, b: s };
|
|
371
367
|
}
|
|
372
|
-
function f(d, h, s,
|
|
368
|
+
function f(d, h, s, c) {
|
|
373
369
|
if (!r)
|
|
374
370
|
return;
|
|
375
371
|
const m = r[d];
|
|
376
372
|
if (!m)
|
|
377
373
|
return;
|
|
378
|
-
const { a: y, b: p } = a(m,
|
|
374
|
+
const { a: y, b: p } = a(m, c);
|
|
379
375
|
h.geometry.setPositions([y.toArray(), p.toArray()].flat()), s.position.set(p.x, p.y, p.z);
|
|
380
376
|
}
|
|
381
|
-
function
|
|
377
|
+
function l(d, h) {
|
|
382
378
|
i.identity();
|
|
383
379
|
for (let s = 0; s < Math.min(d.length, h.length); s++) {
|
|
384
|
-
const
|
|
385
|
-
|
|
380
|
+
const c = o.current[s], m = u.current[s];
|
|
381
|
+
c && m && f(s, c, m, h[s]);
|
|
386
382
|
}
|
|
387
383
|
}
|
|
388
384
|
return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsx(
|
|
@@ -390,14 +386,14 @@ function Ue({
|
|
|
390
386
|
{
|
|
391
387
|
rapidlyChangingMotionState: e,
|
|
392
388
|
dhParameters: r,
|
|
393
|
-
onRotationChanged:
|
|
389
|
+
onRotationChanged: l,
|
|
394
390
|
children: /* @__PURE__ */ t.jsxs("group", { ...n, name: "Scene", children: [
|
|
395
391
|
/* @__PURE__ */ t.jsxs("mesh", { children: [
|
|
396
392
|
/* @__PURE__ */ t.jsx("sphereGeometry", { args: [0.01, 32, 32] }),
|
|
397
393
|
/* @__PURE__ */ t.jsx("meshStandardMaterial", { color: "black", depthTest: !0 })
|
|
398
394
|
] }),
|
|
399
395
|
r.map((d, h) => {
|
|
400
|
-
const { a: s, b:
|
|
396
|
+
const { a: s, b: c } = a(
|
|
401
397
|
d,
|
|
402
398
|
e.joint_position[h] ?? 0
|
|
403
399
|
), m = `dhrobot_J0${h}`;
|
|
@@ -408,8 +404,8 @@ function Ue({
|
|
|
408
404
|
ref: (y) => {
|
|
409
405
|
o.current[h] = y;
|
|
410
406
|
},
|
|
411
|
-
name:
|
|
412
|
-
points: [s,
|
|
407
|
+
name: De,
|
|
408
|
+
points: [s, c],
|
|
413
409
|
color: "white",
|
|
414
410
|
lineWidth: 5
|
|
415
411
|
}
|
|
@@ -421,7 +417,7 @@ function Ue({
|
|
|
421
417
|
u.current[h] = y;
|
|
422
418
|
},
|
|
423
419
|
name: Oe,
|
|
424
|
-
position:
|
|
420
|
+
position: c,
|
|
425
421
|
children: [
|
|
426
422
|
/* @__PURE__ */ t.jsx("sphereGeometry", { args: [0.01, 32, 32] }),
|
|
427
423
|
/* @__PURE__ */ t.jsx("meshStandardMaterial", { color: "black", depthTest: !0 })
|
|
@@ -455,41 +451,41 @@ function Be({
|
|
|
455
451
|
const o = _e(e);
|
|
456
452
|
let u;
|
|
457
453
|
try {
|
|
458
|
-
u =
|
|
459
|
-
} catch (
|
|
460
|
-
throw
|
|
454
|
+
u = Ce(o, "robot.glb").gltf;
|
|
455
|
+
} catch (l) {
|
|
456
|
+
throw l;
|
|
461
457
|
}
|
|
462
458
|
const a = T(
|
|
463
|
-
(
|
|
464
|
-
|
|
459
|
+
(l) => {
|
|
460
|
+
l && n && n();
|
|
465
461
|
},
|
|
466
462
|
[n]
|
|
467
463
|
);
|
|
468
|
-
function f(
|
|
464
|
+
function f(l) {
|
|
469
465
|
try {
|
|
470
|
-
return Je(
|
|
466
|
+
return Je(l) ? l.geometry ? /* @__PURE__ */ t.jsx(
|
|
471
467
|
"mesh",
|
|
472
468
|
{
|
|
473
|
-
name:
|
|
474
|
-
geometry:
|
|
475
|
-
material:
|
|
476
|
-
position:
|
|
477
|
-
rotation:
|
|
469
|
+
name: l.name,
|
|
470
|
+
geometry: l.geometry,
|
|
471
|
+
material: l.material,
|
|
472
|
+
position: l.position,
|
|
473
|
+
rotation: l.rotation
|
|
478
474
|
},
|
|
479
|
-
|
|
480
|
-
) : /* @__PURE__ */ t.jsx("group", { name:
|
|
475
|
+
l.uuid
|
|
476
|
+
) : /* @__PURE__ */ t.jsx("group", { name: l.name, position: l.position, rotation: l.rotation }, l.uuid) : /* @__PURE__ */ t.jsx(
|
|
481
477
|
"group",
|
|
482
478
|
{
|
|
483
|
-
name:
|
|
484
|
-
position:
|
|
485
|
-
rotation:
|
|
486
|
-
ref: fe(
|
|
487
|
-
children:
|
|
479
|
+
name: l.name,
|
|
480
|
+
position: l.position,
|
|
481
|
+
rotation: l.rotation,
|
|
482
|
+
ref: fe(l) ? r : void 0,
|
|
483
|
+
children: l.children.map(f)
|
|
488
484
|
},
|
|
489
|
-
|
|
485
|
+
l.uuid
|
|
490
486
|
);
|
|
491
487
|
} catch (d) {
|
|
492
|
-
return console.warn("Error rendering node",
|
|
488
|
+
return console.warn("Error rendering node", l.name, d), null;
|
|
493
489
|
}
|
|
494
490
|
}
|
|
495
491
|
return /* @__PURE__ */ t.jsx("group", { ...i, dispose: null, ref: a, children: f(u.scene) });
|
|
@@ -557,17 +553,17 @@ const xe = (e, r) => {
|
|
|
557
553
|
}), r.forEach((n) => {
|
|
558
554
|
n.parent && n.parent.remove(n);
|
|
559
555
|
}), e.userData.isGhost = !1;
|
|
560
|
-
}, ge =
|
|
556
|
+
}, ge = z(
|
|
561
557
|
({
|
|
562
558
|
rapidlyChangingMotionState: e,
|
|
563
559
|
modelFromController: r,
|
|
564
560
|
dhParameters: n,
|
|
565
|
-
getModel: i =
|
|
561
|
+
getModel: i = C,
|
|
566
562
|
flangeRef: o,
|
|
567
563
|
postModelRender: u,
|
|
568
564
|
transparentColor: a,
|
|
569
565
|
instanceUrl: f,
|
|
570
|
-
...
|
|
566
|
+
...l
|
|
571
567
|
}) => {
|
|
572
568
|
const [d, h] = V(null), s = T((m) => {
|
|
573
569
|
h(m);
|
|
@@ -575,23 +571,23 @@ const xe = (e, r) => {
|
|
|
575
571
|
M(() => {
|
|
576
572
|
d && (a ? xe(d, a) : ye(d));
|
|
577
573
|
}, [d, a]);
|
|
578
|
-
const
|
|
574
|
+
const c = /* @__PURE__ */ t.jsx(
|
|
579
575
|
Ue,
|
|
580
576
|
{
|
|
581
577
|
rapidlyChangingMotionState: e,
|
|
582
578
|
dhParameters: n,
|
|
583
|
-
...
|
|
579
|
+
...l
|
|
584
580
|
}
|
|
585
581
|
);
|
|
586
582
|
return /* @__PURE__ */ t.jsxs(
|
|
587
583
|
ce,
|
|
588
584
|
{
|
|
589
|
-
fallback:
|
|
585
|
+
fallback: c,
|
|
590
586
|
onError: (m) => {
|
|
591
587
|
console.warn(m);
|
|
592
588
|
},
|
|
593
589
|
children: [
|
|
594
|
-
/* @__PURE__ */ t.jsx(ie, { fallback:
|
|
590
|
+
/* @__PURE__ */ t.jsx(ie, { fallback: c, children: /* @__PURE__ */ t.jsx("group", { ref: s, children: /* @__PURE__ */ t.jsx(
|
|
595
591
|
me,
|
|
596
592
|
{
|
|
597
593
|
rapidlyChangingMotionState: e,
|
|
@@ -609,7 +605,7 @@ const xe = (e, r) => {
|
|
|
609
605
|
})(),
|
|
610
606
|
postModelRender: u,
|
|
611
607
|
flangeRef: o,
|
|
612
|
-
...
|
|
608
|
+
...l
|
|
613
609
|
}
|
|
614
610
|
)
|
|
615
611
|
}
|
|
@@ -622,7 +618,7 @@ const xe = (e, r) => {
|
|
|
622
618
|
);
|
|
623
619
|
function We({
|
|
624
620
|
connectedMotionGroup: e,
|
|
625
|
-
getModel: r =
|
|
621
|
+
getModel: r = C,
|
|
626
622
|
flangeRef: n,
|
|
627
623
|
transparentColor: i,
|
|
628
624
|
postModelRender: o,
|
|
@@ -642,7 +638,7 @@ function We({
|
|
|
642
638
|
}
|
|
643
639
|
) : null;
|
|
644
640
|
}
|
|
645
|
-
const at =
|
|
641
|
+
const at = z(
|
|
646
642
|
Ve(
|
|
647
643
|
({
|
|
648
644
|
robotName: e,
|
|
@@ -653,17 +649,17 @@ const at = C(
|
|
|
653
649
|
onDriveToHomePress: u,
|
|
654
650
|
onDriveToHomeRelease: a,
|
|
655
651
|
connectedMotionGroup: f,
|
|
656
|
-
robotComponent:
|
|
652
|
+
robotComponent: l = We,
|
|
657
653
|
customContentComponent: d,
|
|
658
654
|
className: h
|
|
659
655
|
}) => {
|
|
660
656
|
var $;
|
|
661
|
-
const s = Te(), { t:
|
|
657
|
+
const s = Te(), { t: c } = ke(), [m, y] = V(!1), p = R(null), j = R(null), [g, D] = V(!1), [k, Re] = V({ width: 400, height: 600 }), [He, ve] = V(0);
|
|
662
658
|
M(() => {
|
|
663
659
|
const S = () => {
|
|
664
660
|
if (j.current) {
|
|
665
661
|
const { offsetWidth: N, offsetHeight: Y } = j.current;
|
|
666
|
-
|
|
662
|
+
D(N > Y), Re({ width: N, height: Y });
|
|
667
663
|
}
|
|
668
664
|
};
|
|
669
665
|
S();
|
|
@@ -674,13 +670,13 @@ const at = C(
|
|
|
674
670
|
}, []);
|
|
675
671
|
const B = T(() => {
|
|
676
672
|
ve((S) => S + 1);
|
|
677
|
-
}, []),
|
|
673
|
+
}, []), F = T(() => {
|
|
678
674
|
!o || !u || (y(!0), u());
|
|
679
675
|
}, [o, u]), P = T(() => {
|
|
680
676
|
!o || !a || (y(!1), a());
|
|
681
677
|
}, [o, a]), W = T(() => {
|
|
682
678
|
m && a && (y(!1), a());
|
|
683
|
-
}, [m, a]), _ = g ?
|
|
679
|
+
}, [m, a]), _ = g ? k.width < 350 : k.height < 200, A = g ? k.height < 310 : k.height < 450;
|
|
684
680
|
return /* @__PURE__ */ t.jsx(
|
|
685
681
|
Le,
|
|
686
682
|
{
|
|
@@ -744,7 +740,7 @@ const at = C(
|
|
|
744
740
|
children: [
|
|
745
741
|
/* @__PURE__ */ t.jsx(te, {}),
|
|
746
742
|
/* @__PURE__ */ t.jsx(X, { fit: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ t.jsx(
|
|
747
|
-
|
|
743
|
+
l,
|
|
748
744
|
{
|
|
749
745
|
connectedMotionGroup: f,
|
|
750
746
|
postModelRender: B
|
|
@@ -836,17 +832,17 @@ const at = C(
|
|
|
836
832
|
color: "secondary",
|
|
837
833
|
size: "small",
|
|
838
834
|
disabled: !o,
|
|
839
|
-
onMouseDown:
|
|
835
|
+
onMouseDown: F,
|
|
840
836
|
onMouseUp: P,
|
|
841
837
|
onMouseLeave: W,
|
|
842
|
-
onTouchStart:
|
|
838
|
+
onTouchStart: F,
|
|
843
839
|
onTouchEnd: P,
|
|
844
840
|
sx: {
|
|
845
841
|
textTransform: "none",
|
|
846
842
|
px: 1.5,
|
|
847
843
|
py: 0.5
|
|
848
844
|
},
|
|
849
|
-
children:
|
|
845
|
+
children: c("RobotCard.DriveToHome.bt")
|
|
850
846
|
}
|
|
851
847
|
)
|
|
852
848
|
}
|
|
@@ -914,7 +910,7 @@ const at = C(
|
|
|
914
910
|
children: [
|
|
915
911
|
/* @__PURE__ */ t.jsx(te, {}),
|
|
916
912
|
/* @__PURE__ */ t.jsx(X, { fit: !0, clip: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ t.jsx(
|
|
917
|
-
|
|
913
|
+
l,
|
|
918
914
|
{
|
|
919
915
|
connectedMotionGroup: f,
|
|
920
916
|
postModelRender: B
|
|
@@ -957,17 +953,17 @@ const at = C(
|
|
|
957
953
|
color: "secondary",
|
|
958
954
|
size: "small",
|
|
959
955
|
disabled: !o,
|
|
960
|
-
onMouseDown:
|
|
956
|
+
onMouseDown: F,
|
|
961
957
|
onMouseUp: P,
|
|
962
958
|
onMouseLeave: W,
|
|
963
|
-
onTouchStart:
|
|
959
|
+
onTouchStart: F,
|
|
964
960
|
onTouchEnd: P,
|
|
965
961
|
sx: {
|
|
966
962
|
textTransform: "none",
|
|
967
963
|
px: 1.5,
|
|
968
964
|
py: 0.5
|
|
969
965
|
},
|
|
970
|
-
children:
|
|
966
|
+
children: c("RobotCard.DriveToHome.bt")
|
|
971
967
|
}
|
|
972
968
|
)
|
|
973
969
|
}
|
|
@@ -990,7 +986,7 @@ function je({
|
|
|
990
986
|
const o = R([]), u = R([]), a = R(null), { invalidate: f } = oe();
|
|
991
987
|
M(() => {
|
|
992
988
|
const s = e.joint_position.filter(
|
|
993
|
-
(
|
|
989
|
+
(c) => c !== void 0
|
|
994
990
|
);
|
|
995
991
|
return a.current = new ae(s, {
|
|
996
992
|
tension: 120,
|
|
@@ -999,21 +995,21 @@ function je({
|
|
|
999
995
|
// Controls damping - higher values reduce oscillation and create smoother settling
|
|
1000
996
|
threshold: 1e-3
|
|
1001
997
|
}), () => {
|
|
1002
|
-
var
|
|
1003
|
-
(
|
|
998
|
+
var c;
|
|
999
|
+
(c = a.current) == null || c.destroy();
|
|
1004
1000
|
};
|
|
1005
|
-
}, []), se((s,
|
|
1001
|
+
}, []), se((s, c) => {
|
|
1006
1002
|
if (a.current) {
|
|
1007
|
-
const m = a.current.update(
|
|
1003
|
+
const m = a.current.update(c);
|
|
1008
1004
|
d(), m || f();
|
|
1009
1005
|
}
|
|
1010
1006
|
});
|
|
1011
|
-
function
|
|
1007
|
+
function l(s) {
|
|
1012
1008
|
s && (u.current = ue(s), d(), f());
|
|
1013
1009
|
}
|
|
1014
1010
|
function d() {
|
|
1015
|
-
var
|
|
1016
|
-
const s = ((
|
|
1011
|
+
var c;
|
|
1012
|
+
const s = ((c = a.current) == null ? void 0 : c.getCurrentValues()) || [];
|
|
1017
1013
|
if (n)
|
|
1018
1014
|
n(u.current, s);
|
|
1019
1015
|
else
|
|
@@ -1024,18 +1020,18 @@ function je({
|
|
|
1024
1020
|
}
|
|
1025
1021
|
const h = T(() => {
|
|
1026
1022
|
const s = e.joint_position.filter(
|
|
1027
|
-
(
|
|
1023
|
+
(c) => c !== void 0
|
|
1028
1024
|
);
|
|
1029
1025
|
requestAnimationFrame(() => {
|
|
1030
|
-
var
|
|
1031
|
-
o.current = s, (
|
|
1026
|
+
var c;
|
|
1027
|
+
o.current = s, (c = a.current) == null || c.setTarget(s);
|
|
1032
1028
|
});
|
|
1033
1029
|
}, [e]);
|
|
1034
1030
|
return M(() => {
|
|
1035
1031
|
h();
|
|
1036
1032
|
}, [e, h]), le(() => {
|
|
1037
1033
|
h();
|
|
1038
|
-
}), /* @__PURE__ */ t.jsx("group", { ref:
|
|
1034
|
+
}), /* @__PURE__ */ t.jsx("group", { ref: l, children: i });
|
|
1039
1035
|
}
|
|
1040
1036
|
function we({
|
|
1041
1037
|
rapidlyChangingMotionState: e,
|
|
@@ -1055,25 +1051,25 @@ function we({
|
|
|
1055
1051
|
).multiply(new w().makeRotationX(p.alpha));
|
|
1056
1052
|
h.multiply(g);
|
|
1057
1053
|
}
|
|
1058
|
-
const s = new L(),
|
|
1059
|
-
return h.decompose(s,
|
|
1054
|
+
const s = new L(), c = new E(), m = new L();
|
|
1055
|
+
return h.decompose(s, c, m), s;
|
|
1060
1056
|
}
|
|
1061
1057
|
const f = a(e.joint_position);
|
|
1062
|
-
function
|
|
1058
|
+
function l(d, h) {
|
|
1063
1059
|
i.identity();
|
|
1064
1060
|
let s = new L();
|
|
1065
1061
|
for (let p = 0; p < r.length; p++) {
|
|
1066
|
-
const j = h[p] ?? 0, g = r[p],
|
|
1062
|
+
const j = h[p] ?? 0, g = r[p], D = new w().makeRotationY(g.theta).multiply(
|
|
1067
1063
|
new w().makeTranslation(
|
|
1068
1064
|
g.a / 1e3,
|
|
1069
1065
|
(g.d + j * (g.reverse_rotation_direction ? -1 : 1)) / 1e3,
|
|
1070
1066
|
0
|
|
1071
1067
|
)
|
|
1072
1068
|
).multiply(new w().makeRotationX(g.alpha));
|
|
1073
|
-
i.multiply(
|
|
1069
|
+
i.multiply(D);
|
|
1074
1070
|
}
|
|
1075
|
-
const
|
|
1076
|
-
if (i.decompose(
|
|
1071
|
+
const c = new L(), m = new E(), y = new L();
|
|
1072
|
+
if (i.decompose(c, m, y), s = c, o.current && o.current.position.set(s.x, s.y, s.z), u.current) {
|
|
1077
1073
|
const p = u.current.geometry;
|
|
1078
1074
|
p && p.setPositions && p.setPositions([0, 0, 0, s.x, s.y, s.z]);
|
|
1079
1075
|
}
|
|
@@ -1083,7 +1079,7 @@ function we({
|
|
|
1083
1079
|
{
|
|
1084
1080
|
rapidlyChangingMotionState: e,
|
|
1085
1081
|
dhParameters: r,
|
|
1086
|
-
onTranslationChanged:
|
|
1082
|
+
onTranslationChanged: l,
|
|
1087
1083
|
children: /* @__PURE__ */ t.jsxs("group", { ...n, name: "Scene", children: [
|
|
1088
1084
|
/* @__PURE__ */ t.jsxs("mesh", { name: "Base", position: [0, 0, 0], children: [
|
|
1089
1085
|
/* @__PURE__ */ t.jsx("sphereGeometry", { args: [0.02, 32, 32] }),
|
|
@@ -1106,17 +1102,17 @@ function we({
|
|
|
1106
1102
|
}
|
|
1107
1103
|
) });
|
|
1108
1104
|
}
|
|
1109
|
-
const be =
|
|
1105
|
+
const be = z(
|
|
1110
1106
|
({
|
|
1111
1107
|
rapidlyChangingMotionState: e,
|
|
1112
1108
|
modelFromController: r,
|
|
1113
1109
|
dhParameters: n,
|
|
1114
|
-
getModel: i =
|
|
1110
|
+
getModel: i = C,
|
|
1115
1111
|
flangeRef: o,
|
|
1116
1112
|
postModelRender: u,
|
|
1117
1113
|
transparentColor: a,
|
|
1118
1114
|
instanceUrl: f,
|
|
1119
|
-
...
|
|
1115
|
+
...l
|
|
1120
1116
|
}) => {
|
|
1121
1117
|
const [d, h] = V(null), s = T((m) => {
|
|
1122
1118
|
h(m);
|
|
@@ -1124,23 +1120,23 @@ const be = C(
|
|
|
1124
1120
|
M(() => {
|
|
1125
1121
|
d && (a ? xe(d, a) : ye(d));
|
|
1126
1122
|
}, [d, a]);
|
|
1127
|
-
const
|
|
1123
|
+
const c = /* @__PURE__ */ t.jsx(
|
|
1128
1124
|
we,
|
|
1129
1125
|
{
|
|
1130
1126
|
rapidlyChangingMotionState: e,
|
|
1131
1127
|
dhParameters: n,
|
|
1132
|
-
...
|
|
1128
|
+
...l
|
|
1133
1129
|
}
|
|
1134
1130
|
);
|
|
1135
1131
|
return /* @__PURE__ */ t.jsxs(
|
|
1136
1132
|
ce,
|
|
1137
1133
|
{
|
|
1138
|
-
fallback:
|
|
1134
|
+
fallback: c,
|
|
1139
1135
|
onError: (m) => {
|
|
1140
1136
|
console.warn(m);
|
|
1141
1137
|
},
|
|
1142
1138
|
children: [
|
|
1143
|
-
/* @__PURE__ */ t.jsx(ie, { fallback:
|
|
1139
|
+
/* @__PURE__ */ t.jsx(ie, { fallback: c, children: /* @__PURE__ */ t.jsx("group", { ref: s, children: /* @__PURE__ */ t.jsx(
|
|
1144
1140
|
je,
|
|
1145
1141
|
{
|
|
1146
1142
|
rapidlyChangingMotionState: e,
|
|
@@ -1158,7 +1154,7 @@ const be = C(
|
|
|
1158
1154
|
})(),
|
|
1159
1155
|
postModelRender: u,
|
|
1160
1156
|
flangeRef: o,
|
|
1161
|
-
...
|
|
1157
|
+
...l
|
|
1162
1158
|
}
|
|
1163
1159
|
)
|
|
1164
1160
|
}
|
|
@@ -1171,7 +1167,7 @@ const be = C(
|
|
|
1171
1167
|
);
|
|
1172
1168
|
function ct({
|
|
1173
1169
|
connectedMotionGroup: e,
|
|
1174
|
-
getModel: r =
|
|
1170
|
+
getModel: r = C,
|
|
1175
1171
|
flangeRef: n,
|
|
1176
1172
|
transparentColor: i,
|
|
1177
1173
|
postModelRender: o,
|
|
@@ -1245,7 +1241,7 @@ function ut(e, r) {
|
|
|
1245
1241
|
const n = $e(e);
|
|
1246
1242
|
return n && n in ne ? ne[n] : r || null;
|
|
1247
1243
|
}
|
|
1248
|
-
const ft =
|
|
1244
|
+
const ft = z((e) => {
|
|
1249
1245
|
const {
|
|
1250
1246
|
inverseSolver: r,
|
|
1251
1247
|
dhParameters: n,
|
|
@@ -1270,8 +1266,8 @@ export {
|
|
|
1270
1266
|
be as c,
|
|
1271
1267
|
ge as d,
|
|
1272
1268
|
lt as e,
|
|
1273
|
-
|
|
1269
|
+
C as f,
|
|
1274
1270
|
$e as g,
|
|
1275
1271
|
ut as h
|
|
1276
1272
|
};
|
|
1277
|
-
//# sourceMappingURL=MotionGroupVisualizer-
|
|
1273
|
+
//# sourceMappingURL=MotionGroupVisualizer-G_LEBwiv.js.map
|