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