@wandelbots/wandelbots-js-react-components 6.0.0 → 6.1.0-pr.feat-integrate-kinematicChainOffset.635.bba0495
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -8
- package/dist/3d.cjs +1 -1
- package/dist/3d.d.ts +2 -0
- package/dist/3d.js +19 -13
- package/dist/chunks/{MotionGroupVisualizer-BRec-k-p.js → MotionGroupVisualizer-CEiRJk_l.js} +610 -568
- package/dist/chunks/MotionGroupVisualizer-rrhU4sYi.cjs +1 -0
- package/dist/chunks/{theming-BwZXb5-H.cjs → theming-DfSy4-Ic.cjs} +1 -1
- package/dist/chunks/{theming-B2dYJ4Ca.js → theming-mF9Rt8SS.js} +26 -26
- package/dist/chunks/{interpolation-DG8VTxzS.js → useSmoothedMotionState-DyDgSVYX.js} +191 -146
- package/dist/chunks/useSmoothedMotionState-VYxEIyfr.cjs +1 -0
- package/dist/components/robots/LinearAxisAnimator.d.ts +11 -2
- package/dist/components/robots/MotionGroupVisualizer.d.ts +15 -0
- package/dist/components/robots/RobotAnimator.d.ts +10 -1
- package/dist/components/robots/SupportedLinearAxis.d.ts +22 -1
- package/dist/components/robots/SupportedRobot.d.ts +22 -1
- 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 +67 -63
- 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
|
|
4
|
-
import { ConvexGeometry as
|
|
5
|
-
import
|
|
6
|
-
import { d as
|
|
7
|
-
import { Environment 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
|
|
9
|
+
import S from "@mui/material/Box";
|
|
10
|
+
import ne from "@mui/material/Button";
|
|
11
11
|
import Ue from "@mui/material/Card";
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { useThree as
|
|
15
|
-
import { observer as
|
|
16
|
-
import { useTranslation as
|
|
17
|
-
import {
|
|
18
|
-
import { Nova as
|
|
19
|
-
import { ErrorBoundary as
|
|
20
|
-
function
|
|
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
|
+
import { useTranslation as je } from "react-i18next";
|
|
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,28 +30,28 @@ 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
57
|
function We({
|
|
@@ -59,19 +59,19 @@ function We({
|
|
|
59
59
|
collider: n,
|
|
60
60
|
children: t
|
|
61
61
|
}) {
|
|
62
|
-
var f,
|
|
63
|
-
const
|
|
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
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
position: new x.Vector3(
|
|
69
|
+
a[0],
|
|
70
|
+
a[1],
|
|
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
|
);
|
|
@@ -80,19 +80,19 @@ function $e({
|
|
|
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 vt({
|
|
96
96
|
scene: e,
|
|
97
97
|
meshChildrenProvider: n
|
|
98
98
|
}) {
|
|
@@ -105,14 +105,14 @@ function xt({
|
|
|
105
105
|
}
|
|
106
106
|
) });
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
return /* @__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 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
|
+
G,
|
|
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
|
+
G,
|
|
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
|
+
G,
|
|
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
|
+
G,
|
|
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
|
+
G,
|
|
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
|
+
G,
|
|
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 ce = {
|
|
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 Mt({
|
|
193
193
|
safetyZones: e,
|
|
194
194
|
dhParameters: n,
|
|
195
195
|
...t
|
|
196
196
|
}) {
|
|
197
|
-
const
|
|
198
|
-
() =>
|
|
197
|
+
const a = D(
|
|
198
|
+
() => Ie(n ?? []),
|
|
199
199
|
[n]
|
|
200
|
-
),
|
|
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
|
-
),
|
|
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 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 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 Rt({
|
|
|
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,40 +285,40 @@ function Rt({
|
|
|
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
|
-
(
|
|
305
|
-
), [e,
|
|
303
|
+
}, f = D(() => Object.values(e ?? {}).map(
|
|
304
|
+
(l, o) => i(o, l)
|
|
305
|
+
), [e, a]);
|
|
306
306
|
return /* @__PURE__ */ r("group", { ...t, children: f });
|
|
307
307
|
}
|
|
308
|
-
function
|
|
308
|
+
function St({
|
|
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, 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
|
-
}).filter((
|
|
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,19 +328,19 @@ function vt({
|
|
|
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
|
|
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
|
-
const o = await
|
|
343
|
+
const o = await i.api.motionGroupModels.getMotionGroupGlbModel(
|
|
344
344
|
e
|
|
345
345
|
);
|
|
346
346
|
return URL.createObjectURL(o);
|
|
@@ -348,124 +348,121 @@ async function j(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
353
|
function me(e) {
|
|
354
354
|
function n(t) {
|
|
355
|
-
return t.children.length === 0 ? [t] : [t, ...t.children.flatMap((
|
|
355
|
+
return t.children.length === 0 ? [t] : [t, ...t.children.flatMap((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
|
-
function
|
|
368
|
-
if (
|
|
367
|
+
function a(i) {
|
|
368
|
+
if (ge(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
|
+
ye(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 be =
|
|
384
|
-
function({
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
}, []), fe((u, d) => {
|
|
401
|
-
if (!g.current) return;
|
|
402
|
-
o.current.length === 0 && c.current && p();
|
|
403
|
-
const b = g.current.update(d);
|
|
404
|
-
y(), b || i();
|
|
405
|
-
});
|
|
406
|
-
function l(u) {
|
|
407
|
-
c.current = u, u && p();
|
|
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(
|
|
393
|
+
n.joint_position.filter(
|
|
394
|
+
(g) => g !== void 0
|
|
395
|
+
)
|
|
396
|
+
), { invalidate: c } = he(), y = v(n);
|
|
397
|
+
y.current = n;
|
|
398
|
+
function m(g) {
|
|
399
|
+
p.current = g, g && h();
|
|
408
400
|
}
|
|
409
|
-
function
|
|
410
|
-
|
|
401
|
+
function h() {
|
|
402
|
+
p.current && (s.current = me(p.current), u(), c());
|
|
411
403
|
}
|
|
412
|
-
|
|
413
|
-
function
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
s(o.current, u);
|
|
404
|
+
Ge(o, () => ({ recollectJoints: h }));
|
|
405
|
+
function u() {
|
|
406
|
+
const g = d.current;
|
|
407
|
+
if (f)
|
|
408
|
+
f(s.current, g);
|
|
418
409
|
else
|
|
419
|
-
for (const [
|
|
420
|
-
const
|
|
421
|
-
|
|
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;
|
|
422
413
|
}
|
|
423
414
|
}
|
|
424
|
-
function
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
);
|
|
429
|
-
(b = g.current) == null || b.setTarget(d), i();
|
|
415
|
+
function b(g) {
|
|
416
|
+
d.current = g.joint_position.filter(
|
|
417
|
+
(R) => R !== void 0
|
|
418
|
+
), u(), c();
|
|
430
419
|
}
|
|
431
|
-
return
|
|
432
|
-
|
|
433
|
-
}),
|
|
434
|
-
|
|
435
|
-
}, [n]), /* @__PURE__ */ r(
|
|
420
|
+
return pe(() => {
|
|
421
|
+
b(y.current);
|
|
422
|
+
}), I(() => {
|
|
423
|
+
b(n);
|
|
424
|
+
}, [n]), /* @__PURE__ */ r(
|
|
425
|
+
"group",
|
|
426
|
+
{
|
|
427
|
+
ref: m,
|
|
428
|
+
position: a,
|
|
429
|
+
quaternion: i,
|
|
430
|
+
children: l
|
|
431
|
+
}
|
|
432
|
+
);
|
|
436
433
|
}
|
|
437
|
-
),
|
|
438
|
-
function
|
|
434
|
+
), Qe = "line", qe = "mesh";
|
|
435
|
+
function Ye({
|
|
439
436
|
rapidlyChangingMotionState: e,
|
|
440
437
|
dhParameters: n,
|
|
441
438
|
...t
|
|
442
439
|
}) {
|
|
443
|
-
const
|
|
444
|
-
|
|
445
|
-
|
|
440
|
+
const a = new M(), i = v([]), f = v([]);
|
|
441
|
+
ke.useEffect(() => {
|
|
442
|
+
i.current = new Array(n.length).fill(null), f.current = new Array(n.length).fill(null);
|
|
446
443
|
}, [n.length]);
|
|
447
|
-
function
|
|
448
|
-
const
|
|
449
|
-
|
|
450
|
-
const
|
|
451
|
-
|
|
452
|
-
).multiply(new
|
|
453
|
-
return
|
|
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 };
|
|
454
451
|
}
|
|
455
|
-
function o(
|
|
452
|
+
function o(s, d, c, y) {
|
|
456
453
|
if (!n)
|
|
457
454
|
return;
|
|
458
|
-
const
|
|
459
|
-
if (!
|
|
455
|
+
const m = n[s];
|
|
456
|
+
if (!m)
|
|
460
457
|
return;
|
|
461
|
-
const { a:
|
|
462
|
-
|
|
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);
|
|
463
460
|
}
|
|
464
|
-
function
|
|
465
|
-
|
|
466
|
-
for (let
|
|
467
|
-
const
|
|
468
|
-
|
|
461
|
+
function p(s, d) {
|
|
462
|
+
a.identity();
|
|
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]);
|
|
469
466
|
}
|
|
470
467
|
}
|
|
471
468
|
return /* @__PURE__ */ r(
|
|
@@ -473,153 +470,153 @@ function Ke({
|
|
|
473
470
|
{
|
|
474
471
|
rapidlyChangingMotionState: e,
|
|
475
472
|
dhParameters: n,
|
|
476
|
-
onRotationChanged:
|
|
477
|
-
children: /* @__PURE__ */
|
|
478
|
-
/* @__PURE__ */
|
|
473
|
+
onRotationChanged: p,
|
|
474
|
+
children: /* @__PURE__ */ w("group", { ...t, name: "Scene", children: [
|
|
475
|
+
/* @__PURE__ */ w("mesh", { children: [
|
|
479
476
|
/* @__PURE__ */ r("sphereGeometry", { args: [0.01, 32, 32] }),
|
|
480
477
|
/* @__PURE__ */ r("meshStandardMaterial", { color: "black", depthTest: !0 })
|
|
481
478
|
] }),
|
|
482
|
-
n == null ? void 0 : n.map((
|
|
483
|
-
const { a:
|
|
484
|
-
|
|
485
|
-
e.joint_position[
|
|
486
|
-
),
|
|
487
|
-
return /* @__PURE__ */
|
|
479
|
+
n == null ? void 0 : n.map((s, d) => {
|
|
480
|
+
const { a: c, b: y } = l(
|
|
481
|
+
s,
|
|
482
|
+
e.joint_position[d] ?? 0
|
|
483
|
+
), m = `dhrobot_J0${d}`;
|
|
484
|
+
return /* @__PURE__ */ w("group", { name: m, children: [
|
|
488
485
|
/* @__PURE__ */ r(
|
|
489
|
-
|
|
486
|
+
H,
|
|
490
487
|
{
|
|
491
|
-
ref: (
|
|
492
|
-
|
|
488
|
+
ref: (h) => {
|
|
489
|
+
i.current[d] = h;
|
|
493
490
|
},
|
|
494
|
-
name:
|
|
495
|
-
points: [
|
|
491
|
+
name: Qe,
|
|
492
|
+
points: [c, y],
|
|
496
493
|
color: "white",
|
|
497
494
|
lineWidth: 5
|
|
498
495
|
}
|
|
499
496
|
),
|
|
500
|
-
/* @__PURE__ */
|
|
497
|
+
/* @__PURE__ */ w(
|
|
501
498
|
"mesh",
|
|
502
499
|
{
|
|
503
|
-
ref: (
|
|
504
|
-
f.current[
|
|
500
|
+
ref: (h) => {
|
|
501
|
+
f.current[d] = h;
|
|
505
502
|
},
|
|
506
|
-
name:
|
|
507
|
-
position:
|
|
503
|
+
name: qe,
|
|
504
|
+
position: y,
|
|
508
505
|
children: [
|
|
509
506
|
/* @__PURE__ */ r("sphereGeometry", { args: [0.01, 32, 32] }),
|
|
510
507
|
/* @__PURE__ */ r("meshStandardMaterial", { color: "black", depthTest: !0 })
|
|
511
508
|
]
|
|
512
509
|
},
|
|
513
|
-
`mesh_${
|
|
510
|
+
`mesh_${d}`
|
|
514
511
|
)
|
|
515
|
-
] },
|
|
512
|
+
] }, m);
|
|
516
513
|
})
|
|
517
514
|
] })
|
|
518
515
|
}
|
|
519
516
|
);
|
|
520
517
|
}
|
|
521
|
-
const
|
|
522
|
-
function
|
|
523
|
-
return
|
|
518
|
+
const Xe = console.warn;
|
|
519
|
+
function xe() {
|
|
520
|
+
return I(() => {
|
|
524
521
|
console.warn = (e) => {
|
|
525
|
-
e !== "Cannot call the manual advancement of rafz whilst frameLoop is not set as demand" &&
|
|
522
|
+
e !== "Cannot call the manual advancement of rafz whilst frameLoop is not set as demand" && Xe(e);
|
|
526
523
|
};
|
|
527
524
|
}, []), null;
|
|
528
525
|
}
|
|
529
|
-
function
|
|
526
|
+
function Ke(e) {
|
|
530
527
|
return e.type === "Mesh";
|
|
531
528
|
}
|
|
532
|
-
function
|
|
529
|
+
function Ze({
|
|
533
530
|
url: e,
|
|
534
531
|
flangeRef: n,
|
|
535
532
|
postModelRender: t,
|
|
536
|
-
...
|
|
533
|
+
...a
|
|
537
534
|
}) {
|
|
538
|
-
const
|
|
539
|
-
(
|
|
540
|
-
|
|
535
|
+
const i = Fe(e), l = He(i, "robot.glb").gltf, o = L(
|
|
536
|
+
(s) => {
|
|
537
|
+
s && t && t();
|
|
541
538
|
},
|
|
542
539
|
[t]
|
|
543
540
|
);
|
|
544
|
-
function
|
|
541
|
+
function p(s) {
|
|
545
542
|
try {
|
|
546
|
-
return
|
|
543
|
+
return Ke(s) ? s.geometry ? /* @__PURE__ */ r(
|
|
547
544
|
"mesh",
|
|
548
545
|
{
|
|
549
|
-
name:
|
|
550
|
-
geometry:
|
|
551
|
-
material:
|
|
552
|
-
position:
|
|
553
|
-
rotation:
|
|
546
|
+
name: s.name,
|
|
547
|
+
geometry: s.geometry,
|
|
548
|
+
material: s.material,
|
|
549
|
+
position: s.position,
|
|
550
|
+
rotation: s.rotation
|
|
554
551
|
},
|
|
555
|
-
|
|
552
|
+
s.uuid
|
|
556
553
|
) : /* @__PURE__ */ r(
|
|
557
554
|
"group",
|
|
558
555
|
{
|
|
559
|
-
name:
|
|
560
|
-
position:
|
|
561
|
-
rotation:
|
|
556
|
+
name: s.name,
|
|
557
|
+
position: s.position,
|
|
558
|
+
rotation: s.rotation
|
|
562
559
|
},
|
|
563
|
-
|
|
560
|
+
s.uuid
|
|
564
561
|
) : /* @__PURE__ */ r(
|
|
565
562
|
"group",
|
|
566
563
|
{
|
|
567
|
-
name:
|
|
568
|
-
position:
|
|
569
|
-
rotation:
|
|
570
|
-
ref:
|
|
571
|
-
children:
|
|
564
|
+
name: s.name,
|
|
565
|
+
position: s.position,
|
|
566
|
+
rotation: s.rotation,
|
|
567
|
+
ref: ge(s) ? n : void 0,
|
|
568
|
+
children: s.children.map(p)
|
|
572
569
|
},
|
|
573
|
-
|
|
570
|
+
s.uuid
|
|
574
571
|
);
|
|
575
|
-
} catch (
|
|
576
|
-
return console.warn("Error rendering node",
|
|
572
|
+
} catch (d) {
|
|
573
|
+
return console.warn("Error rendering node", s.name, d), null;
|
|
577
574
|
}
|
|
578
575
|
}
|
|
579
|
-
return /* @__PURE__ */ r("group", { ...
|
|
576
|
+
return /* @__PURE__ */ r("group", { ...a, dispose: null, ref: o, children: p(l.scene) });
|
|
580
577
|
}
|
|
581
|
-
function
|
|
578
|
+
function we({
|
|
582
579
|
modelURL: e,
|
|
583
580
|
flangeRef: n,
|
|
584
581
|
postModelRender: t,
|
|
585
|
-
...
|
|
582
|
+
...a
|
|
586
583
|
}) {
|
|
587
|
-
const [
|
|
588
|
-
return
|
|
589
|
-
let
|
|
584
|
+
const [i, f] = k(null);
|
|
585
|
+
return I(() => {
|
|
586
|
+
let l = !1;
|
|
590
587
|
return (async () => {
|
|
591
588
|
try {
|
|
592
|
-
const
|
|
593
|
-
|
|
594
|
-
} catch (
|
|
595
|
-
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);
|
|
596
593
|
}
|
|
597
594
|
})(), () => {
|
|
598
|
-
|
|
595
|
+
l = !0;
|
|
599
596
|
};
|
|
600
|
-
}, [e]),
|
|
601
|
-
|
|
597
|
+
}, [e]), i ? /* @__PURE__ */ r(
|
|
598
|
+
Ze,
|
|
602
599
|
{
|
|
603
|
-
url:
|
|
600
|
+
url: i,
|
|
604
601
|
flangeRef: n,
|
|
605
602
|
postModelRender: t,
|
|
606
|
-
...
|
|
603
|
+
...a
|
|
607
604
|
}
|
|
608
605
|
) : null;
|
|
609
606
|
}
|
|
610
607
|
const Re = (e, n) => {
|
|
611
608
|
e.userData.isGhost || (e.traverse((t) => {
|
|
612
|
-
if (t instanceof
|
|
613
|
-
t.material instanceof
|
|
614
|
-
const
|
|
615
|
-
|
|
609
|
+
if (t instanceof x.Mesh) {
|
|
610
|
+
t.material instanceof x.Material && (t.material.colorWrite = !1);
|
|
611
|
+
const a = t.clone(), i = t.clone();
|
|
612
|
+
a.material = new x.MeshStandardMaterial({
|
|
616
613
|
depthTest: !0,
|
|
617
614
|
depthWrite: !0,
|
|
618
615
|
colorWrite: !1,
|
|
619
616
|
polygonOffset: !0,
|
|
620
617
|
polygonOffsetFactor: -1,
|
|
621
|
-
side:
|
|
622
|
-
}),
|
|
618
|
+
side: x.DoubleSide
|
|
619
|
+
}), a.userData.isGhost = !0, i.material = new x.MeshStandardMaterial({
|
|
623
620
|
color: n,
|
|
624
621
|
opacity: 0.3,
|
|
625
622
|
depthTest: !0,
|
|
@@ -627,172 +624,194 @@ const Re = (e, n) => {
|
|
|
627
624
|
transparent: !0,
|
|
628
625
|
polygonOffset: !0,
|
|
629
626
|
polygonOffsetFactor: -2,
|
|
630
|
-
side:
|
|
631
|
-
}),
|
|
627
|
+
side: x.DoubleSide
|
|
628
|
+
}), i.userData.isGhost = !0, t.parent && (t.parent.add(a), t.parent.add(i));
|
|
632
629
|
}
|
|
633
630
|
}), e.userData.isGhost = !0);
|
|
634
631
|
}, ve = (e) => {
|
|
635
632
|
if (!e.userData.isGhost) return;
|
|
636
633
|
const n = [];
|
|
637
634
|
e.traverse((t) => {
|
|
638
|
-
var
|
|
639
|
-
t instanceof
|
|
635
|
+
var a;
|
|
636
|
+
t instanceof x.Mesh && ((a = t.userData) != null && a.isGhost ? n.push(t) : t.material instanceof x.Material && (t.material.colorWrite = !0));
|
|
640
637
|
}), n.forEach((t) => {
|
|
641
638
|
t.parent && t.parent.remove(t);
|
|
642
639
|
}), e.userData.isGhost = !1;
|
|
643
|
-
}, Me =
|
|
640
|
+
}, Me = A(
|
|
644
641
|
({
|
|
645
642
|
rapidlyChangingMotionState: e,
|
|
646
643
|
modelFromController: n,
|
|
647
644
|
dhParameters: t,
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
645
|
+
chainOffsetPosition: a,
|
|
646
|
+
chainOffsetQuaternion: i,
|
|
647
|
+
getModel: f = W,
|
|
648
|
+
flangeRef: l,
|
|
649
|
+
postModelRender: o,
|
|
650
|
+
transparentColor: p,
|
|
651
|
+
instanceUrl: s,
|
|
652
|
+
...d
|
|
654
653
|
}) => {
|
|
655
|
-
const [
|
|
656
|
-
|
|
657
|
-
}, []),
|
|
658
|
-
var
|
|
659
|
-
(
|
|
660
|
-
}, [
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
}, [
|
|
664
|
-
const
|
|
665
|
-
const
|
|
666
|
-
if (!
|
|
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]);
|
|
660
|
+
I(() => {
|
|
661
|
+
c && (p ? Re(c, p) : ve(c));
|
|
662
|
+
}, [c, p]);
|
|
663
|
+
const b = D(() => {
|
|
664
|
+
const R = f(n, s);
|
|
665
|
+
if (!R)
|
|
667
666
|
throw new Error(
|
|
668
667
|
`No model found for robot "${n}". Ensure the model is available or provide a custom getModel function.`
|
|
669
668
|
);
|
|
670
|
-
return
|
|
671
|
-
}, [n,
|
|
672
|
-
|
|
669
|
+
return R;
|
|
670
|
+
}, [n, s, f]), g = /* @__PURE__ */ r(
|
|
671
|
+
Ye,
|
|
673
672
|
{
|
|
674
673
|
rapidlyChangingMotionState: e,
|
|
675
674
|
dhParameters: t,
|
|
676
|
-
...
|
|
675
|
+
...d
|
|
677
676
|
}
|
|
678
677
|
);
|
|
679
|
-
return /* @__PURE__ */
|
|
680
|
-
|
|
678
|
+
return /* @__PURE__ */ w(
|
|
679
|
+
de,
|
|
681
680
|
{
|
|
682
|
-
fallback:
|
|
683
|
-
onError: (
|
|
684
|
-
console.warn(
|
|
681
|
+
fallback: g,
|
|
682
|
+
onError: (R) => {
|
|
683
|
+
console.warn(R);
|
|
685
684
|
},
|
|
686
685
|
children: [
|
|
687
|
-
/* @__PURE__ */ r(
|
|
686
|
+
/* @__PURE__ */ r(fe, { fallback: g, children: /* @__PURE__ */ r("group", { ref: h, children: /* @__PURE__ */ r(
|
|
688
687
|
be,
|
|
689
688
|
{
|
|
690
|
-
ref:
|
|
689
|
+
ref: m,
|
|
691
690
|
rapidlyChangingMotionState: e,
|
|
692
691
|
dhParameters: t,
|
|
692
|
+
chainOffsetPosition: a,
|
|
693
|
+
chainOffsetQuaternion: i,
|
|
693
694
|
children: /* @__PURE__ */ r(
|
|
694
|
-
|
|
695
|
+
we,
|
|
695
696
|
{
|
|
696
|
-
modelURL:
|
|
697
|
-
postModelRender:
|
|
698
|
-
flangeRef:
|
|
699
|
-
...
|
|
697
|
+
modelURL: b,
|
|
698
|
+
postModelRender: u,
|
|
699
|
+
flangeRef: l,
|
|
700
|
+
...d
|
|
700
701
|
}
|
|
701
702
|
)
|
|
702
703
|
}
|
|
703
704
|
) }) }),
|
|
704
|
-
/* @__PURE__ */ r(
|
|
705
|
+
/* @__PURE__ */ r(xe, {})
|
|
705
706
|
]
|
|
706
707
|
}
|
|
707
708
|
);
|
|
708
709
|
}
|
|
710
|
+
), ze = A(
|
|
711
|
+
({ rapidlyChangingMotionState: e, ...n }) => {
|
|
712
|
+
const t = Q(
|
|
713
|
+
e
|
|
714
|
+
);
|
|
715
|
+
return /* @__PURE__ */ r(
|
|
716
|
+
Me,
|
|
717
|
+
{
|
|
718
|
+
rapidlyChangingMotionState: t,
|
|
719
|
+
...n
|
|
720
|
+
}
|
|
721
|
+
);
|
|
722
|
+
}
|
|
709
723
|
);
|
|
710
724
|
function et({
|
|
711
725
|
connectedMotionGroup: e,
|
|
712
|
-
getModel: n =
|
|
726
|
+
getModel: n = W,
|
|
713
727
|
flangeRef: t,
|
|
714
|
-
transparentColor:
|
|
715
|
-
postModelRender:
|
|
728
|
+
transparentColor: a,
|
|
729
|
+
postModelRender: i,
|
|
716
730
|
...f
|
|
717
731
|
}) {
|
|
718
|
-
|
|
719
|
-
|
|
732
|
+
if (!e.dhParameters)
|
|
733
|
+
return null;
|
|
734
|
+
const l = e.mountingPosition, o = e.mountingQuaternion;
|
|
735
|
+
return /* @__PURE__ */ r(
|
|
736
|
+
ze,
|
|
720
737
|
{
|
|
721
738
|
rapidlyChangingMotionState: e.rapidlyChangingMotionState,
|
|
722
739
|
modelFromController: e.modelFromController || "",
|
|
723
740
|
dhParameters: e.dhParameters,
|
|
724
741
|
getModel: n,
|
|
725
742
|
flangeRef: t,
|
|
726
|
-
transparentColor:
|
|
727
|
-
postModelRender:
|
|
743
|
+
transparentColor: a,
|
|
744
|
+
postModelRender: i,
|
|
745
|
+
chainOffsetPosition: l,
|
|
746
|
+
chainOffsetQuaternion: o,
|
|
728
747
|
...f
|
|
729
748
|
}
|
|
730
|
-
)
|
|
749
|
+
);
|
|
731
750
|
}
|
|
732
|
-
const
|
|
733
|
-
|
|
751
|
+
const _t = A(
|
|
752
|
+
Ce(
|
|
734
753
|
({
|
|
735
754
|
robotName: e,
|
|
736
755
|
programState: n,
|
|
737
756
|
safetyState: t,
|
|
738
|
-
operationMode:
|
|
739
|
-
driveToHomeEnabled:
|
|
757
|
+
operationMode: a,
|
|
758
|
+
driveToHomeEnabled: i = !1,
|
|
740
759
|
onDriveToHomePress: f,
|
|
741
|
-
onDriveToHomeRelease:
|
|
760
|
+
onDriveToHomeRelease: l,
|
|
742
761
|
connectedMotionGroup: o,
|
|
743
|
-
robotComponent:
|
|
744
|
-
customContentComponent:
|
|
745
|
-
className:
|
|
762
|
+
robotComponent: p = et,
|
|
763
|
+
customContentComponent: s,
|
|
764
|
+
className: d
|
|
746
765
|
}) => {
|
|
747
|
-
var
|
|
748
|
-
const
|
|
749
|
-
|
|
750
|
-
const
|
|
751
|
-
if (
|
|
752
|
-
const { offsetWidth:
|
|
753
|
-
|
|
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);
|
|
768
|
+
I(() => {
|
|
769
|
+
const j = () => {
|
|
770
|
+
if (b.current) {
|
|
771
|
+
const { offsetWidth: z, offsetHeight: ee } = b.current;
|
|
772
|
+
R(z > ee), F({ width: z, height: ee });
|
|
754
773
|
}
|
|
755
774
|
};
|
|
756
|
-
|
|
757
|
-
const
|
|
758
|
-
return
|
|
759
|
-
|
|
775
|
+
j();
|
|
776
|
+
const Z = new ResizeObserver(j);
|
|
777
|
+
return b.current && Z.observe(b.current), () => {
|
|
778
|
+
Z.disconnect();
|
|
760
779
|
};
|
|
761
780
|
}, []);
|
|
762
|
-
const Y =
|
|
763
|
-
|
|
764
|
-
}, []),
|
|
765
|
-
!
|
|
766
|
-
}, [
|
|
767
|
-
!
|
|
768
|
-
}, [
|
|
769
|
-
|
|
770
|
-
}, [
|
|
781
|
+
const Y = L(() => {
|
|
782
|
+
$((j) => j + 1);
|
|
783
|
+
}, []), E = L(() => {
|
|
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;
|
|
771
790
|
return /* @__PURE__ */ r(
|
|
772
791
|
Ue,
|
|
773
792
|
{
|
|
774
|
-
ref:
|
|
775
|
-
className:
|
|
793
|
+
ref: b,
|
|
794
|
+
className: d,
|
|
776
795
|
sx: {
|
|
777
796
|
width: "100%",
|
|
778
797
|
height: "100%",
|
|
779
798
|
display: "flex",
|
|
780
|
-
flexDirection:
|
|
799
|
+
flexDirection: g ? "row" : "column",
|
|
781
800
|
position: "relative",
|
|
782
801
|
overflow: "hidden",
|
|
783
802
|
minWidth: { xs: 180, sm: 220, md: 250 },
|
|
784
|
-
minHeight:
|
|
803
|
+
minHeight: g ? { xs: 200, sm: 240, md: 260 } : { xs: 150, sm: 180, md: 220 },
|
|
785
804
|
// Allow progressive hiding in portrait mode
|
|
786
|
-
border: `1px solid ${
|
|
805
|
+
border: `1px solid ${c.palette.divider}`,
|
|
787
806
|
borderRadius: "18px",
|
|
788
807
|
boxShadow: "none",
|
|
789
|
-
backgroundColor: ((
|
|
808
|
+
backgroundColor: ((K = c.palette.backgroundPaperElevation) == null ? void 0 : K[8]) || "#292B3F",
|
|
790
809
|
backgroundImage: "none"
|
|
791
810
|
// Override any gradient from elevation
|
|
792
811
|
},
|
|
793
|
-
children:
|
|
812
|
+
children: g ? /* @__PURE__ */ w(V, { children: [
|
|
794
813
|
/* @__PURE__ */ r(
|
|
795
|
-
|
|
814
|
+
S,
|
|
796
815
|
{
|
|
797
816
|
sx: {
|
|
798
817
|
flex: "0 0 50%",
|
|
@@ -805,10 +824,10 @@ const Mt = C(
|
|
|
805
824
|
mr: { xs: 0.75, sm: 1, md: 1.5 },
|
|
806
825
|
overflow: "hidden",
|
|
807
826
|
// Prevent content from affecting container size
|
|
808
|
-
display:
|
|
827
|
+
display: T ? "none" : "block"
|
|
809
828
|
},
|
|
810
|
-
children: !
|
|
811
|
-
|
|
829
|
+
children: !T && /* @__PURE__ */ w(
|
|
830
|
+
ie,
|
|
812
831
|
{
|
|
813
832
|
orthographic: !0,
|
|
814
833
|
camera: {
|
|
@@ -818,7 +837,7 @@ const Mt = C(
|
|
|
818
837
|
shadows: !0,
|
|
819
838
|
frameloop: "demand",
|
|
820
839
|
style: {
|
|
821
|
-
borderRadius:
|
|
840
|
+
borderRadius: c.shape.borderRadius,
|
|
822
841
|
width: "100%",
|
|
823
842
|
height: "100%",
|
|
824
843
|
background: "transparent",
|
|
@@ -829,9 +848,9 @@ const Mt = C(
|
|
|
829
848
|
dpr: [1, 2],
|
|
830
849
|
gl: { alpha: !0, antialias: !0 },
|
|
831
850
|
children: [
|
|
832
|
-
/* @__PURE__ */ r(
|
|
833
|
-
/* @__PURE__ */ r(
|
|
834
|
-
|
|
851
|
+
/* @__PURE__ */ r(ae, {}),
|
|
852
|
+
/* @__PURE__ */ r(te, { fit: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ r(
|
|
853
|
+
p,
|
|
835
854
|
{
|
|
836
855
|
connectedMotionGroup: o,
|
|
837
856
|
postModelRender: Y
|
|
@@ -842,19 +861,19 @@ const Mt = C(
|
|
|
842
861
|
)
|
|
843
862
|
}
|
|
844
863
|
),
|
|
845
|
-
/* @__PURE__ */
|
|
846
|
-
|
|
864
|
+
/* @__PURE__ */ w(
|
|
865
|
+
S,
|
|
847
866
|
{
|
|
848
867
|
sx: {
|
|
849
868
|
flex: "1",
|
|
850
869
|
display: "flex",
|
|
851
870
|
flexDirection: "column",
|
|
852
871
|
justifyContent: "flex-start",
|
|
853
|
-
width:
|
|
872
|
+
width: T ? "100%" : "50%"
|
|
854
873
|
},
|
|
855
874
|
children: [
|
|
856
|
-
/* @__PURE__ */
|
|
857
|
-
|
|
875
|
+
/* @__PURE__ */ w(
|
|
876
|
+
S,
|
|
858
877
|
{
|
|
859
878
|
sx: {
|
|
860
879
|
p: { xs: 1.5, sm: 2, md: 3 },
|
|
@@ -862,20 +881,20 @@ const Mt = C(
|
|
|
862
881
|
textAlign: "left"
|
|
863
882
|
},
|
|
864
883
|
children: [
|
|
865
|
-
/* @__PURE__ */ r(
|
|
884
|
+
/* @__PURE__ */ r(oe, { variant: "h6", component: "h2", sx: { mb: 1 }, children: e }),
|
|
866
885
|
/* @__PURE__ */ r(
|
|
867
|
-
|
|
886
|
+
se,
|
|
868
887
|
{
|
|
869
888
|
programState: n,
|
|
870
889
|
safetyState: t,
|
|
871
|
-
operationMode:
|
|
890
|
+
operationMode: a
|
|
872
891
|
}
|
|
873
892
|
)
|
|
874
893
|
]
|
|
875
894
|
}
|
|
876
895
|
),
|
|
877
|
-
/* @__PURE__ */
|
|
878
|
-
|
|
896
|
+
/* @__PURE__ */ w(
|
|
897
|
+
S,
|
|
879
898
|
{
|
|
880
899
|
sx: {
|
|
881
900
|
p: { xs: 1.5, sm: 2, md: 3 },
|
|
@@ -886,28 +905,28 @@ const Mt = C(
|
|
|
886
905
|
justifyContent: "space-between"
|
|
887
906
|
},
|
|
888
907
|
children: [
|
|
889
|
-
!
|
|
890
|
-
/* @__PURE__ */ r(
|
|
908
|
+
!C && s && /* @__PURE__ */ w(S, { children: [
|
|
909
|
+
/* @__PURE__ */ r(s, {}),
|
|
891
910
|
/* @__PURE__ */ r(
|
|
892
|
-
|
|
911
|
+
re,
|
|
893
912
|
{
|
|
894
913
|
sx: {
|
|
895
914
|
mt: 1,
|
|
896
915
|
mb: 0,
|
|
897
|
-
borderColor:
|
|
916
|
+
borderColor: c.palette.divider,
|
|
898
917
|
opacity: 0.5
|
|
899
918
|
}
|
|
900
919
|
}
|
|
901
920
|
)
|
|
902
921
|
] }),
|
|
903
922
|
/* @__PURE__ */ r(
|
|
904
|
-
|
|
923
|
+
S,
|
|
905
924
|
{
|
|
906
925
|
sx: {
|
|
907
|
-
mt: !
|
|
926
|
+
mt: !C && s ? "auto" : 0
|
|
908
927
|
},
|
|
909
928
|
children: /* @__PURE__ */ r(
|
|
910
|
-
|
|
929
|
+
S,
|
|
911
930
|
{
|
|
912
931
|
sx: {
|
|
913
932
|
display: "flex",
|
|
@@ -916,24 +935,24 @@ const Mt = C(
|
|
|
916
935
|
mb: { xs: 0.5, sm: 0.75, md: 1 }
|
|
917
936
|
},
|
|
918
937
|
children: /* @__PURE__ */ r(
|
|
919
|
-
|
|
938
|
+
ne,
|
|
920
939
|
{
|
|
921
940
|
ref: u,
|
|
922
941
|
variant: "contained",
|
|
923
942
|
color: "secondary",
|
|
924
943
|
size: "small",
|
|
925
|
-
disabled: !
|
|
926
|
-
onMouseDown:
|
|
927
|
-
onMouseUp:
|
|
928
|
-
onMouseLeave:
|
|
929
|
-
onTouchStart:
|
|
930
|
-
onTouchEnd:
|
|
944
|
+
disabled: !i,
|
|
945
|
+
onMouseDown: E,
|
|
946
|
+
onMouseUp: U,
|
|
947
|
+
onMouseLeave: X,
|
|
948
|
+
onTouchStart: E,
|
|
949
|
+
onTouchEnd: U,
|
|
931
950
|
sx: {
|
|
932
951
|
textTransform: "none",
|
|
933
952
|
px: 1.5,
|
|
934
953
|
py: 0.5
|
|
935
954
|
},
|
|
936
|
-
children:
|
|
955
|
+
children: y("RobotCard.DriveToHome.bt")
|
|
937
956
|
}
|
|
938
957
|
)
|
|
939
958
|
}
|
|
@@ -946,8 +965,8 @@ const Mt = C(
|
|
|
946
965
|
]
|
|
947
966
|
}
|
|
948
967
|
)
|
|
949
|
-
] }) : /* @__PURE__ */ r(
|
|
950
|
-
|
|
968
|
+
] }) : /* @__PURE__ */ r(V, { children: /* @__PURE__ */ w(
|
|
969
|
+
S,
|
|
951
970
|
{
|
|
952
971
|
sx: {
|
|
953
972
|
p: 3,
|
|
@@ -956,31 +975,31 @@ const Mt = C(
|
|
|
956
975
|
flexDirection: "column"
|
|
957
976
|
},
|
|
958
977
|
children: [
|
|
959
|
-
/* @__PURE__ */
|
|
960
|
-
/* @__PURE__ */ r(
|
|
978
|
+
/* @__PURE__ */ w(S, { children: [
|
|
979
|
+
/* @__PURE__ */ r(oe, { variant: "h6", component: "h2", sx: { mb: 1 }, children: e }),
|
|
961
980
|
/* @__PURE__ */ r(
|
|
962
|
-
|
|
981
|
+
se,
|
|
963
982
|
{
|
|
964
983
|
programState: n,
|
|
965
984
|
safetyState: t,
|
|
966
|
-
operationMode:
|
|
985
|
+
operationMode: a
|
|
967
986
|
}
|
|
968
987
|
)
|
|
969
988
|
] }),
|
|
970
989
|
/* @__PURE__ */ r(
|
|
971
|
-
|
|
990
|
+
S,
|
|
972
991
|
{
|
|
973
992
|
sx: {
|
|
974
|
-
flex:
|
|
993
|
+
flex: T ? 0 : 1,
|
|
975
994
|
position: "relative",
|
|
976
|
-
minHeight:
|
|
977
|
-
height:
|
|
995
|
+
minHeight: T ? 0 : { xs: 120, sm: 150, md: 200 },
|
|
996
|
+
height: T ? 0 : "auto",
|
|
978
997
|
borderRadius: 1,
|
|
979
998
|
overflow: "hidden",
|
|
980
|
-
display:
|
|
999
|
+
display: T ? "none" : "block"
|
|
981
1000
|
},
|
|
982
|
-
children: !
|
|
983
|
-
|
|
1001
|
+
children: !T && /* @__PURE__ */ w(
|
|
1002
|
+
ie,
|
|
984
1003
|
{
|
|
985
1004
|
orthographic: !0,
|
|
986
1005
|
camera: {
|
|
@@ -990,7 +1009,7 @@ const Mt = C(
|
|
|
990
1009
|
shadows: !0,
|
|
991
1010
|
frameloop: "demand",
|
|
992
1011
|
style: {
|
|
993
|
-
borderRadius:
|
|
1012
|
+
borderRadius: c.shape.borderRadius,
|
|
994
1013
|
width: "100%",
|
|
995
1014
|
height: "100%",
|
|
996
1015
|
background: "transparent",
|
|
@@ -999,9 +1018,9 @@ const Mt = C(
|
|
|
999
1018
|
dpr: [1, 2],
|
|
1000
1019
|
gl: { alpha: !0, antialias: !0 },
|
|
1001
1020
|
children: [
|
|
1002
|
-
/* @__PURE__ */ r(
|
|
1003
|
-
/* @__PURE__ */ r(
|
|
1004
|
-
|
|
1021
|
+
/* @__PURE__ */ r(ae, {}),
|
|
1022
|
+
/* @__PURE__ */ r(te, { fit: !0, clip: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ r(
|
|
1023
|
+
p,
|
|
1005
1024
|
{
|
|
1006
1025
|
connectedMotionGroup: o,
|
|
1007
1026
|
postModelRender: Y
|
|
@@ -1012,49 +1031,49 @@ const Mt = C(
|
|
|
1012
1031
|
)
|
|
1013
1032
|
}
|
|
1014
1033
|
),
|
|
1015
|
-
/* @__PURE__ */
|
|
1016
|
-
!
|
|
1017
|
-
/* @__PURE__ */ r(
|
|
1034
|
+
/* @__PURE__ */ w(S, { children: [
|
|
1035
|
+
!C && s && /* @__PURE__ */ w(V, { children: [
|
|
1036
|
+
/* @__PURE__ */ r(s, {}),
|
|
1018
1037
|
/* @__PURE__ */ r(
|
|
1019
|
-
|
|
1038
|
+
re,
|
|
1020
1039
|
{
|
|
1021
1040
|
sx: {
|
|
1022
1041
|
mt: 1,
|
|
1023
1042
|
mb: 0,
|
|
1024
|
-
borderColor:
|
|
1043
|
+
borderColor: c.palette.divider,
|
|
1025
1044
|
opacity: 0.5
|
|
1026
1045
|
}
|
|
1027
1046
|
}
|
|
1028
1047
|
)
|
|
1029
1048
|
] }),
|
|
1030
1049
|
/* @__PURE__ */ r(
|
|
1031
|
-
|
|
1050
|
+
S,
|
|
1032
1051
|
{
|
|
1033
1052
|
sx: {
|
|
1034
1053
|
display: "flex",
|
|
1035
1054
|
justifyContent: "flex-start",
|
|
1036
|
-
mt: !
|
|
1055
|
+
mt: !C && s ? { xs: 1, sm: 2, md: 5 } : { xs: 0.5, sm: 1, md: 2 },
|
|
1037
1056
|
mb: { xs: 0.5, sm: 0.75, md: 1 }
|
|
1038
1057
|
},
|
|
1039
1058
|
children: /* @__PURE__ */ r(
|
|
1040
|
-
|
|
1059
|
+
ne,
|
|
1041
1060
|
{
|
|
1042
1061
|
ref: u,
|
|
1043
1062
|
variant: "contained",
|
|
1044
1063
|
color: "secondary",
|
|
1045
1064
|
size: "small",
|
|
1046
|
-
disabled: !
|
|
1047
|
-
onMouseDown:
|
|
1048
|
-
onMouseUp:
|
|
1049
|
-
onMouseLeave:
|
|
1050
|
-
onTouchStart:
|
|
1051
|
-
onTouchEnd:
|
|
1065
|
+
disabled: !i,
|
|
1066
|
+
onMouseDown: E,
|
|
1067
|
+
onMouseUp: U,
|
|
1068
|
+
onMouseLeave: X,
|
|
1069
|
+
onTouchStart: E,
|
|
1070
|
+
onTouchEnd: U,
|
|
1052
1071
|
sx: {
|
|
1053
1072
|
textTransform: "none",
|
|
1054
1073
|
px: 1.5,
|
|
1055
1074
|
py: 0.5
|
|
1056
1075
|
},
|
|
1057
|
-
children:
|
|
1076
|
+
children: y("RobotCard.DriveToHome.bt")
|
|
1058
1077
|
}
|
|
1059
1078
|
)
|
|
1060
1079
|
}
|
|
@@ -1067,138 +1086,126 @@ const Mt = C(
|
|
|
1067
1086
|
);
|
|
1068
1087
|
}
|
|
1069
1088
|
)
|
|
1070
|
-
),
|
|
1071
|
-
function
|
|
1089
|
+
), Tt = Array(6).fill(2 * Math.PI);
|
|
1090
|
+
function Se({
|
|
1072
1091
|
rapidlyChangingMotionState: e,
|
|
1073
1092
|
dhParameters: n,
|
|
1074
|
-
|
|
1075
|
-
|
|
1093
|
+
chainOffsetPosition: t,
|
|
1094
|
+
chainOffsetQuaternion: a,
|
|
1095
|
+
onTranslationChanged: i,
|
|
1096
|
+
children: f
|
|
1076
1097
|
}) {
|
|
1077
|
-
const
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
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
|
-
});
|
|
1098
|
-
function g(l) {
|
|
1099
|
-
l && (f.current = me(l), i(), o());
|
|
1098
|
+
const l = v([]), o = v(
|
|
1099
|
+
e.joint_position.filter(
|
|
1100
|
+
(m) => m !== void 0
|
|
1101
|
+
)
|
|
1102
|
+
), { invalidate: p } = he(), s = v(e);
|
|
1103
|
+
s.current = e;
|
|
1104
|
+
function d(m) {
|
|
1105
|
+
m && (l.current = me(m), c(), p());
|
|
1100
1106
|
}
|
|
1101
|
-
function
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
t(f.current, l);
|
|
1107
|
+
function c() {
|
|
1108
|
+
const m = o.current;
|
|
1109
|
+
if (i)
|
|
1110
|
+
i(l.current, m);
|
|
1106
1111
|
else
|
|
1107
|
-
for (const [
|
|
1108
|
-
const
|
|
1109
|
-
|
|
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;
|
|
1110
1115
|
}
|
|
1111
1116
|
}
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
(
|
|
1115
|
-
);
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1117
|
+
function y(m) {
|
|
1118
|
+
o.current = m.joint_position.filter(
|
|
1119
|
+
(h) => h !== void 0
|
|
1120
|
+
), c(), p();
|
|
1121
|
+
}
|
|
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
|
+
);
|
|
1126
1133
|
}
|
|
1127
|
-
function
|
|
1134
|
+
function _e({
|
|
1128
1135
|
rapidlyChangingMotionState: e,
|
|
1129
1136
|
dhParameters: n,
|
|
1130
1137
|
...t
|
|
1131
1138
|
}) {
|
|
1132
|
-
const
|
|
1133
|
-
function
|
|
1134
|
-
const
|
|
1135
|
-
for (let
|
|
1136
|
-
const u = n[
|
|
1137
|
-
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(
|
|
1138
1145
|
u.a / 1e3,
|
|
1139
|
-
(u.d +
|
|
1146
|
+
(u.d + b * (u.reverse_rotation_direction ? -1 : 1)) / 1e3,
|
|
1140
1147
|
0
|
|
1141
1148
|
)
|
|
1142
|
-
).multiply(new
|
|
1143
|
-
|
|
1149
|
+
).multiply(new M().makeRotationX(u.alpha));
|
|
1150
|
+
d.multiply(g);
|
|
1144
1151
|
}
|
|
1145
|
-
const
|
|
1146
|
-
return
|
|
1152
|
+
const c = new P(), y = new N(), m = new P();
|
|
1153
|
+
return d.decompose(c, y, m), c;
|
|
1147
1154
|
}
|
|
1148
|
-
const o =
|
|
1155
|
+
const o = l(
|
|
1149
1156
|
e.joint_position
|
|
1150
1157
|
);
|
|
1151
|
-
function
|
|
1152
|
-
|
|
1153
|
-
let
|
|
1158
|
+
function p(s, d) {
|
|
1159
|
+
a.identity();
|
|
1160
|
+
let c = new P();
|
|
1154
1161
|
for (let u = 0; u < n.length; u++) {
|
|
1155
|
-
const
|
|
1156
|
-
new
|
|
1157
|
-
|
|
1158
|
-
(
|
|
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,
|
|
1159
1166
|
0
|
|
1160
1167
|
)
|
|
1161
|
-
).multiply(new
|
|
1162
|
-
|
|
1168
|
+
).multiply(new M().makeRotationX(g.alpha));
|
|
1169
|
+
a.multiply(R);
|
|
1163
1170
|
}
|
|
1164
|
-
const
|
|
1165
|
-
if (
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
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
|
|
1169
1176
|
), f.current) {
|
|
1170
1177
|
const u = f.current.geometry;
|
|
1171
1178
|
u != null && u.setPositions && u.setPositions([
|
|
1172
1179
|
0,
|
|
1173
1180
|
0,
|
|
1174
1181
|
0,
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1182
|
+
c.x,
|
|
1183
|
+
c.y,
|
|
1184
|
+
c.z
|
|
1178
1185
|
]);
|
|
1179
1186
|
}
|
|
1180
1187
|
}
|
|
1181
1188
|
return /* @__PURE__ */ r(
|
|
1182
|
-
|
|
1189
|
+
Se,
|
|
1183
1190
|
{
|
|
1184
1191
|
rapidlyChangingMotionState: e,
|
|
1185
1192
|
dhParameters: n,
|
|
1186
|
-
onTranslationChanged:
|
|
1187
|
-
children: /* @__PURE__ */
|
|
1188
|
-
/* @__PURE__ */
|
|
1193
|
+
onTranslationChanged: p,
|
|
1194
|
+
children: /* @__PURE__ */ w("group", { ...t, name: "Scene", children: [
|
|
1195
|
+
/* @__PURE__ */ w("mesh", { name: "Base", position: [0, 0, 0], children: [
|
|
1189
1196
|
/* @__PURE__ */ r("sphereGeometry", { args: [0.02, 32, 32] }),
|
|
1190
1197
|
/* @__PURE__ */ r("meshStandardMaterial", { color: "green", depthTest: !0 })
|
|
1191
1198
|
] }),
|
|
1192
1199
|
/* @__PURE__ */ r(
|
|
1193
|
-
|
|
1200
|
+
H,
|
|
1194
1201
|
{
|
|
1195
1202
|
ref: f,
|
|
1196
|
-
points: [new
|
|
1203
|
+
points: [new P(0, 0, 0), o],
|
|
1197
1204
|
color: "White",
|
|
1198
1205
|
lineWidth: 5
|
|
1199
1206
|
}
|
|
1200
1207
|
),
|
|
1201
|
-
/* @__PURE__ */
|
|
1208
|
+
/* @__PURE__ */ w("mesh", { ref: i, name: "TCP", position: o, children: [
|
|
1202
1209
|
/* @__PURE__ */ r("sphereGeometry", { args: [0.025, 32, 32] }),
|
|
1203
1210
|
/* @__PURE__ */ r("meshStandardMaterial", { color: "red", depthTest: !0 })
|
|
1204
1211
|
] })
|
|
@@ -1206,106 +1213,127 @@ function Te({
|
|
|
1206
1213
|
}
|
|
1207
1214
|
);
|
|
1208
1215
|
}
|
|
1209
|
-
const
|
|
1216
|
+
const Te = A(
|
|
1210
1217
|
({
|
|
1211
1218
|
rapidlyChangingMotionState: e,
|
|
1212
1219
|
modelFromController: n,
|
|
1213
1220
|
dhParameters: t,
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1221
|
+
chainOffsetPosition: a,
|
|
1222
|
+
chainOffsetQuaternion: i,
|
|
1223
|
+
getModel: f = W,
|
|
1224
|
+
flangeRef: l,
|
|
1225
|
+
postModelRender: o,
|
|
1226
|
+
transparentColor: p,
|
|
1227
|
+
instanceUrl: s,
|
|
1228
|
+
...d
|
|
1220
1229
|
}) => {
|
|
1221
|
-
const [
|
|
1222
|
-
|
|
1230
|
+
const [c, y] = k(null), m = L((u) => {
|
|
1231
|
+
y(u);
|
|
1223
1232
|
}, []);
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
}, [
|
|
1227
|
-
const
|
|
1228
|
-
|
|
1233
|
+
I(() => {
|
|
1234
|
+
c && (p ? Re(c, p) : ve(c));
|
|
1235
|
+
}, [c, p]);
|
|
1236
|
+
const h = /* @__PURE__ */ r(
|
|
1237
|
+
_e,
|
|
1229
1238
|
{
|
|
1230
1239
|
rapidlyChangingMotionState: e,
|
|
1231
1240
|
dhParameters: t,
|
|
1232
|
-
...
|
|
1241
|
+
...d
|
|
1233
1242
|
}
|
|
1234
1243
|
);
|
|
1235
|
-
return /* @__PURE__ */
|
|
1236
|
-
|
|
1244
|
+
return /* @__PURE__ */ w(
|
|
1245
|
+
de,
|
|
1237
1246
|
{
|
|
1238
|
-
fallback:
|
|
1239
|
-
onError: (
|
|
1240
|
-
console.warn(
|
|
1247
|
+
fallback: h,
|
|
1248
|
+
onError: (u) => {
|
|
1249
|
+
console.warn(u);
|
|
1241
1250
|
},
|
|
1242
1251
|
children: [
|
|
1243
|
-
/* @__PURE__ */ r(
|
|
1244
|
-
|
|
1252
|
+
/* @__PURE__ */ r(fe, { fallback: h, children: /* @__PURE__ */ r("group", { ref: m, children: /* @__PURE__ */ r(
|
|
1253
|
+
Se,
|
|
1245
1254
|
{
|
|
1246
1255
|
rapidlyChangingMotionState: e,
|
|
1247
1256
|
dhParameters: t,
|
|
1257
|
+
chainOffsetPosition: a,
|
|
1258
|
+
chainOffsetQuaternion: i,
|
|
1248
1259
|
children: /* @__PURE__ */ r(
|
|
1249
|
-
|
|
1260
|
+
we,
|
|
1250
1261
|
{
|
|
1251
1262
|
modelURL: (() => {
|
|
1252
|
-
const
|
|
1253
|
-
if (!
|
|
1254
|
-
const
|
|
1255
|
-
[
|
|
1263
|
+
const u = f(n, s);
|
|
1264
|
+
if (!u) {
|
|
1265
|
+
const b = new Blob([], { type: "model/gltf-binary" }), g = new File(
|
|
1266
|
+
[b],
|
|
1256
1267
|
`${n}.glb`,
|
|
1257
1268
|
{ type: "model/gltf-binary" }
|
|
1258
1269
|
);
|
|
1259
|
-
return Promise.resolve(URL.createObjectURL(
|
|
1270
|
+
return Promise.resolve(URL.createObjectURL(g));
|
|
1260
1271
|
}
|
|
1261
|
-
return
|
|
1272
|
+
return u;
|
|
1262
1273
|
})(),
|
|
1263
|
-
postModelRender:
|
|
1264
|
-
flangeRef:
|
|
1265
|
-
...
|
|
1274
|
+
postModelRender: o,
|
|
1275
|
+
flangeRef: l,
|
|
1276
|
+
...d
|
|
1266
1277
|
}
|
|
1267
1278
|
)
|
|
1268
1279
|
}
|
|
1269
1280
|
) }) }),
|
|
1270
|
-
/* @__PURE__ */ r(
|
|
1281
|
+
/* @__PURE__ */ r(xe, {})
|
|
1271
1282
|
]
|
|
1272
1283
|
}
|
|
1273
1284
|
);
|
|
1274
1285
|
}
|
|
1286
|
+
), tt = A(
|
|
1287
|
+
({ rapidlyChangingMotionState: e, ...n }) => {
|
|
1288
|
+
const t = Q(
|
|
1289
|
+
e
|
|
1290
|
+
);
|
|
1291
|
+
return /* @__PURE__ */ r(
|
|
1292
|
+
Te,
|
|
1293
|
+
{
|
|
1294
|
+
rapidlyChangingMotionState: t,
|
|
1295
|
+
...n
|
|
1296
|
+
}
|
|
1297
|
+
);
|
|
1298
|
+
}
|
|
1275
1299
|
);
|
|
1276
|
-
function
|
|
1300
|
+
function Pt({
|
|
1277
1301
|
connectedMotionGroup: e,
|
|
1278
|
-
getModel: n =
|
|
1302
|
+
getModel: n = W,
|
|
1279
1303
|
flangeRef: t,
|
|
1280
|
-
transparentColor:
|
|
1281
|
-
postModelRender:
|
|
1304
|
+
transparentColor: a,
|
|
1305
|
+
postModelRender: i,
|
|
1282
1306
|
...f
|
|
1283
1307
|
}) {
|
|
1284
1308
|
if (!e.dhParameters)
|
|
1285
1309
|
return null;
|
|
1286
|
-
const
|
|
1287
|
-
return
|
|
1288
|
-
|
|
1310
|
+
const l = e.mountingPosition, o = e.mountingQuaternion, p = e.modelFromController || "";
|
|
1311
|
+
return p && n(p) ? /* @__PURE__ */ r(
|
|
1312
|
+
tt,
|
|
1289
1313
|
{
|
|
1290
1314
|
rapidlyChangingMotionState: e.rapidlyChangingMotionState,
|
|
1291
|
-
modelFromController:
|
|
1315
|
+
modelFromController: p,
|
|
1292
1316
|
dhParameters: e.dhParameters,
|
|
1293
1317
|
getModel: n,
|
|
1294
1318
|
flangeRef: t,
|
|
1295
|
-
transparentColor:
|
|
1296
|
-
postModelRender:
|
|
1319
|
+
transparentColor: a,
|
|
1320
|
+
postModelRender: i,
|
|
1321
|
+
chainOffsetPosition: l,
|
|
1322
|
+
chainOffsetQuaternion: o,
|
|
1297
1323
|
...f
|
|
1298
1324
|
}
|
|
1299
1325
|
) : /* @__PURE__ */ r(
|
|
1300
|
-
|
|
1326
|
+
_e,
|
|
1301
1327
|
{
|
|
1302
1328
|
rapidlyChangingMotionState: e.rapidlyChangingMotionState,
|
|
1303
1329
|
dhParameters: e.dhParameters,
|
|
1330
|
+
chainOffsetPosition: l,
|
|
1331
|
+
chainOffsetQuaternion: o,
|
|
1304
1332
|
...f
|
|
1305
1333
|
}
|
|
1306
1334
|
);
|
|
1307
1335
|
}
|
|
1308
|
-
const
|
|
1336
|
+
const le = {
|
|
1309
1337
|
[_.Abb]: [0, 0, 0, 0, Math.PI / 2, 0, 0],
|
|
1310
1338
|
[_.Fanuc]: [0, 0, 0, 0, -Math.PI / 2, 0, 0],
|
|
1311
1339
|
[_.Yaskawa]: [0, 0, 0, 0, -Math.PI / 2, 0, 0],
|
|
@@ -1329,7 +1357,7 @@ const ae = {
|
|
|
1329
1357
|
],
|
|
1330
1358
|
[_.Staubli]: [0, -Math.PI / 2, Math.PI / 2, 0, 0, 0, 0]
|
|
1331
1359
|
};
|
|
1332
|
-
function
|
|
1360
|
+
function nt(e) {
|
|
1333
1361
|
const [n] = e.split("_");
|
|
1334
1362
|
switch (n) {
|
|
1335
1363
|
case "ABB":
|
|
@@ -1348,34 +1376,48 @@ function tt(e) {
|
|
|
1348
1376
|
return null;
|
|
1349
1377
|
}
|
|
1350
1378
|
}
|
|
1351
|
-
function
|
|
1352
|
-
const t =
|
|
1353
|
-
return t && t in
|
|
1379
|
+
function kt(e, n) {
|
|
1380
|
+
const t = nt(e);
|
|
1381
|
+
return t && t in le ? le[t] : n || null;
|
|
1354
1382
|
}
|
|
1355
|
-
const
|
|
1356
|
-
const { inverseSolver: n, dhParameters: t, ...
|
|
1357
|
-
|
|
1383
|
+
const rt = A((e) => {
|
|
1384
|
+
const { inverseSolver: n, dhParameters: t, ...a } = e, [i, f] = k(
|
|
1385
|
+
B.RevoluteJoint
|
|
1358
1386
|
);
|
|
1359
|
-
|
|
1360
|
-
t.length && f(t[0].type ??
|
|
1387
|
+
I(() => {
|
|
1388
|
+
t.length && f(t[0].type ?? B.RevoluteJoint);
|
|
1361
1389
|
}, [t]);
|
|
1362
|
-
const
|
|
1363
|
-
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;
|
|
1392
|
+
}), Lt = A((e) => {
|
|
1393
|
+
const n = Q(
|
|
1394
|
+
e.rapidlyChangingMotionState
|
|
1395
|
+
);
|
|
1396
|
+
return /* @__PURE__ */ r(
|
|
1397
|
+
rt,
|
|
1398
|
+
{
|
|
1399
|
+
...e,
|
|
1400
|
+
rapidlyChangingMotionState: n
|
|
1401
|
+
}
|
|
1402
|
+
);
|
|
1364
1403
|
});
|
|
1365
1404
|
export {
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1405
|
+
vt as C,
|
|
1406
|
+
Pt as L,
|
|
1407
|
+
le as M,
|
|
1408
|
+
ae as P,
|
|
1409
|
+
et as R,
|
|
1410
|
+
Mt as S,
|
|
1411
|
+
St as T,
|
|
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,
|
|
1421
|
+
nt as j,
|
|
1422
|
+
kt as k
|
|
1381
1423
|
};
|