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