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