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