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