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