@wandelbots/wandelbots-js-react-components 4.2.0 → 4.3.0-pr.feat-RB-3171-dynamic-motion-visualization.517.a2d76ef
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/3d.cjs.js +1 -1
- package/dist/3d.es.js +1 -1
- package/dist/MotionGroupVisualizer-DkyCrMy6.cjs +2 -0
- package/dist/{MotionGroupVisualizer-C3CB-L2z.cjs.map → MotionGroupVisualizer-DkyCrMy6.cjs.map} +1 -1
- package/dist/{MotionGroupVisualizer-CrLamHYm.js → MotionGroupVisualizer-DzSF9oW7.js} +317 -358
- package/dist/{MotionGroupVisualizer-CrLamHYm.js.map → MotionGroupVisualizer-DzSF9oW7.js.map} +1 -1
- package/dist/components/jogging/JoggingJointTab.d.ts +1 -1
- package/dist/components/jogging/JoggingJointTab.d.ts.map +1 -1
- package/dist/components/jogging/JoggingJointValueControl.d.ts +16 -0
- package/dist/components/jogging/JoggingJointValueControl.d.ts.map +1 -0
- package/dist/components/jogging/JoggingStore.d.ts +17 -19
- package/dist/components/jogging/JoggingStore.d.ts.map +1 -1
- package/dist/components/robots/MotionGroupVisualizer.d.ts +2 -1
- package/dist/components/robots/MotionGroupVisualizer.d.ts.map +1 -1
- package/dist/core.cjs.js +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.d.ts.map +1 -1
- package/dist/core.es.js +8 -8
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +10 -10
- package/dist/{interpolation-Cs2pC1zE.js → interpolation-6ZZN4S_x.js} +2 -2
- package/dist/{interpolation-Cs2pC1zE.js.map → interpolation-6ZZN4S_x.js.map} +1 -1
- package/dist/{interpolation-C5OTEwAm.cjs → interpolation-CyO6DaVa.cjs} +2 -2
- package/dist/{interpolation-C5OTEwAm.cjs.map → interpolation-CyO6DaVa.cjs.map} +1 -1
- package/dist/lib/JoggerConnection.d.ts +4 -3
- package/dist/lib/JoggerConnection.d.ts.map +1 -1
- package/dist/{theming-Dk07SE2_.cjs → theming-Cqo-msxF.cjs} +36 -36
- package/dist/theming-Cqo-msxF.cjs.map +1 -0
- package/dist/{theming-C-zvh022.js → theming-gUgI75AD.js} +2915 -2891
- package/dist/theming-gUgI75AD.js.map +1 -0
- package/package.json +2 -2
- package/src/components/jogging/JoggingJointTab.tsx +18 -18
- package/src/components/jogging/{JoggingJointRotationControl.tsx → JoggingJointValueControl.tsx} +51 -28
- package/src/components/jogging/JoggingPanel.tsx +1 -1
- package/src/components/jogging/JoggingStore.ts +42 -12
- package/src/components/robots/MotionGroupVisualizer.tsx +12 -87
- package/src/core.ts +2 -1
- package/src/lib/JoggerConnection.test.ts +4 -2
- package/src/lib/JoggerConnection.ts +8 -4
- package/dist/MotionGroupVisualizer-C3CB-L2z.cjs +0 -2
- package/dist/components/jogging/JoggingJointRotationControl.d.ts +0 -15
- package/dist/components/jogging/JoggingJointRotationControl.d.ts.map +0 -1
- package/dist/theming-C-zvh022.js.map +0 -1
- package/dist/theming-Dk07SE2_.cjs.map +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { j as t, e as
|
|
1
|
+
import { j as t, e as P } 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 L, Quaternion as z } from "three";
|
|
4
4
|
import { ConvexGeometry as te } from "three-stdlib";
|
|
5
|
-
import { useThree as ne, useFrame as re, Canvas as
|
|
6
|
-
import { Environment as
|
|
7
|
-
import { useTheme as
|
|
5
|
+
import { useThree as ne, useFrame as re, Canvas as H } from "@react-three/fiber";
|
|
6
|
+
import { Environment as Re, Lightformer as V, Line as U, useGLTF as ve, Bounds as Y } from "@react-three/drei";
|
|
7
|
+
import { useTheme as Me, Card as _e, Box as b, Typography as q, Divider as X, Button as K } from "@mui/material";
|
|
8
8
|
import { observer as Te } from "mobx-react-lite";
|
|
9
|
-
import
|
|
10
|
-
import { useTranslation as
|
|
11
|
-
import { N as
|
|
12
|
-
import { ErrorBoundary as
|
|
13
|
-
function
|
|
9
|
+
import Le, { useRef as R, useEffect as T, useCallback as _, useState as G, Suspense as oe, useMemo as Ve } from "react";
|
|
10
|
+
import { useTranslation as Ge } from "react-i18next";
|
|
11
|
+
import { N as ke, V as se, c as ie, b as Z, M as v } from "./interpolation-6ZZN4S_x.js";
|
|
12
|
+
import { ErrorBoundary as ae } from "react-error-boundary";
|
|
13
|
+
function Fe(e) {
|
|
14
14
|
switch (e.shape_type) {
|
|
15
15
|
case "convex_hull":
|
|
16
16
|
return new te(
|
|
@@ -47,13 +47,13 @@ function ke(e) {
|
|
|
47
47
|
return console.warn(`${e.shape_type} is not supported`), new x.BufferGeometry();
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function Ie({
|
|
51
51
|
name: e,
|
|
52
52
|
collider: r,
|
|
53
53
|
children: n
|
|
54
54
|
}) {
|
|
55
|
-
var u,
|
|
56
|
-
const i = ((u = r.pose) == null ? void 0 : u.position) ?? [0, 0, 0], o = ((
|
|
55
|
+
var u, l;
|
|
56
|
+
const i = ((u = r.pose) == null ? void 0 : u.position) ?? [0, 0, 0], o = ((l = r.pose) == null ? void 0 : l.orientation) ?? [0, 0, 0];
|
|
57
57
|
return r.margin && console.warn(`${e} margin is not supported`), /* @__PURE__ */ t.jsx(
|
|
58
58
|
"mesh",
|
|
59
59
|
{
|
|
@@ -64,19 +64,19 @@ function Le({
|
|
|
64
64
|
i[2]
|
|
65
65
|
).divideScalar(1e3),
|
|
66
66
|
rotation: new x.Euler(o[0], o[1], o[2], "XYZ"),
|
|
67
|
-
geometry:
|
|
67
|
+
geometry: Fe(r.shape),
|
|
68
68
|
children: n
|
|
69
69
|
}
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function Se({
|
|
73
73
|
name: e,
|
|
74
74
|
colliders: r,
|
|
75
75
|
meshChildrenProvider: n,
|
|
76
76
|
...i
|
|
77
77
|
}) {
|
|
78
78
|
return /* @__PURE__ */ t.jsx("group", { name: e, ...i, children: Object.entries(r).map(([o, u]) => /* @__PURE__ */ t.jsx(
|
|
79
|
-
|
|
79
|
+
Ie,
|
|
80
80
|
{
|
|
81
81
|
name: o,
|
|
82
82
|
collider: u,
|
|
@@ -91,7 +91,7 @@ function rt({
|
|
|
91
91
|
}) {
|
|
92
92
|
const n = e.colliders;
|
|
93
93
|
return /* @__PURE__ */ t.jsx("group", { children: n && /* @__PURE__ */ t.jsx(
|
|
94
|
-
|
|
94
|
+
Se,
|
|
95
95
|
{
|
|
96
96
|
meshChildrenProvider: r,
|
|
97
97
|
colliders: n
|
|
@@ -99,12 +99,12 @@ function rt({
|
|
|
99
99
|
) });
|
|
100
100
|
}
|
|
101
101
|
function Q() {
|
|
102
|
-
return /* @__PURE__ */ t.jsx(
|
|
102
|
+
return /* @__PURE__ */ t.jsx(Re, { children: /* @__PURE__ */ t.jsx(Ae, {}) });
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function Ae({ 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
|
+
V,
|
|
108
108
|
{
|
|
109
109
|
intensity: 5,
|
|
110
110
|
"rotation-x": Math.PI / 2,
|
|
@@ -113,7 +113,7 @@ function Pe({ 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
|
+
V,
|
|
117
117
|
{
|
|
118
118
|
form: "circle",
|
|
119
119
|
intensity: 5,
|
|
@@ -124,7 +124,7 @@ function Pe({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
|
|
|
124
124
|
n
|
|
125
125
|
)) }) }),
|
|
126
126
|
/* @__PURE__ */ t.jsx(
|
|
127
|
-
|
|
127
|
+
V,
|
|
128
128
|
{
|
|
129
129
|
intensity: 40,
|
|
130
130
|
"rotation-y": Math.PI / 2,
|
|
@@ -133,7 +133,7 @@ function Pe({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
|
|
|
133
133
|
}
|
|
134
134
|
),
|
|
135
135
|
/* @__PURE__ */ t.jsx(
|
|
136
|
-
|
|
136
|
+
V,
|
|
137
137
|
{
|
|
138
138
|
intensity: 20,
|
|
139
139
|
"rotation-y": -Math.PI,
|
|
@@ -142,7 +142,7 @@ function Pe({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
|
|
|
142
142
|
}
|
|
143
143
|
),
|
|
144
144
|
/* @__PURE__ */ t.jsx(
|
|
145
|
-
|
|
145
|
+
V,
|
|
146
146
|
{
|
|
147
147
|
"rotation-y": Math.PI / 2,
|
|
148
148
|
position: [-5, -1, -1],
|
|
@@ -151,7 +151,7 @@ function Pe({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
|
|
|
151
151
|
}
|
|
152
152
|
),
|
|
153
153
|
/* @__PURE__ */ t.jsx(
|
|
154
|
-
|
|
154
|
+
V,
|
|
155
155
|
{
|
|
156
156
|
"rotation-y": -Math.PI / 2,
|
|
157
157
|
position: [10, 1, 0],
|
|
@@ -160,7 +160,7 @@ function Pe({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
|
|
|
160
160
|
}
|
|
161
161
|
),
|
|
162
162
|
/* @__PURE__ */ t.jsx(
|
|
163
|
-
|
|
163
|
+
V,
|
|
164
164
|
{
|
|
165
165
|
form: "ring",
|
|
166
166
|
color: "white",
|
|
@@ -172,16 +172,16 @@ function Pe({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
|
|
|
172
172
|
)
|
|
173
173
|
] });
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function Pe(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), 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),
|
|
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), l = new x.Vector3().crossVectors(o, u).normalize();
|
|
179
179
|
for (let f = 3; f < e.length; f++) {
|
|
180
|
-
const
|
|
181
|
-
if (Math.abs(
|
|
180
|
+
const c = new x.Vector3(e[f].x, e[f].y, e[f].z), d = new x.Vector3().subVectors(c, r), h = l.dot(d);
|
|
181
|
+
if (Math.abs(h) > 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: l };
|
|
185
185
|
}
|
|
186
186
|
function ot({
|
|
187
187
|
safetyZones: e,
|
|
@@ -189,23 +189,23 @@ function ot({
|
|
|
189
189
|
}) {
|
|
190
190
|
return /* @__PURE__ */ t.jsx("group", { ...r, children: e.map((n, i) => {
|
|
191
191
|
let o = [];
|
|
192
|
-
return n.geometry && (n.geometry.compound ? o = n.geometry.compound.child_geometries : n.geometry.convex_hull && (o = [n.geometry])), o.map((u,
|
|
192
|
+
return n.geometry && (n.geometry.compound ? o = n.geometry.compound.child_geometries : n.geometry.convex_hull && (o = [n.geometry])), o.map((u, l) => {
|
|
193
193
|
if (!u.convex_hull) return null;
|
|
194
194
|
const f = u.convex_hull.vertices.map(
|
|
195
|
-
(
|
|
196
|
-
),
|
|
197
|
-
if (
|
|
195
|
+
(h) => new x.Vector3(h.x / 1e3, h.y / 1e3, h.z / 1e3)
|
|
196
|
+
), c = Pe(f);
|
|
197
|
+
if (c.isCoplanar && c.normal) {
|
|
198
198
|
const s = new x.Vector3().addVectors(
|
|
199
199
|
f[0],
|
|
200
|
-
|
|
200
|
+
c.normal.multiplyScalar(1e-4)
|
|
201
201
|
);
|
|
202
202
|
f.push(s);
|
|
203
203
|
}
|
|
204
204
|
let d;
|
|
205
205
|
try {
|
|
206
206
|
d = new te(f);
|
|
207
|
-
} catch (
|
|
208
|
-
return console.log("Error creating ConvexGeometry:",
|
|
207
|
+
} catch (h) {
|
|
208
|
+
return console.log("Error creating ConvexGeometry:", h), null;
|
|
209
209
|
}
|
|
210
210
|
return /* @__PURE__ */ t.jsx("mesh", { geometry: d, children: /* @__PURE__ */ t.jsx(
|
|
211
211
|
"meshStandardMaterial",
|
|
@@ -217,10 +217,10 @@ function ot({
|
|
|
217
217
|
depthWrite: !1,
|
|
218
218
|
transparent: !0,
|
|
219
219
|
polygonOffset: !0,
|
|
220
|
-
polygonOffsetFactor: -
|
|
220
|
+
polygonOffsetFactor: -l
|
|
221
221
|
},
|
|
222
222
|
i
|
|
223
|
-
) }, `${i}-${
|
|
223
|
+
) }, `${i}-${l}`);
|
|
224
224
|
});
|
|
225
225
|
}) });
|
|
226
226
|
}
|
|
@@ -235,7 +235,7 @@ function st({
|
|
|
235
235
|
-o.tcp_pose.position.y / 1e3
|
|
236
236
|
) : null).filter((o) => o !== null)) || [];
|
|
237
237
|
return /* @__PURE__ */ t.jsx("group", { ...r, children: n.length > 0 && /* @__PURE__ */ t.jsx(
|
|
238
|
-
|
|
238
|
+
U,
|
|
239
239
|
{
|
|
240
240
|
points: n,
|
|
241
241
|
lineWidth: 3,
|
|
@@ -245,16 +245,16 @@ function st({
|
|
|
245
245
|
}
|
|
246
246
|
) });
|
|
247
247
|
}
|
|
248
|
-
const
|
|
249
|
-
async function
|
|
250
|
-
if (
|
|
251
|
-
return
|
|
248
|
+
const O = /* @__PURE__ */ new Map();
|
|
249
|
+
async function C(e, r) {
|
|
250
|
+
if (O.has(e))
|
|
251
|
+
return O.get(e);
|
|
252
252
|
const n = (async () => {
|
|
253
|
-
var
|
|
254
|
-
const i = r || "", o = new
|
|
255
|
-
(
|
|
256
|
-
var
|
|
257
|
-
return (
|
|
253
|
+
var l;
|
|
254
|
+
const i = r || "", o = new ke({ instanceUrl: i }), u = o.api.motionGroupModels;
|
|
255
|
+
(l = u.axios) != null && l.interceptors && u.axios.interceptors.request.use((f) => {
|
|
256
|
+
var c;
|
|
257
|
+
return (c = f.url) != null && c.includes("/glb") && (f.responseType = "blob"), f;
|
|
258
258
|
});
|
|
259
259
|
try {
|
|
260
260
|
const f = await o.api.motionGroupModels.getMotionGroupGlbModel(e);
|
|
@@ -263,31 +263,31 @@ async function U(e, r) {
|
|
|
263
263
|
throw console.error("Failed to fetch model:", f), f;
|
|
264
264
|
}
|
|
265
265
|
})();
|
|
266
|
-
return
|
|
266
|
+
return O.set(e, n), n;
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function le(e) {
|
|
269
269
|
function r(n) {
|
|
270
270
|
return n.children.length === 0 ? [n] : [n, ...n.children.flatMap((i) => r(i))];
|
|
271
271
|
}
|
|
272
|
-
return r(e).filter((n) =>
|
|
272
|
+
return r(e).filter((n) => ue(n));
|
|
273
273
|
}
|
|
274
|
-
function
|
|
274
|
+
function ce(e) {
|
|
275
275
|
return e.name.endsWith("_FLG");
|
|
276
276
|
}
|
|
277
|
-
function
|
|
277
|
+
function ue(e) {
|
|
278
278
|
return /_J[0-9]+$/.test(e.name);
|
|
279
279
|
}
|
|
280
|
-
function
|
|
280
|
+
function Ce(e, r) {
|
|
281
281
|
let n;
|
|
282
282
|
function i(o) {
|
|
283
|
-
if (
|
|
283
|
+
if (ce(o)) {
|
|
284
284
|
if (n)
|
|
285
285
|
throw Error(
|
|
286
286
|
`Found multiple flange groups in robot model ${r}; first ${n.name} then ${o.name}. Only one _FLG group is allowed.`
|
|
287
287
|
);
|
|
288
288
|
n = o;
|
|
289
289
|
}
|
|
290
|
-
|
|
290
|
+
ue(o), o.children.map(i);
|
|
291
291
|
}
|
|
292
292
|
if (i(e.scene), !n)
|
|
293
293
|
throw Error(
|
|
@@ -295,121 +295,121 @@ function Ue(e, r) {
|
|
|
295
295
|
);
|
|
296
296
|
return { gltf: e };
|
|
297
297
|
}
|
|
298
|
-
function
|
|
298
|
+
function fe({
|
|
299
299
|
rapidlyChangingMotionState: e,
|
|
300
300
|
dhParameters: r,
|
|
301
301
|
onRotationChanged: n,
|
|
302
302
|
children: i
|
|
303
303
|
}) {
|
|
304
|
-
const o = R([]), u = R([]),
|
|
305
|
-
|
|
304
|
+
const o = R([]), u = R([]), l = R(null), { invalidate: f } = ne();
|
|
305
|
+
T(() => {
|
|
306
306
|
const s = e.joint_position.filter(
|
|
307
|
-
(
|
|
307
|
+
(a) => a !== void 0
|
|
308
308
|
);
|
|
309
|
-
return
|
|
309
|
+
return l.current = new se(s, {
|
|
310
310
|
tension: 120,
|
|
311
311
|
// Controls spring stiffness - higher values create faster, more responsive motion
|
|
312
312
|
friction: 20,
|
|
313
313
|
// Controls damping - higher values reduce oscillation and create smoother settling
|
|
314
314
|
threshold: 1e-3
|
|
315
315
|
}), () => {
|
|
316
|
-
var
|
|
317
|
-
(
|
|
316
|
+
var a;
|
|
317
|
+
(a = l.current) == null || a.destroy();
|
|
318
318
|
};
|
|
319
|
-
}, []), re((s,
|
|
320
|
-
if (
|
|
321
|
-
const
|
|
322
|
-
d(),
|
|
319
|
+
}, []), re((s, a) => {
|
|
320
|
+
if (l.current) {
|
|
321
|
+
const m = l.current.update(a);
|
|
322
|
+
d(), m || f();
|
|
323
323
|
}
|
|
324
324
|
});
|
|
325
|
-
function
|
|
326
|
-
s && (u.current =
|
|
325
|
+
function c(s) {
|
|
326
|
+
s && (u.current = le(s), d(), f());
|
|
327
327
|
}
|
|
328
328
|
function d() {
|
|
329
|
-
var
|
|
330
|
-
const s = ((
|
|
329
|
+
var a;
|
|
330
|
+
const s = ((a = l.current) == null ? void 0 : a.getCurrentValues()) || [];
|
|
331
331
|
if (n)
|
|
332
332
|
n(u.current, s);
|
|
333
333
|
else
|
|
334
|
-
for (const [
|
|
335
|
-
const p = r[
|
|
336
|
-
g.rotation.y = y * (s[
|
|
334
|
+
for (const [m, g] of u.current.entries()) {
|
|
335
|
+
const p = r[m], j = p.theta || 0, y = p.reverse_rotation_direction ? -1 : 1;
|
|
336
|
+
g.rotation.y = y * (s[m] || 0) + j;
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
const
|
|
339
|
+
const h = _(() => {
|
|
340
340
|
const s = e.joint_position.filter(
|
|
341
|
-
(
|
|
341
|
+
(a) => a !== void 0
|
|
342
342
|
);
|
|
343
343
|
requestAnimationFrame(() => {
|
|
344
|
-
var
|
|
345
|
-
o.current = s, (
|
|
344
|
+
var a;
|
|
345
|
+
o.current = s, (a = l.current) == null || a.setTarget(s);
|
|
346
346
|
});
|
|
347
347
|
}, [e]);
|
|
348
|
-
return
|
|
349
|
-
|
|
350
|
-
}, [e,
|
|
351
|
-
|
|
352
|
-
}), /* @__PURE__ */ t.jsx("group", { ref:
|
|
348
|
+
return T(() => {
|
|
349
|
+
h();
|
|
350
|
+
}, [e, h]), ie(() => {
|
|
351
|
+
h();
|
|
352
|
+
}), /* @__PURE__ */ t.jsx("group", { ref: c, children: i });
|
|
353
353
|
}
|
|
354
|
-
const De = "line",
|
|
354
|
+
const De = "line", Oe = "mesh";
|
|
355
355
|
function ze({
|
|
356
356
|
rapidlyChangingMotionState: e,
|
|
357
357
|
dhParameters: r,
|
|
358
358
|
...n
|
|
359
359
|
}) {
|
|
360
360
|
const i = new w(), o = R([]), u = R([]);
|
|
361
|
-
|
|
361
|
+
Le.useEffect(() => {
|
|
362
362
|
o.current = new Array(r.length).fill(null), u.current = new Array(r.length).fill(null);
|
|
363
363
|
}, [r.length]);
|
|
364
|
-
function
|
|
365
|
-
const s = new
|
|
366
|
-
i.decompose(s,
|
|
364
|
+
function l(d, h) {
|
|
365
|
+
const s = new L(), a = new z(), m = new L();
|
|
366
|
+
i.decompose(s, a, m);
|
|
367
367
|
const g = s.clone(), p = new w().makeRotationY(
|
|
368
|
-
d.theta +
|
|
368
|
+
d.theta + h * (d.reverse_rotation_direction ? -1 : 1)
|
|
369
369
|
).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,
|
|
370
|
+
return i.multiply(p), i.decompose(s, a, m), { a: g, b: s };
|
|
371
371
|
}
|
|
372
|
-
function f(d,
|
|
372
|
+
function f(d, h, s, a) {
|
|
373
373
|
if (!r)
|
|
374
374
|
return;
|
|
375
|
-
const
|
|
376
|
-
if (!
|
|
375
|
+
const m = r[d];
|
|
376
|
+
if (!m)
|
|
377
377
|
return;
|
|
378
|
-
const { a: g, b: p } =
|
|
379
|
-
|
|
378
|
+
const { a: g, b: p } = l(m, a);
|
|
379
|
+
h.geometry.setPositions([g.toArray(), p.toArray()].flat()), s.position.set(p.x, p.y, p.z);
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function c(d, h) {
|
|
382
382
|
i.identity();
|
|
383
|
-
for (let s = 0; s < Math.min(d.length,
|
|
384
|
-
const
|
|
385
|
-
|
|
383
|
+
for (let s = 0; s < Math.min(d.length, h.length); s++) {
|
|
384
|
+
const a = o.current[s], m = u.current[s];
|
|
385
|
+
a && m && f(s, a, m, h[s]);
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
388
|
return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsx(
|
|
389
|
-
|
|
389
|
+
fe,
|
|
390
390
|
{
|
|
391
391
|
rapidlyChangingMotionState: e,
|
|
392
392
|
dhParameters: r,
|
|
393
|
-
onRotationChanged:
|
|
393
|
+
onRotationChanged: c,
|
|
394
394
|
children: /* @__PURE__ */ t.jsxs("group", { ...n, name: "Scene", children: [
|
|
395
395
|
/* @__PURE__ */ t.jsxs("mesh", { children: [
|
|
396
396
|
/* @__PURE__ */ t.jsx("sphereGeometry", { args: [0.01, 32, 32] }),
|
|
397
397
|
/* @__PURE__ */ t.jsx("meshStandardMaterial", { color: "black", depthTest: !0 })
|
|
398
398
|
] }),
|
|
399
|
-
r.map((d,
|
|
400
|
-
const { a: s, b:
|
|
399
|
+
r.map((d, h) => {
|
|
400
|
+
const { a: s, b: a } = l(
|
|
401
401
|
d,
|
|
402
|
-
e.joint_position[
|
|
403
|
-
),
|
|
404
|
-
return /* @__PURE__ */ t.jsxs("group", { name:
|
|
402
|
+
e.joint_position[h] ?? 0
|
|
403
|
+
), m = `dhrobot_J0${h}`;
|
|
404
|
+
return /* @__PURE__ */ t.jsxs("group", { name: m, children: [
|
|
405
405
|
/* @__PURE__ */ t.jsx(
|
|
406
|
-
|
|
406
|
+
U,
|
|
407
407
|
{
|
|
408
408
|
ref: (g) => {
|
|
409
|
-
o.current[
|
|
409
|
+
o.current[h] = g;
|
|
410
410
|
},
|
|
411
411
|
name: De,
|
|
412
|
-
points: [s,
|
|
412
|
+
points: [s, a],
|
|
413
413
|
color: "white",
|
|
414
414
|
lineWidth: 5
|
|
415
415
|
}
|
|
@@ -418,28 +418,28 @@ function ze({
|
|
|
418
418
|
"mesh",
|
|
419
419
|
{
|
|
420
420
|
ref: (g) => {
|
|
421
|
-
u.current[
|
|
421
|
+
u.current[h] = g;
|
|
422
422
|
},
|
|
423
|
-
name:
|
|
424
|
-
position:
|
|
423
|
+
name: Oe,
|
|
424
|
+
position: a,
|
|
425
425
|
children: [
|
|
426
426
|
/* @__PURE__ */ t.jsx("sphereGeometry", { args: [0.01, 32, 32] }),
|
|
427
427
|
/* @__PURE__ */ t.jsx("meshStandardMaterial", { color: "black", depthTest: !0 })
|
|
428
428
|
]
|
|
429
429
|
},
|
|
430
|
-
"mesh_" +
|
|
430
|
+
"mesh_" + h
|
|
431
431
|
)
|
|
432
|
-
] },
|
|
432
|
+
] }, m);
|
|
433
433
|
})
|
|
434
434
|
] })
|
|
435
435
|
}
|
|
436
436
|
) });
|
|
437
437
|
}
|
|
438
|
-
const
|
|
439
|
-
function
|
|
440
|
-
return
|
|
438
|
+
const Ue = console.warn;
|
|
439
|
+
function de() {
|
|
440
|
+
return T(() => {
|
|
441
441
|
console.warn = (e) => {
|
|
442
|
-
e !== "Cannot call the manual advancement of rafz whilst frameLoop is not set as demand" &&
|
|
442
|
+
e !== "Cannot call the manual advancement of rafz whilst frameLoop is not set as demand" && Ue(e);
|
|
443
443
|
};
|
|
444
444
|
}, []), /* @__PURE__ */ t.jsx(t.Fragment, {});
|
|
445
445
|
}
|
|
@@ -452,56 +452,56 @@ function Be({
|
|
|
452
452
|
postModelRender: n,
|
|
453
453
|
...i
|
|
454
454
|
}) {
|
|
455
|
-
const o =
|
|
455
|
+
const o = ve(e);
|
|
456
456
|
let u;
|
|
457
457
|
try {
|
|
458
|
-
u =
|
|
459
|
-
} catch (
|
|
460
|
-
throw
|
|
458
|
+
u = Ce(o, "robot.glb").gltf;
|
|
459
|
+
} catch (c) {
|
|
460
|
+
throw c;
|
|
461
461
|
}
|
|
462
|
-
const
|
|
463
|
-
(
|
|
464
|
-
|
|
462
|
+
const l = _(
|
|
463
|
+
(c) => {
|
|
464
|
+
c && n && n();
|
|
465
465
|
},
|
|
466
466
|
[n]
|
|
467
467
|
);
|
|
468
|
-
function f(
|
|
468
|
+
function f(c) {
|
|
469
469
|
try {
|
|
470
|
-
return Ee(
|
|
470
|
+
return Ee(c) ? c.geometry ? /* @__PURE__ */ t.jsx(
|
|
471
471
|
"mesh",
|
|
472
472
|
{
|
|
473
|
-
name:
|
|
474
|
-
geometry:
|
|
475
|
-
material:
|
|
476
|
-
position:
|
|
477
|
-
rotation:
|
|
473
|
+
name: c.name,
|
|
474
|
+
geometry: c.geometry,
|
|
475
|
+
material: c.material,
|
|
476
|
+
position: c.position,
|
|
477
|
+
rotation: c.rotation
|
|
478
478
|
},
|
|
479
|
-
|
|
480
|
-
) : /* @__PURE__ */ t.jsx("group", { name:
|
|
479
|
+
c.uuid
|
|
480
|
+
) : /* @__PURE__ */ t.jsx("group", { name: c.name, position: c.position, rotation: c.rotation }, c.uuid) : /* @__PURE__ */ t.jsx(
|
|
481
481
|
"group",
|
|
482
482
|
{
|
|
483
|
-
name:
|
|
484
|
-
position:
|
|
485
|
-
rotation:
|
|
486
|
-
ref:
|
|
487
|
-
children:
|
|
483
|
+
name: c.name,
|
|
484
|
+
position: c.position,
|
|
485
|
+
rotation: c.rotation,
|
|
486
|
+
ref: ce(c) ? r : void 0,
|
|
487
|
+
children: c.children.map(f)
|
|
488
488
|
},
|
|
489
|
-
|
|
489
|
+
c.uuid
|
|
490
490
|
);
|
|
491
491
|
} catch (d) {
|
|
492
|
-
return console.warn("Error rendering node",
|
|
492
|
+
return console.warn("Error rendering node", c.name, d), null;
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
|
-
return /* @__PURE__ */ t.jsx("group", { ...i, dispose: null, ref:
|
|
495
|
+
return /* @__PURE__ */ t.jsx("group", { ...i, dispose: null, ref: l, children: f(u.scene) });
|
|
496
496
|
}
|
|
497
|
-
function
|
|
497
|
+
function me({
|
|
498
498
|
modelURL: e,
|
|
499
499
|
flangeRef: r,
|
|
500
500
|
postModelRender: n,
|
|
501
501
|
...i
|
|
502
502
|
}) {
|
|
503
|
-
const [o, u] =
|
|
504
|
-
return
|
|
503
|
+
const [o, u] = G(null);
|
|
504
|
+
return T(() => {
|
|
505
505
|
(async () => {
|
|
506
506
|
try {
|
|
507
507
|
if (typeof e == "string")
|
|
@@ -524,7 +524,7 @@ function he({
|
|
|
524
524
|
}
|
|
525
525
|
) : null;
|
|
526
526
|
}
|
|
527
|
-
const
|
|
527
|
+
const he = (e, r) => {
|
|
528
528
|
e.userData.isGhost || (e.traverse((n) => {
|
|
529
529
|
if (n instanceof x.Mesh) {
|
|
530
530
|
n.material instanceof x.Material && (n.material.colorWrite = !1);
|
|
@@ -548,7 +548,7 @@ const pe = (e, r) => {
|
|
|
548
548
|
}), o.userData.isGhost = !0, n.parent && (n.parent.add(i), n.parent.add(o));
|
|
549
549
|
}
|
|
550
550
|
}), e.userData.isGhost = !0);
|
|
551
|
-
},
|
|
551
|
+
}, pe = (e) => {
|
|
552
552
|
if (!e.userData.isGhost) return;
|
|
553
553
|
const r = [];
|
|
554
554
|
e.traverse((n) => {
|
|
@@ -557,64 +557,64 @@ const pe = (e, r) => {
|
|
|
557
557
|
}), r.forEach((n) => {
|
|
558
558
|
n.parent && n.parent.remove(n);
|
|
559
559
|
}), e.userData.isGhost = !1;
|
|
560
|
-
},
|
|
560
|
+
}, xe = P(
|
|
561
561
|
({
|
|
562
562
|
rapidlyChangingMotionState: e,
|
|
563
563
|
modelFromController: r,
|
|
564
564
|
dhParameters: n,
|
|
565
|
-
getModel: i =
|
|
565
|
+
getModel: i = C,
|
|
566
566
|
flangeRef: o,
|
|
567
567
|
postModelRender: u,
|
|
568
|
-
transparentColor:
|
|
568
|
+
transparentColor: l,
|
|
569
569
|
instanceUrl: f,
|
|
570
|
-
...
|
|
570
|
+
...c
|
|
571
571
|
}) => {
|
|
572
|
-
const [d,
|
|
573
|
-
m
|
|
572
|
+
const [d, h] = G(null), s = _((m) => {
|
|
573
|
+
h(m);
|
|
574
574
|
}, []);
|
|
575
|
-
|
|
576
|
-
d && (
|
|
577
|
-
}, [d,
|
|
578
|
-
const
|
|
575
|
+
T(() => {
|
|
576
|
+
d && (l ? he(d, l) : pe(d));
|
|
577
|
+
}, [d, l]);
|
|
578
|
+
const a = /* @__PURE__ */ t.jsx(
|
|
579
579
|
ze,
|
|
580
580
|
{
|
|
581
581
|
rapidlyChangingMotionState: e,
|
|
582
582
|
dhParameters: n,
|
|
583
|
-
...
|
|
583
|
+
...c
|
|
584
584
|
}
|
|
585
585
|
);
|
|
586
586
|
return /* @__PURE__ */ t.jsxs(
|
|
587
|
-
|
|
587
|
+
ae,
|
|
588
588
|
{
|
|
589
|
-
fallback:
|
|
590
|
-
onError: (
|
|
591
|
-
console.warn(
|
|
589
|
+
fallback: a,
|
|
590
|
+
onError: (m) => {
|
|
591
|
+
console.warn(m);
|
|
592
592
|
},
|
|
593
593
|
children: [
|
|
594
|
-
/* @__PURE__ */ t.jsx(oe, { fallback:
|
|
595
|
-
|
|
594
|
+
/* @__PURE__ */ t.jsx(oe, { fallback: a, children: /* @__PURE__ */ t.jsx("group", { ref: s, children: /* @__PURE__ */ t.jsx(
|
|
595
|
+
fe,
|
|
596
596
|
{
|
|
597
597
|
rapidlyChangingMotionState: e,
|
|
598
598
|
dhParameters: n,
|
|
599
599
|
children: /* @__PURE__ */ t.jsx(
|
|
600
|
-
|
|
600
|
+
me,
|
|
601
601
|
{
|
|
602
602
|
modelURL: (() => {
|
|
603
|
-
const
|
|
604
|
-
if (!
|
|
603
|
+
const m = i(r, f);
|
|
604
|
+
if (!m) {
|
|
605
605
|
const g = new Blob([], { type: "model/gltf-binary" }), p = new File([g], `${r}.glb`, { type: "model/gltf-binary" });
|
|
606
606
|
return Promise.resolve(URL.createObjectURL(p));
|
|
607
607
|
}
|
|
608
|
-
return
|
|
608
|
+
return m;
|
|
609
609
|
})(),
|
|
610
610
|
postModelRender: u,
|
|
611
611
|
flangeRef: o,
|
|
612
|
-
...
|
|
612
|
+
...c
|
|
613
613
|
}
|
|
614
614
|
)
|
|
615
615
|
}
|
|
616
616
|
) }) }),
|
|
617
|
-
/* @__PURE__ */ t.jsx(
|
|
617
|
+
/* @__PURE__ */ t.jsx(de, {})
|
|
618
618
|
]
|
|
619
619
|
}
|
|
620
620
|
);
|
|
@@ -622,14 +622,14 @@ const pe = (e, r) => {
|
|
|
622
622
|
);
|
|
623
623
|
function We({
|
|
624
624
|
connectedMotionGroup: e,
|
|
625
|
-
getModel: r =
|
|
625
|
+
getModel: r = C,
|
|
626
626
|
flangeRef: n,
|
|
627
627
|
transparentColor: i,
|
|
628
628
|
postModelRender: o,
|
|
629
629
|
...u
|
|
630
630
|
}) {
|
|
631
631
|
return e.dhParameters ? /* @__PURE__ */ t.jsx(
|
|
632
|
-
|
|
632
|
+
xe,
|
|
633
633
|
{
|
|
634
634
|
rapidlyChangingMotionState: e.rapidlyChangingMotionState,
|
|
635
635
|
modelFromController: e.modelFromController || "",
|
|
@@ -642,7 +642,7 @@ function We({
|
|
|
642
642
|
}
|
|
643
643
|
) : null;
|
|
644
644
|
}
|
|
645
|
-
const it =
|
|
645
|
+
const it = P(
|
|
646
646
|
Te(
|
|
647
647
|
({
|
|
648
648
|
robotName: e,
|
|
@@ -651,41 +651,41 @@ const it = I(
|
|
|
651
651
|
operationMode: i,
|
|
652
652
|
driveToHomeEnabled: o = !1,
|
|
653
653
|
onDriveToHomePress: u,
|
|
654
|
-
onDriveToHomeRelease:
|
|
654
|
+
onDriveToHomeRelease: l,
|
|
655
655
|
connectedMotionGroup: f,
|
|
656
|
-
robotComponent:
|
|
656
|
+
robotComponent: c = We,
|
|
657
657
|
customContentComponent: d,
|
|
658
|
-
className:
|
|
658
|
+
className: h
|
|
659
659
|
}) => {
|
|
660
660
|
var W;
|
|
661
|
-
const s =
|
|
662
|
-
|
|
663
|
-
const
|
|
661
|
+
const s = Me(), { t: a } = Ge(), [m, g] = G(!1), p = R(null), j = R(null), [y, D] = G(!1), [k, we] = G({ width: 400, height: 600 }), [$e, be] = G(0);
|
|
662
|
+
T(() => {
|
|
663
|
+
const A = () => {
|
|
664
664
|
if (j.current) {
|
|
665
|
-
const { offsetWidth: $, offsetHeight:
|
|
666
|
-
D($ >
|
|
665
|
+
const { offsetWidth: $, offsetHeight: N } = j.current;
|
|
666
|
+
D($ > N), we({ width: $, height: N });
|
|
667
667
|
}
|
|
668
668
|
};
|
|
669
|
-
|
|
670
|
-
const
|
|
671
|
-
return j.current &&
|
|
672
|
-
|
|
669
|
+
A();
|
|
670
|
+
const J = new ResizeObserver(A);
|
|
671
|
+
return j.current && J.observe(j.current), () => {
|
|
672
|
+
J.disconnect();
|
|
673
673
|
};
|
|
674
674
|
}, []);
|
|
675
|
-
const E =
|
|
676
|
-
|
|
677
|
-
}, []),
|
|
675
|
+
const E = _(() => {
|
|
676
|
+
be((A) => A + 1);
|
|
677
|
+
}, []), F = _(() => {
|
|
678
678
|
!o || !u || (g(!0), u());
|
|
679
|
-
}, [o, u]),
|
|
680
|
-
!o || !
|
|
681
|
-
}, [o,
|
|
682
|
-
|
|
683
|
-
}, [
|
|
679
|
+
}, [o, u]), I = _(() => {
|
|
680
|
+
!o || !l || (g(!1), l());
|
|
681
|
+
}, [o, l]), B = _(() => {
|
|
682
|
+
m && l && (g(!1), l());
|
|
683
|
+
}, [m, l]), M = y ? k.width < 350 : k.height < 200, S = y ? k.height < 310 : k.height < 450;
|
|
684
684
|
return /* @__PURE__ */ t.jsx(
|
|
685
|
-
|
|
685
|
+
_e,
|
|
686
686
|
{
|
|
687
687
|
ref: j,
|
|
688
|
-
className:
|
|
688
|
+
className: h,
|
|
689
689
|
sx: {
|
|
690
690
|
width: "100%",
|
|
691
691
|
height: "100%",
|
|
@@ -718,10 +718,10 @@ const it = I(
|
|
|
718
718
|
mr: { xs: 0.75, sm: 1, md: 1.5 },
|
|
719
719
|
overflow: "hidden",
|
|
720
720
|
// Prevent content from affecting container size
|
|
721
|
-
display:
|
|
721
|
+
display: M ? "none" : "block"
|
|
722
722
|
},
|
|
723
|
-
children: !
|
|
724
|
-
|
|
723
|
+
children: !M && /* @__PURE__ */ t.jsxs(
|
|
724
|
+
H,
|
|
725
725
|
{
|
|
726
726
|
orthographic: !0,
|
|
727
727
|
camera: {
|
|
@@ -743,8 +743,8 @@ const it = I(
|
|
|
743
743
|
gl: { alpha: !0, antialias: !0 },
|
|
744
744
|
children: [
|
|
745
745
|
/* @__PURE__ */ t.jsx(Q, {}),
|
|
746
|
-
/* @__PURE__ */ t.jsx(
|
|
747
|
-
|
|
746
|
+
/* @__PURE__ */ t.jsx(Y, { fit: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ t.jsx(
|
|
747
|
+
c,
|
|
748
748
|
{
|
|
749
749
|
connectedMotionGroup: f,
|
|
750
750
|
postModelRender: E
|
|
@@ -763,7 +763,7 @@ const it = I(
|
|
|
763
763
|
display: "flex",
|
|
764
764
|
flexDirection: "column",
|
|
765
765
|
justifyContent: "flex-start",
|
|
766
|
-
width:
|
|
766
|
+
width: M ? "100%" : "50%"
|
|
767
767
|
},
|
|
768
768
|
children: [
|
|
769
769
|
/* @__PURE__ */ t.jsxs(
|
|
@@ -775,7 +775,7 @@ const it = I(
|
|
|
775
775
|
textAlign: "left"
|
|
776
776
|
},
|
|
777
777
|
children: [
|
|
778
|
-
/* @__PURE__ */ t.jsx(
|
|
778
|
+
/* @__PURE__ */ t.jsx(q, { variant: "h6", component: "h2", sx: { mb: 1 }, children: e }),
|
|
779
779
|
/* @__PURE__ */ t.jsx(
|
|
780
780
|
Z,
|
|
781
781
|
{
|
|
@@ -799,10 +799,10 @@ const it = I(
|
|
|
799
799
|
justifyContent: "space-between"
|
|
800
800
|
},
|
|
801
801
|
children: [
|
|
802
|
-
!
|
|
802
|
+
!S && d && /* @__PURE__ */ t.jsxs(b, { children: [
|
|
803
803
|
/* @__PURE__ */ t.jsx(d, {}),
|
|
804
804
|
/* @__PURE__ */ t.jsx(
|
|
805
|
-
|
|
805
|
+
X,
|
|
806
806
|
{
|
|
807
807
|
sx: {
|
|
808
808
|
mt: 1,
|
|
@@ -817,7 +817,7 @@ const it = I(
|
|
|
817
817
|
b,
|
|
818
818
|
{
|
|
819
819
|
sx: {
|
|
820
|
-
mt: !
|
|
820
|
+
mt: !S && d ? "auto" : 0
|
|
821
821
|
},
|
|
822
822
|
children: /* @__PURE__ */ t.jsx(
|
|
823
823
|
b,
|
|
@@ -829,24 +829,24 @@ const it = I(
|
|
|
829
829
|
mb: { xs: 0.5, sm: 0.75, md: 1 }
|
|
830
830
|
},
|
|
831
831
|
children: /* @__PURE__ */ t.jsx(
|
|
832
|
-
|
|
832
|
+
K,
|
|
833
833
|
{
|
|
834
834
|
ref: p,
|
|
835
835
|
variant: "contained",
|
|
836
836
|
color: "secondary",
|
|
837
837
|
size: "small",
|
|
838
838
|
disabled: !o,
|
|
839
|
-
onMouseDown:
|
|
840
|
-
onMouseUp:
|
|
839
|
+
onMouseDown: F,
|
|
840
|
+
onMouseUp: I,
|
|
841
841
|
onMouseLeave: B,
|
|
842
|
-
onTouchStart:
|
|
843
|
-
onTouchEnd:
|
|
842
|
+
onTouchStart: F,
|
|
843
|
+
onTouchEnd: I,
|
|
844
844
|
sx: {
|
|
845
845
|
textTransform: "none",
|
|
846
846
|
px: 1.5,
|
|
847
847
|
py: 0.5
|
|
848
848
|
},
|
|
849
|
-
children:
|
|
849
|
+
children: a("RobotCard.DriveToHome.bt")
|
|
850
850
|
}
|
|
851
851
|
)
|
|
852
852
|
}
|
|
@@ -870,7 +870,7 @@ const it = I(
|
|
|
870
870
|
},
|
|
871
871
|
children: [
|
|
872
872
|
/* @__PURE__ */ t.jsxs(b, { children: [
|
|
873
|
-
/* @__PURE__ */ t.jsx(
|
|
873
|
+
/* @__PURE__ */ t.jsx(q, { variant: "h6", component: "h2", sx: { mb: 1 }, children: e }),
|
|
874
874
|
/* @__PURE__ */ t.jsx(
|
|
875
875
|
Z,
|
|
876
876
|
{
|
|
@@ -884,16 +884,16 @@ const it = I(
|
|
|
884
884
|
b,
|
|
885
885
|
{
|
|
886
886
|
sx: {
|
|
887
|
-
flex:
|
|
887
|
+
flex: M ? 0 : 1,
|
|
888
888
|
position: "relative",
|
|
889
|
-
minHeight:
|
|
890
|
-
height:
|
|
889
|
+
minHeight: M ? 0 : { xs: 120, sm: 150, md: 200 },
|
|
890
|
+
height: M ? 0 : "auto",
|
|
891
891
|
borderRadius: 1,
|
|
892
892
|
overflow: "hidden",
|
|
893
|
-
display:
|
|
893
|
+
display: M ? "none" : "block"
|
|
894
894
|
},
|
|
895
|
-
children: !
|
|
896
|
-
|
|
895
|
+
children: !M && /* @__PURE__ */ t.jsxs(
|
|
896
|
+
H,
|
|
897
897
|
{
|
|
898
898
|
orthographic: !0,
|
|
899
899
|
camera: {
|
|
@@ -913,8 +913,8 @@ const it = I(
|
|
|
913
913
|
gl: { alpha: !0, antialias: !0 },
|
|
914
914
|
children: [
|
|
915
915
|
/* @__PURE__ */ t.jsx(Q, {}),
|
|
916
|
-
/* @__PURE__ */ t.jsx(
|
|
917
|
-
|
|
916
|
+
/* @__PURE__ */ t.jsx(Y, { fit: !0, clip: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ t.jsx(
|
|
917
|
+
c,
|
|
918
918
|
{
|
|
919
919
|
connectedMotionGroup: f,
|
|
920
920
|
postModelRender: E
|
|
@@ -926,10 +926,10 @@ const it = I(
|
|
|
926
926
|
}
|
|
927
927
|
),
|
|
928
928
|
/* @__PURE__ */ t.jsxs(b, { children: [
|
|
929
|
-
!
|
|
929
|
+
!S && d && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
930
930
|
/* @__PURE__ */ t.jsx(d, {}),
|
|
931
931
|
/* @__PURE__ */ t.jsx(
|
|
932
|
-
|
|
932
|
+
X,
|
|
933
933
|
{
|
|
934
934
|
sx: {
|
|
935
935
|
mt: 1,
|
|
@@ -946,28 +946,28 @@ const it = I(
|
|
|
946
946
|
sx: {
|
|
947
947
|
display: "flex",
|
|
948
948
|
justifyContent: "flex-start",
|
|
949
|
-
mt: !
|
|
949
|
+
mt: !S && d ? { xs: 1, sm: 2, md: 5 } : { xs: 0.5, sm: 1, md: 2 },
|
|
950
950
|
mb: { xs: 0.5, sm: 0.75, md: 1 }
|
|
951
951
|
},
|
|
952
952
|
children: /* @__PURE__ */ t.jsx(
|
|
953
|
-
|
|
953
|
+
K,
|
|
954
954
|
{
|
|
955
955
|
ref: p,
|
|
956
956
|
variant: "contained",
|
|
957
957
|
color: "secondary",
|
|
958
958
|
size: "small",
|
|
959
959
|
disabled: !o,
|
|
960
|
-
onMouseDown:
|
|
961
|
-
onMouseUp:
|
|
960
|
+
onMouseDown: F,
|
|
961
|
+
onMouseUp: I,
|
|
962
962
|
onMouseLeave: B,
|
|
963
|
-
onTouchStart:
|
|
964
|
-
onTouchEnd:
|
|
963
|
+
onTouchStart: F,
|
|
964
|
+
onTouchEnd: I,
|
|
965
965
|
sx: {
|
|
966
966
|
textTransform: "none",
|
|
967
967
|
px: 1.5,
|
|
968
968
|
py: 0.5
|
|
969
969
|
},
|
|
970
|
-
children:
|
|
970
|
+
children: a("RobotCard.DriveToHome.bt")
|
|
971
971
|
}
|
|
972
972
|
)
|
|
973
973
|
}
|
|
@@ -981,70 +981,70 @@ const it = I(
|
|
|
981
981
|
}
|
|
982
982
|
)
|
|
983
983
|
), at = Array(6).fill(2 * Math.PI);
|
|
984
|
-
function
|
|
984
|
+
function ge({
|
|
985
985
|
rapidlyChangingMotionState: e,
|
|
986
986
|
dhParameters: r,
|
|
987
987
|
onTranslationChanged: n,
|
|
988
988
|
children: i
|
|
989
989
|
}) {
|
|
990
|
-
const o = R([]), u = R([]),
|
|
991
|
-
|
|
990
|
+
const o = R([]), u = R([]), l = R(null), { invalidate: f } = ne();
|
|
991
|
+
T(() => {
|
|
992
992
|
const s = e.joint_position.filter(
|
|
993
|
-
(
|
|
993
|
+
(a) => a !== void 0
|
|
994
994
|
);
|
|
995
|
-
return
|
|
995
|
+
return l.current = new se(s, {
|
|
996
996
|
tension: 120,
|
|
997
997
|
// Controls spring stiffness - higher values create faster, more responsive motion
|
|
998
998
|
friction: 20,
|
|
999
999
|
// Controls damping - higher values reduce oscillation and create smoother settling
|
|
1000
1000
|
threshold: 1e-3
|
|
1001
1001
|
}), () => {
|
|
1002
|
-
var
|
|
1003
|
-
(
|
|
1002
|
+
var a;
|
|
1003
|
+
(a = l.current) == null || a.destroy();
|
|
1004
1004
|
};
|
|
1005
|
-
}, []), re((s,
|
|
1006
|
-
if (
|
|
1007
|
-
const
|
|
1008
|
-
d(),
|
|
1005
|
+
}, []), re((s, a) => {
|
|
1006
|
+
if (l.current) {
|
|
1007
|
+
const m = l.current.update(a);
|
|
1008
|
+
d(), m || f();
|
|
1009
1009
|
}
|
|
1010
1010
|
});
|
|
1011
|
-
function
|
|
1012
|
-
s && (u.current =
|
|
1011
|
+
function c(s) {
|
|
1012
|
+
s && (u.current = le(s), d(), f());
|
|
1013
1013
|
}
|
|
1014
1014
|
function d() {
|
|
1015
|
-
var
|
|
1016
|
-
const s = ((
|
|
1015
|
+
var a;
|
|
1016
|
+
const s = ((a = l.current) == null ? void 0 : a.getCurrentValues()) || [];
|
|
1017
1017
|
if (n)
|
|
1018
1018
|
n(u.current, s);
|
|
1019
1019
|
else
|
|
1020
|
-
for (const [
|
|
1021
|
-
const j = r[
|
|
1022
|
-
g.position.y = j * (s[
|
|
1020
|
+
for (const [m, g] of u.current.entries()) {
|
|
1021
|
+
const j = r[m].reverse_rotation_direction ? -1 : 1;
|
|
1022
|
+
g.position.y = j * (s[m] || 0) / 1e3;
|
|
1023
1023
|
}
|
|
1024
1024
|
}
|
|
1025
|
-
const
|
|
1025
|
+
const h = _(() => {
|
|
1026
1026
|
const s = e.joint_position.filter(
|
|
1027
|
-
(
|
|
1027
|
+
(a) => a !== void 0
|
|
1028
1028
|
);
|
|
1029
1029
|
requestAnimationFrame(() => {
|
|
1030
|
-
var
|
|
1031
|
-
o.current = s, (
|
|
1030
|
+
var a;
|
|
1031
|
+
o.current = s, (a = l.current) == null || a.setTarget(s);
|
|
1032
1032
|
});
|
|
1033
1033
|
}, [e]);
|
|
1034
|
-
return
|
|
1035
|
-
|
|
1036
|
-
}, [e,
|
|
1037
|
-
|
|
1038
|
-
}), /* @__PURE__ */ t.jsx("group", { ref:
|
|
1034
|
+
return T(() => {
|
|
1035
|
+
h();
|
|
1036
|
+
}, [e, h]), ie(() => {
|
|
1037
|
+
h();
|
|
1038
|
+
}), /* @__PURE__ */ t.jsx("group", { ref: c, children: i });
|
|
1039
1039
|
}
|
|
1040
|
-
function
|
|
1040
|
+
function ye({
|
|
1041
1041
|
rapidlyChangingMotionState: e,
|
|
1042
1042
|
dhParameters: r,
|
|
1043
1043
|
...n
|
|
1044
1044
|
}) {
|
|
1045
1045
|
const i = new w(), o = R(null), u = R(null);
|
|
1046
|
-
function
|
|
1047
|
-
const
|
|
1046
|
+
function l(d) {
|
|
1047
|
+
const h = new w();
|
|
1048
1048
|
for (let g = 0; g < r.length; g++) {
|
|
1049
1049
|
const p = r[g], j = d[g] ?? 0, y = new w().makeRotationY(p.theta).multiply(
|
|
1050
1050
|
new w().makeTranslation(
|
|
@@ -1053,17 +1053,17 @@ function je({
|
|
|
1053
1053
|
0
|
|
1054
1054
|
)
|
|
1055
1055
|
).multiply(new w().makeRotationX(p.alpha));
|
|
1056
|
-
|
|
1056
|
+
h.multiply(y);
|
|
1057
1057
|
}
|
|
1058
|
-
const s = new
|
|
1059
|
-
return
|
|
1058
|
+
const s = new L(), a = new z(), m = new L();
|
|
1059
|
+
return h.decompose(s, a, m), s;
|
|
1060
1060
|
}
|
|
1061
|
-
const f =
|
|
1062
|
-
function
|
|
1061
|
+
const f = l(e.joint_position);
|
|
1062
|
+
function c(d, h) {
|
|
1063
1063
|
i.identity();
|
|
1064
|
-
let s = new
|
|
1064
|
+
let s = new L();
|
|
1065
1065
|
for (let p = 0; p < r.length; p++) {
|
|
1066
|
-
const j =
|
|
1066
|
+
const j = h[p] ?? 0, y = r[p], D = new w().makeRotationY(y.theta).multiply(
|
|
1067
1067
|
new w().makeTranslation(
|
|
1068
1068
|
y.a / 1e3,
|
|
1069
1069
|
(y.d + j * (y.reverse_rotation_direction ? -1 : 1)) / 1e3,
|
|
@@ -1072,28 +1072,28 @@ function je({
|
|
|
1072
1072
|
).multiply(new w().makeRotationX(y.alpha));
|
|
1073
1073
|
i.multiply(D);
|
|
1074
1074
|
}
|
|
1075
|
-
const
|
|
1076
|
-
if (i.decompose(
|
|
1075
|
+
const a = new L(), m = new z(), g = new L();
|
|
1076
|
+
if (i.decompose(a, m, g), s = a, o.current && o.current.position.set(s.x, s.y, s.z), u.current) {
|
|
1077
1077
|
const p = u.current.geometry;
|
|
1078
1078
|
p && p.setPositions && p.setPositions([0, 0, 0, s.x, s.y, s.z]);
|
|
1079
1079
|
}
|
|
1080
1080
|
}
|
|
1081
1081
|
return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsx(
|
|
1082
|
-
|
|
1082
|
+
ge,
|
|
1083
1083
|
{
|
|
1084
1084
|
rapidlyChangingMotionState: e,
|
|
1085
1085
|
dhParameters: r,
|
|
1086
|
-
onTranslationChanged:
|
|
1086
|
+
onTranslationChanged: c,
|
|
1087
1087
|
children: /* @__PURE__ */ t.jsxs("group", { ...n, name: "Scene", children: [
|
|
1088
1088
|
/* @__PURE__ */ t.jsxs("mesh", { name: "Base", position: [0, 0, 0], children: [
|
|
1089
1089
|
/* @__PURE__ */ t.jsx("sphereGeometry", { args: [0.02, 32, 32] }),
|
|
1090
1090
|
/* @__PURE__ */ t.jsx("meshStandardMaterial", { color: "green", depthTest: !0 })
|
|
1091
1091
|
] }),
|
|
1092
1092
|
/* @__PURE__ */ t.jsx(
|
|
1093
|
-
|
|
1093
|
+
U,
|
|
1094
1094
|
{
|
|
1095
1095
|
ref: u,
|
|
1096
|
-
points: [new
|
|
1096
|
+
points: [new L(0, 0, 0), f],
|
|
1097
1097
|
color: "White",
|
|
1098
1098
|
lineWidth: 5
|
|
1099
1099
|
}
|
|
@@ -1106,64 +1106,64 @@ function je({
|
|
|
1106
1106
|
}
|
|
1107
1107
|
) });
|
|
1108
1108
|
}
|
|
1109
|
-
const
|
|
1109
|
+
const je = P(
|
|
1110
1110
|
({
|
|
1111
1111
|
rapidlyChangingMotionState: e,
|
|
1112
1112
|
modelFromController: r,
|
|
1113
1113
|
dhParameters: n,
|
|
1114
|
-
getModel: i =
|
|
1114
|
+
getModel: i = C,
|
|
1115
1115
|
flangeRef: o,
|
|
1116
1116
|
postModelRender: u,
|
|
1117
|
-
transparentColor:
|
|
1117
|
+
transparentColor: l,
|
|
1118
1118
|
instanceUrl: f,
|
|
1119
|
-
...
|
|
1119
|
+
...c
|
|
1120
1120
|
}) => {
|
|
1121
|
-
const [d,
|
|
1122
|
-
m
|
|
1121
|
+
const [d, h] = G(null), s = _((m) => {
|
|
1122
|
+
h(m);
|
|
1123
1123
|
}, []);
|
|
1124
|
-
|
|
1125
|
-
d && (
|
|
1126
|
-
}, [d,
|
|
1127
|
-
const
|
|
1128
|
-
|
|
1124
|
+
T(() => {
|
|
1125
|
+
d && (l ? he(d, l) : pe(d));
|
|
1126
|
+
}, [d, l]);
|
|
1127
|
+
const a = /* @__PURE__ */ t.jsx(
|
|
1128
|
+
ye,
|
|
1129
1129
|
{
|
|
1130
1130
|
rapidlyChangingMotionState: e,
|
|
1131
1131
|
dhParameters: n,
|
|
1132
|
-
...
|
|
1132
|
+
...c
|
|
1133
1133
|
}
|
|
1134
1134
|
);
|
|
1135
1135
|
return /* @__PURE__ */ t.jsxs(
|
|
1136
|
-
|
|
1136
|
+
ae,
|
|
1137
1137
|
{
|
|
1138
|
-
fallback:
|
|
1139
|
-
onError: (
|
|
1140
|
-
console.warn(
|
|
1138
|
+
fallback: a,
|
|
1139
|
+
onError: (m) => {
|
|
1140
|
+
console.warn(m);
|
|
1141
1141
|
},
|
|
1142
1142
|
children: [
|
|
1143
|
-
/* @__PURE__ */ t.jsx(oe, { fallback:
|
|
1144
|
-
|
|
1143
|
+
/* @__PURE__ */ t.jsx(oe, { fallback: a, children: /* @__PURE__ */ t.jsx("group", { ref: s, children: /* @__PURE__ */ t.jsx(
|
|
1144
|
+
ge,
|
|
1145
1145
|
{
|
|
1146
1146
|
rapidlyChangingMotionState: e,
|
|
1147
1147
|
dhParameters: n,
|
|
1148
1148
|
children: /* @__PURE__ */ t.jsx(
|
|
1149
|
-
|
|
1149
|
+
me,
|
|
1150
1150
|
{
|
|
1151
1151
|
modelURL: (() => {
|
|
1152
|
-
const
|
|
1153
|
-
if (!
|
|
1152
|
+
const m = i(r, f);
|
|
1153
|
+
if (!m) {
|
|
1154
1154
|
const g = new Blob([], { type: "model/gltf-binary" }), p = new File([g], `${r}.glb`, { type: "model/gltf-binary" });
|
|
1155
1155
|
return Promise.resolve(URL.createObjectURL(p));
|
|
1156
1156
|
}
|
|
1157
|
-
return
|
|
1157
|
+
return m;
|
|
1158
1158
|
})(),
|
|
1159
1159
|
postModelRender: u,
|
|
1160
1160
|
flangeRef: o,
|
|
1161
|
-
...
|
|
1161
|
+
...c
|
|
1162
1162
|
}
|
|
1163
1163
|
)
|
|
1164
1164
|
}
|
|
1165
1165
|
) }) }),
|
|
1166
|
-
/* @__PURE__ */ t.jsx(
|
|
1166
|
+
/* @__PURE__ */ t.jsx(de, {})
|
|
1167
1167
|
]
|
|
1168
1168
|
}
|
|
1169
1169
|
);
|
|
@@ -1171,7 +1171,7 @@ const we = I(
|
|
|
1171
1171
|
);
|
|
1172
1172
|
function lt({
|
|
1173
1173
|
connectedMotionGroup: e,
|
|
1174
|
-
getModel: r =
|
|
1174
|
+
getModel: r = C,
|
|
1175
1175
|
flangeRef: n,
|
|
1176
1176
|
transparentColor: i,
|
|
1177
1177
|
postModelRender: o,
|
|
@@ -1179,12 +1179,12 @@ function lt({
|
|
|
1179
1179
|
}) {
|
|
1180
1180
|
if (!e.dhParameters)
|
|
1181
1181
|
return null;
|
|
1182
|
-
const
|
|
1183
|
-
return
|
|
1184
|
-
|
|
1182
|
+
const l = e.modelFromController || "";
|
|
1183
|
+
return l && r(l) ? /* @__PURE__ */ t.jsx(
|
|
1184
|
+
je,
|
|
1185
1185
|
{
|
|
1186
1186
|
rapidlyChangingMotionState: e.rapidlyChangingMotionState,
|
|
1187
|
-
modelFromController:
|
|
1187
|
+
modelFromController: l,
|
|
1188
1188
|
dhParameters: e.dhParameters,
|
|
1189
1189
|
getModel: r,
|
|
1190
1190
|
flangeRef: n,
|
|
@@ -1193,7 +1193,7 @@ function lt({
|
|
|
1193
1193
|
...u
|
|
1194
1194
|
}
|
|
1195
1195
|
) : /* @__PURE__ */ t.jsx(
|
|
1196
|
-
|
|
1196
|
+
ye,
|
|
1197
1197
|
{
|
|
1198
1198
|
rapidlyChangingMotionState: e.rapidlyChangingMotionState,
|
|
1199
1199
|
dhParameters: e.dhParameters,
|
|
@@ -1224,7 +1224,7 @@ const ee = {
|
|
|
1224
1224
|
0
|
|
1225
1225
|
]
|
|
1226
1226
|
};
|
|
1227
|
-
function
|
|
1227
|
+
function Je(e) {
|
|
1228
1228
|
const [r] = e.split("_");
|
|
1229
1229
|
switch (r) {
|
|
1230
1230
|
case "ABB":
|
|
@@ -1242,57 +1242,16 @@ function Ke(e) {
|
|
|
1242
1242
|
}
|
|
1243
1243
|
}
|
|
1244
1244
|
function ct(e, r) {
|
|
1245
|
-
const n =
|
|
1245
|
+
const n = Je(e);
|
|
1246
1246
|
return n && n in ee ? ee[n] : r || null;
|
|
1247
1247
|
}
|
|
1248
|
-
const ut =
|
|
1248
|
+
const ut = P((e) => {
|
|
1249
1249
|
const {
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
n
|
|
1256
|
-
), [, f] = T(!1), l = M(async () => {
|
|
1257
|
-
const m = new se({ instanceUrl: r });
|
|
1258
|
-
try {
|
|
1259
|
-
const s = await m.api.motionGroupModels.getMotionGroupKinematicModel(
|
|
1260
|
-
i
|
|
1261
|
-
);
|
|
1262
|
-
a(s.inverse_solver);
|
|
1263
|
-
} catch {
|
|
1264
|
-
console.warn(
|
|
1265
|
-
`Failed to fetch kinematic model from API for ${i}, falling back to local config`
|
|
1266
|
-
);
|
|
1267
|
-
} finally {
|
|
1268
|
-
setTimeout(() => f(!0), 0);
|
|
1269
|
-
}
|
|
1270
|
-
}, [i, r]);
|
|
1271
|
-
_(() => {
|
|
1272
|
-
n === void 0 && !!i && !!r && l();
|
|
1273
|
-
}, [n, i, l, r]);
|
|
1274
|
-
const d = Ge(() => [
|
|
1275
|
-
"KUKA_DKP250",
|
|
1276
|
-
"KUKA_DKP500_2",
|
|
1277
|
-
"YASKAWA_TURN1",
|
|
1278
|
-
"YASKAWA_TURN2",
|
|
1279
|
-
"YASKAWA_TURN3"
|
|
1280
|
-
].includes(i), [i]);
|
|
1281
|
-
return u || d ? /* @__PURE__ */ t.jsx(
|
|
1282
|
-
ge,
|
|
1283
|
-
{
|
|
1284
|
-
instanceUrl: r,
|
|
1285
|
-
modelFromController: i,
|
|
1286
|
-
...o
|
|
1287
|
-
}
|
|
1288
|
-
) : u === null ? /* @__PURE__ */ t.jsx(
|
|
1289
|
-
we,
|
|
1290
|
-
{
|
|
1291
|
-
instanceUrl: r,
|
|
1292
|
-
modelFromController: i,
|
|
1293
|
-
...o
|
|
1294
|
-
}
|
|
1295
|
-
) : null;
|
|
1250
|
+
inverseSolver: r,
|
|
1251
|
+
jointType: n,
|
|
1252
|
+
...i
|
|
1253
|
+
} = e, o = Ve(() => !r && n === "REVOLUTE_JOINT", [r, n]);
|
|
1254
|
+
return r || o ? /* @__PURE__ */ t.jsx(xe, { ...i }) : /* @__PURE__ */ t.jsx(je, { ...i });
|
|
1296
1255
|
});
|
|
1297
1256
|
export {
|
|
1298
1257
|
rt as C,
|
|
@@ -1304,11 +1263,11 @@ export {
|
|
|
1304
1263
|
st as T,
|
|
1305
1264
|
ut as a,
|
|
1306
1265
|
it as b,
|
|
1307
|
-
|
|
1308
|
-
|
|
1266
|
+
je as c,
|
|
1267
|
+
xe as d,
|
|
1309
1268
|
at as e,
|
|
1310
|
-
|
|
1311
|
-
|
|
1269
|
+
C as f,
|
|
1270
|
+
Je as g,
|
|
1312
1271
|
ct as h
|
|
1313
1272
|
};
|
|
1314
|
-
//# sourceMappingURL=MotionGroupVisualizer-
|
|
1273
|
+
//# sourceMappingURL=MotionGroupVisualizer-DzSF9oW7.js.map
|