@wandelbots/wandelbots-js-react-components 4.5.0 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/3d.cjs.js +1 -1
- package/dist/3d.es.js +1 -1
- package/dist/{MotionGroupVisualizer-Ce9kTMPy.js → MotionGroupVisualizer-BlWkdkaM.js} +458 -409
- package/dist/MotionGroupVisualizer-BlWkdkaM.js.map +1 -0
- package/dist/MotionGroupVisualizer-Bw-h3U_t.cjs +2 -0
- package/dist/MotionGroupVisualizer-Bw-h3U_t.cjs.map +1 -0
- package/dist/components/3d-viewport/SafetyZonesRenderer.d.ts +3 -2
- package/dist/components/3d-viewport/SafetyZonesRenderer.d.ts.map +1 -1
- package/dist/core.cjs.js +1 -1
- package/dist/core.es.js +2 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +3 -3
- package/dist/{interpolation-Chyc6Hfo.js → interpolation-BxZtUOAs.js} +273 -273
- package/dist/interpolation-BxZtUOAs.js.map +1 -0
- package/dist/{interpolation-CiEw5jkz.cjs → interpolation-D4zTPZou.cjs} +4 -4
- package/dist/interpolation-D4zTPZou.cjs.map +1 -0
- package/dist/{theming-CZbXnFej.js → theming-3PEA0ksG.js} +2 -2
- package/dist/{theming-CZbXnFej.js.map → theming-3PEA0ksG.js.map} +1 -1
- package/dist/{theming-b98f6nXs.cjs → theming-U3LOZpcT.cjs} +2 -2
- package/dist/{theming-b98f6nXs.cjs.map → theming-U3LOZpcT.cjs.map} +1 -1
- package/package.json +1 -1
- package/src/components/3d-viewport/SafetyZonesRenderer.tsx +83 -11
- package/dist/MotionGroupVisualizer-COKQraKa.cjs +0 -2
- package/dist/MotionGroupVisualizer-COKQraKa.cjs.map +0 -1
- package/dist/MotionGroupVisualizer-Ce9kTMPy.js.map +0 -1
- package/dist/interpolation-Chyc6Hfo.js.map +0 -1
- package/dist/interpolation-CiEw5jkz.cjs.map +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { j as t, e as
|
|
1
|
+
import { j as t, e as O } from "./externalizeComponent-Dc3fViZA.js";
|
|
2
2
|
import * as x from "three";
|
|
3
|
-
import { Matrix4 as w, Vector3 as
|
|
3
|
+
import { Matrix4 as w, Vector3 as V, Quaternion as J } from "three";
|
|
4
4
|
import { ConvexGeometry as re } from "three-stdlib";
|
|
5
|
-
import
|
|
6
|
-
import { useThree as se, useFrame as ie, Canvas as
|
|
7
|
-
import { Environment as _e, Lightformer as
|
|
8
|
-
import { useTheme as
|
|
9
|
-
import { observer as
|
|
10
|
-
import { useTranslation as
|
|
11
|
-
import { N as
|
|
5
|
+
import ve, { useEffect as M, useMemo as F, useRef as R, useCallback as T, useState as S, Suspense as oe } from "react";
|
|
6
|
+
import { useThree as se, useFrame as ie, Canvas as Y } from "@react-three/fiber";
|
|
7
|
+
import { Environment as _e, Lightformer as A, Line as z, useGLTF as Te, Bounds as X } from "@react-three/drei";
|
|
8
|
+
import { useTheme as Ve, Card as Se, Box as b, Typography as K, Divider as Q, Button as Z } from "@mui/material";
|
|
9
|
+
import { observer as Ae } from "mobx-react-lite";
|
|
10
|
+
import { useTranslation as Fe } from "react-i18next";
|
|
11
|
+
import { N as Le, V as ae, c as le, b as ee, M as v, J as D } from "./interpolation-BxZtUOAs.js";
|
|
12
12
|
import { ErrorBoundary as ce } from "react-error-boundary";
|
|
13
|
-
function
|
|
13
|
+
function Ge(e) {
|
|
14
14
|
switch (e.shape_type) {
|
|
15
15
|
case "convex_hull":
|
|
16
16
|
return new re(
|
|
@@ -47,13 +47,13 @@ function ke(e) {
|
|
|
47
47
|
return console.warn(`${e.shape_type} is not supported`), new x.BufferGeometry();
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function Pe({
|
|
51
51
|
name: e,
|
|
52
52
|
collider: r,
|
|
53
53
|
children: n
|
|
54
54
|
}) {
|
|
55
|
-
var
|
|
56
|
-
const l = ((
|
|
55
|
+
var d, u;
|
|
56
|
+
const l = ((d = r.pose) == null ? void 0 : d.position) ?? [0, 0, 0], i = ((u = r.pose) == null ? void 0 : u.orientation) ?? [0, 0, 0];
|
|
57
57
|
return r.margin && console.warn(`${e} margin is not supported`), /* @__PURE__ */ t.jsx(
|
|
58
58
|
"mesh",
|
|
59
59
|
{
|
|
@@ -63,26 +63,26 @@ function Fe({
|
|
|
63
63
|
l[1],
|
|
64
64
|
l[2]
|
|
65
65
|
).divideScalar(1e3),
|
|
66
|
-
rotation: new x.Euler(
|
|
67
|
-
geometry:
|
|
66
|
+
rotation: new x.Euler(i[0], i[1], i[2], "XYZ"),
|
|
67
|
+
geometry: Ge(r.shape),
|
|
68
68
|
children: n
|
|
69
69
|
}
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function ke({
|
|
73
73
|
name: e,
|
|
74
74
|
colliders: r,
|
|
75
75
|
meshChildrenProvider: n,
|
|
76
76
|
...l
|
|
77
77
|
}) {
|
|
78
|
-
return /* @__PURE__ */ t.jsx("group", { name: e, ...l, children: Object.entries(r).map(([
|
|
79
|
-
|
|
78
|
+
return /* @__PURE__ */ t.jsx("group", { name: e, ...l, children: Object.entries(r).map(([i, d]) => /* @__PURE__ */ t.jsx(
|
|
79
|
+
Pe,
|
|
80
80
|
{
|
|
81
|
-
name:
|
|
82
|
-
collider:
|
|
83
|
-
children: n(
|
|
81
|
+
name: i,
|
|
82
|
+
collider: d,
|
|
83
|
+
children: n(i, d)
|
|
84
84
|
},
|
|
85
|
-
|
|
85
|
+
i
|
|
86
86
|
)) });
|
|
87
87
|
}
|
|
88
88
|
function ot({
|
|
@@ -91,7 +91,7 @@ function ot({
|
|
|
91
91
|
}) {
|
|
92
92
|
const n = e.colliders;
|
|
93
93
|
return /* @__PURE__ */ t.jsx("group", { children: n && /* @__PURE__ */ t.jsx(
|
|
94
|
-
|
|
94
|
+
ke,
|
|
95
95
|
{
|
|
96
96
|
meshChildrenProvider: r,
|
|
97
97
|
colliders: n
|
|
@@ -104,7 +104,7 @@ function te() {
|
|
|
104
104
|
function Ie({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
|
|
105
105
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
106
106
|
/* @__PURE__ */ t.jsx(
|
|
107
|
-
|
|
107
|
+
A,
|
|
108
108
|
{
|
|
109
109
|
intensity: 5,
|
|
110
110
|
"rotation-x": Math.PI / 2,
|
|
@@ -113,7 +113,7 @@ function Ie({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
|
|
|
113
113
|
}
|
|
114
114
|
),
|
|
115
115
|
/* @__PURE__ */ t.jsx("group", { rotation: [0, 0.5, 0], children: /* @__PURE__ */ t.jsx("group", { children: e.map((r, n) => /* @__PURE__ */ t.jsx(
|
|
116
|
-
|
|
116
|
+
A,
|
|
117
117
|
{
|
|
118
118
|
form: "circle",
|
|
119
119
|
intensity: 5,
|
|
@@ -124,7 +124,7 @@ function Ie({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
|
|
|
124
124
|
n
|
|
125
125
|
)) }) }),
|
|
126
126
|
/* @__PURE__ */ t.jsx(
|
|
127
|
-
|
|
127
|
+
A,
|
|
128
128
|
{
|
|
129
129
|
intensity: 40,
|
|
130
130
|
"rotation-y": Math.PI / 2,
|
|
@@ -133,7 +133,7 @@ function Ie({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
|
|
|
133
133
|
}
|
|
134
134
|
),
|
|
135
135
|
/* @__PURE__ */ t.jsx(
|
|
136
|
-
|
|
136
|
+
A,
|
|
137
137
|
{
|
|
138
138
|
intensity: 20,
|
|
139
139
|
"rotation-y": -Math.PI,
|
|
@@ -142,7 +142,7 @@ function Ie({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
|
|
|
142
142
|
}
|
|
143
143
|
),
|
|
144
144
|
/* @__PURE__ */ t.jsx(
|
|
145
|
-
|
|
145
|
+
A,
|
|
146
146
|
{
|
|
147
147
|
"rotation-y": Math.PI / 2,
|
|
148
148
|
position: [-5, -1, -1],
|
|
@@ -151,7 +151,7 @@ function Ie({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
|
|
|
151
151
|
}
|
|
152
152
|
),
|
|
153
153
|
/* @__PURE__ */ t.jsx(
|
|
154
|
-
|
|
154
|
+
A,
|
|
155
155
|
{
|
|
156
156
|
"rotation-y": -Math.PI / 2,
|
|
157
157
|
position: [10, 1, 0],
|
|
@@ -160,7 +160,7 @@ function Ie({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
|
|
|
160
160
|
}
|
|
161
161
|
),
|
|
162
162
|
/* @__PURE__ */ t.jsx(
|
|
163
|
-
|
|
163
|
+
A,
|
|
164
164
|
{
|
|
165
165
|
form: "ring",
|
|
166
166
|
color: "white",
|
|
@@ -172,40 +172,41 @@ function Ie({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
|
|
|
172
172
|
)
|
|
173
173
|
] });
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function De(e) {
|
|
176
176
|
if (e.length < 3)
|
|
177
177
|
return console.log("Not enough vertices to define a plane"), { isCoplanar: !1 };
|
|
178
|
-
const r = new x.Vector3(e[0].x, e[0].y, e[0].z), n = new x.Vector3(e[1].x, e[1].y, e[1].z), l = new x.Vector3(e[2].x, e[2].y, e[2].z),
|
|
179
|
-
for (let
|
|
180
|
-
const
|
|
181
|
-
if (Math.abs(
|
|
178
|
+
const r = new x.Vector3(e[0].x, e[0].y, e[0].z), n = new x.Vector3(e[1].x, e[1].y, e[1].z), l = new x.Vector3(e[2].x, e[2].y, e[2].z), i = new x.Vector3().subVectors(n, r), d = new x.Vector3().subVectors(l, r), u = new x.Vector3().crossVectors(i, d).normalize();
|
|
179
|
+
for (let m = 3; m < e.length; m++) {
|
|
180
|
+
const f = new x.Vector3(e[m].x, e[m].y, e[m].z), s = new x.Vector3().subVectors(f, r), p = u.dot(s);
|
|
181
|
+
if (Math.abs(p) > 1e-6)
|
|
182
182
|
return console.log("Vertices are not on the same plane"), { isCoplanar: !1 };
|
|
183
183
|
}
|
|
184
|
-
return { isCoplanar: !0, normal:
|
|
184
|
+
return { isCoplanar: !0, normal: u };
|
|
185
185
|
}
|
|
186
186
|
function st({
|
|
187
187
|
safetyZones: e,
|
|
188
|
-
|
|
188
|
+
dhParameters: r,
|
|
189
|
+
...n
|
|
189
190
|
}) {
|
|
190
|
-
|
|
191
|
+
M(() => {
|
|
191
192
|
Array.isArray(e) && console.warn("SafetyZonesRenderer: The support of V1 safety zones is deprecated. Please migrate to V2 safety zones.");
|
|
192
193
|
}, [e]);
|
|
193
|
-
const
|
|
194
|
-
const
|
|
195
|
-
if (
|
|
196
|
-
const
|
|
194
|
+
const l = (s, p) => {
|
|
195
|
+
const o = De(s);
|
|
196
|
+
if (o.isCoplanar && o.normal) {
|
|
197
|
+
const y = new x.Vector3().addVectors(
|
|
197
198
|
s[0],
|
|
198
|
-
|
|
199
|
+
o.normal.multiplyScalar(1e-4)
|
|
199
200
|
);
|
|
200
|
-
s.push(
|
|
201
|
+
s.push(y);
|
|
201
202
|
}
|
|
202
|
-
let
|
|
203
|
+
let a;
|
|
203
204
|
try {
|
|
204
|
-
|
|
205
|
-
} catch (
|
|
206
|
-
return console.log("Error creating ConvexGeometry:",
|
|
205
|
+
a = new re(s);
|
|
206
|
+
} catch (c) {
|
|
207
|
+
return console.log("Error creating ConvexGeometry:", c), null;
|
|
207
208
|
}
|
|
208
|
-
return /* @__PURE__ */ t.jsx("mesh", { geometry:
|
|
209
|
+
return /* @__PURE__ */ t.jsx("mesh", { geometry: a, children: /* @__PURE__ */ t.jsx(
|
|
209
210
|
"meshStandardMaterial",
|
|
210
211
|
{
|
|
211
212
|
attach: "material",
|
|
@@ -215,39 +216,87 @@ function st({
|
|
|
215
216
|
depthWrite: !1,
|
|
216
217
|
transparent: !0,
|
|
217
218
|
polygonOffset: !0,
|
|
218
|
-
polygonOffsetFactor: -
|
|
219
|
+
polygonOffsetFactor: -p
|
|
220
|
+
},
|
|
221
|
+
`safety-zone-material-${p}`
|
|
222
|
+
) }, `safety-zone-mesh-${p}`);
|
|
223
|
+
}, i = F(() => {
|
|
224
|
+
if (!r || r.length === 0)
|
|
225
|
+
return 5;
|
|
226
|
+
const o = r.reduce((a, c) => a + Math.abs(c.a ?? 0) / 1e3 + Math.abs(c.d ?? 0) / 1e3, 0) * 2;
|
|
227
|
+
return !Number.isFinite(o) || o <= 0 ? 5 : o;
|
|
228
|
+
}, [r]), d = (s, p, o) => {
|
|
229
|
+
const a = p.length(), c = new x.Quaternion();
|
|
230
|
+
if (a > 1e-6) {
|
|
231
|
+
const y = p.clone().normalize();
|
|
232
|
+
c.setFromAxisAngle(y, a);
|
|
233
|
+
}
|
|
234
|
+
return /* @__PURE__ */ t.jsxs(
|
|
235
|
+
"mesh",
|
|
236
|
+
{
|
|
237
|
+
renderOrder: o,
|
|
238
|
+
position: s,
|
|
239
|
+
quaternion: c,
|
|
240
|
+
children: [
|
|
241
|
+
/* @__PURE__ */ t.jsx("planeGeometry", { args: [i, i] }),
|
|
242
|
+
/* @__PURE__ */ t.jsx(
|
|
243
|
+
"meshStandardMaterial",
|
|
244
|
+
{
|
|
245
|
+
attach: "material",
|
|
246
|
+
color: "#009f4d",
|
|
247
|
+
opacity: 0.2,
|
|
248
|
+
depthTest: !1,
|
|
249
|
+
depthWrite: !1,
|
|
250
|
+
transparent: !0,
|
|
251
|
+
side: x.DoubleSide,
|
|
252
|
+
polygonOffset: !0,
|
|
253
|
+
polygonOffsetFactor: -o
|
|
254
|
+
},
|
|
255
|
+
`safety-zone-plane-material-${o}`
|
|
256
|
+
)
|
|
257
|
+
]
|
|
219
258
|
},
|
|
220
|
-
`safety-zone-
|
|
221
|
-
)
|
|
222
|
-
},
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
259
|
+
`safety-zone-plane-${o}`
|
|
260
|
+
);
|
|
261
|
+
}, u = () => Object.values(e ?? {}).map((s, p) => {
|
|
262
|
+
var o, a;
|
|
263
|
+
switch (s.shape.shape_type) {
|
|
264
|
+
case "convex_hull":
|
|
265
|
+
return l(
|
|
266
|
+
s.shape.vertices.map((c) => new x.Vector3(c[0] / 1e3, c[1] / 1e3, c[2] / 1e3)),
|
|
267
|
+
p
|
|
268
|
+
);
|
|
269
|
+
case "plane":
|
|
270
|
+
return ((o = s == null ? void 0 : s.pose) == null ? void 0 : o.position) && ((a = s == null ? void 0 : s.pose) == null ? void 0 : a.orientation) && d(
|
|
271
|
+
new x.Vector3(s.pose.position[0] / 1e3, s.pose.position[1] / 1e3, s.pose.position[2] / 1e3),
|
|
272
|
+
new x.Vector3(s.pose.orientation[0], s.pose.orientation[1], s.pose.orientation[2]),
|
|
273
|
+
p
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
}), m = () => Array.isArray(e) ? e.map((s, p) => {
|
|
277
|
+
let o = [];
|
|
278
|
+
return s.geometry && (s.geometry.compound ? o = s.geometry.compound.child_geometries : s.geometry.convex_hull && (o = [s.geometry])), o.map((a, c) => {
|
|
279
|
+
if (!a.convex_hull) return null;
|
|
280
|
+
const y = a.convex_hull.vertices.map(
|
|
281
|
+
(h) => new x.Vector3(h.x / 1e3, h.y / 1e3, h.z / 1e3)
|
|
233
282
|
);
|
|
234
|
-
return
|
|
283
|
+
return l(y, p * 1e3 + c);
|
|
235
284
|
});
|
|
236
|
-
}) : null, f =
|
|
237
|
-
return /* @__PURE__ */ t.jsx("group", { ...
|
|
285
|
+
}) : null, f = F(() => Array.isArray(e) ? m() : u(), [e, m, u]);
|
|
286
|
+
return /* @__PURE__ */ t.jsx("group", { ...n, children: f });
|
|
238
287
|
}
|
|
239
288
|
function it({
|
|
240
289
|
trajectory: e,
|
|
241
290
|
...r
|
|
242
291
|
}) {
|
|
243
292
|
var l;
|
|
244
|
-
const n = ((l = e.trajectory) == null ? void 0 : l.map((
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
-
|
|
248
|
-
) : null).filter((
|
|
293
|
+
const n = ((l = e.trajectory) == null ? void 0 : l.map((i) => i.tcp_pose ? new x.Vector3(
|
|
294
|
+
i.tcp_pose.position.x / 1e3,
|
|
295
|
+
i.tcp_pose.position.z / 1e3,
|
|
296
|
+
-i.tcp_pose.position.y / 1e3
|
|
297
|
+
) : null).filter((i) => i !== null)) || [];
|
|
249
298
|
return /* @__PURE__ */ t.jsx("group", { ...r, children: n.length > 0 && /* @__PURE__ */ t.jsx(
|
|
250
|
-
|
|
299
|
+
z,
|
|
251
300
|
{
|
|
252
301
|
points: n,
|
|
253
302
|
lineWidth: 3,
|
|
@@ -257,25 +306,25 @@ function it({
|
|
|
257
306
|
}
|
|
258
307
|
) });
|
|
259
308
|
}
|
|
260
|
-
const
|
|
261
|
-
async function
|
|
262
|
-
if (
|
|
263
|
-
return
|
|
309
|
+
const E = /* @__PURE__ */ new Map();
|
|
310
|
+
async function C(e, r) {
|
|
311
|
+
if (E.has(e))
|
|
312
|
+
return E.get(e);
|
|
264
313
|
const n = (async () => {
|
|
265
|
-
var
|
|
266
|
-
const l = r || "",
|
|
267
|
-
(
|
|
268
|
-
var
|
|
269
|
-
return (
|
|
314
|
+
var u;
|
|
315
|
+
const l = r || "", i = new Le({ instanceUrl: l }), d = i.api.motionGroupModels;
|
|
316
|
+
(u = d.axios) != null && u.interceptors && d.axios.interceptors.request.use((m) => {
|
|
317
|
+
var f;
|
|
318
|
+
return (f = m.url) != null && f.includes("/glb") && (m.responseType = "blob"), m;
|
|
270
319
|
});
|
|
271
320
|
try {
|
|
272
|
-
const
|
|
273
|
-
return URL.createObjectURL(
|
|
274
|
-
} catch (
|
|
275
|
-
throw console.error("Failed to fetch model:",
|
|
321
|
+
const m = await i.api.motionGroupModels.getMotionGroupGlbModel(e);
|
|
322
|
+
return URL.createObjectURL(m);
|
|
323
|
+
} catch (m) {
|
|
324
|
+
throw console.error("Failed to fetch model:", m), m;
|
|
276
325
|
}
|
|
277
326
|
})();
|
|
278
|
-
return
|
|
327
|
+
return E.set(e, n), n;
|
|
279
328
|
}
|
|
280
329
|
function ue(e) {
|
|
281
330
|
function r(n) {
|
|
@@ -289,17 +338,17 @@ function fe(e) {
|
|
|
289
338
|
function de(e) {
|
|
290
339
|
return /_J[0-9]+$/.test(e.name);
|
|
291
340
|
}
|
|
292
|
-
function
|
|
341
|
+
function Oe(e, r) {
|
|
293
342
|
let n;
|
|
294
|
-
function l(
|
|
295
|
-
if (fe(
|
|
343
|
+
function l(i) {
|
|
344
|
+
if (fe(i)) {
|
|
296
345
|
if (n)
|
|
297
346
|
throw Error(
|
|
298
|
-
`Found multiple flange groups in robot model ${r}; first ${n.name} then ${
|
|
347
|
+
`Found multiple flange groups in robot model ${r}; first ${n.name} then ${i.name}. Only one _FLG group is allowed.`
|
|
299
348
|
);
|
|
300
|
-
n =
|
|
349
|
+
n = i;
|
|
301
350
|
}
|
|
302
|
-
de(
|
|
351
|
+
de(i), i.children.map(l);
|
|
303
352
|
}
|
|
304
353
|
if (l(e.scene), !n)
|
|
305
354
|
throw Error(
|
|
@@ -307,121 +356,121 @@ function Ce(e, r) {
|
|
|
307
356
|
);
|
|
308
357
|
return { gltf: e };
|
|
309
358
|
}
|
|
310
|
-
function
|
|
359
|
+
function pe({
|
|
311
360
|
rapidlyChangingMotionState: e,
|
|
312
361
|
dhParameters: r,
|
|
313
362
|
onRotationChanged: n,
|
|
314
363
|
children: l
|
|
315
364
|
}) {
|
|
316
|
-
const
|
|
317
|
-
|
|
318
|
-
const
|
|
319
|
-
(
|
|
365
|
+
const i = R([]), d = R([]), u = R(null), { invalidate: m } = se();
|
|
366
|
+
M(() => {
|
|
367
|
+
const o = e.joint_position.filter(
|
|
368
|
+
(a) => a !== void 0
|
|
320
369
|
);
|
|
321
|
-
return
|
|
370
|
+
return u.current = new ae(o, {
|
|
322
371
|
tension: 120,
|
|
323
372
|
// Controls spring stiffness - higher values create faster, more responsive motion
|
|
324
373
|
friction: 20,
|
|
325
374
|
// Controls damping - higher values reduce oscillation and create smoother settling
|
|
326
375
|
threshold: 1e-3
|
|
327
376
|
}), () => {
|
|
328
|
-
var
|
|
329
|
-
(
|
|
377
|
+
var a;
|
|
378
|
+
(a = u.current) == null || a.destroy();
|
|
330
379
|
};
|
|
331
|
-
}, []), ie((
|
|
332
|
-
if (
|
|
333
|
-
const
|
|
334
|
-
|
|
380
|
+
}, []), ie((o, a) => {
|
|
381
|
+
if (u.current) {
|
|
382
|
+
const c = u.current.update(a);
|
|
383
|
+
s(), c || m();
|
|
335
384
|
}
|
|
336
385
|
});
|
|
337
|
-
function
|
|
338
|
-
|
|
386
|
+
function f(o) {
|
|
387
|
+
o && (d.current = ue(o), s(), m());
|
|
339
388
|
}
|
|
340
|
-
function
|
|
341
|
-
var
|
|
342
|
-
const
|
|
389
|
+
function s() {
|
|
390
|
+
var a;
|
|
391
|
+
const o = ((a = u.current) == null ? void 0 : a.getCurrentValues()) || [];
|
|
343
392
|
if (n)
|
|
344
|
-
n(
|
|
393
|
+
n(d.current, o);
|
|
345
394
|
else
|
|
346
|
-
for (const [
|
|
347
|
-
const
|
|
348
|
-
y.rotation.y = g * (
|
|
395
|
+
for (const [c, y] of d.current.entries()) {
|
|
396
|
+
const h = r[c], j = h.theta || 0, g = h.reverse_rotation_direction ? -1 : 1;
|
|
397
|
+
y.rotation.y = g * (o[c] || 0) + j;
|
|
349
398
|
}
|
|
350
399
|
}
|
|
351
|
-
const
|
|
352
|
-
const
|
|
353
|
-
(
|
|
400
|
+
const p = T(() => {
|
|
401
|
+
const o = e.joint_position.filter(
|
|
402
|
+
(a) => a !== void 0
|
|
354
403
|
);
|
|
355
404
|
requestAnimationFrame(() => {
|
|
356
|
-
var
|
|
357
|
-
|
|
405
|
+
var a;
|
|
406
|
+
i.current = o, (a = u.current) == null || a.setTarget(o);
|
|
358
407
|
});
|
|
359
408
|
}, [e]);
|
|
360
|
-
return
|
|
361
|
-
|
|
362
|
-
}, [e,
|
|
363
|
-
|
|
364
|
-
}), /* @__PURE__ */ t.jsx("group", { ref:
|
|
409
|
+
return M(() => {
|
|
410
|
+
p();
|
|
411
|
+
}, [e, p]), le(() => {
|
|
412
|
+
p();
|
|
413
|
+
}), /* @__PURE__ */ t.jsx("group", { ref: f, children: l });
|
|
365
414
|
}
|
|
366
|
-
const
|
|
367
|
-
function
|
|
415
|
+
const Ce = "line", Ue = "mesh";
|
|
416
|
+
function Ee({
|
|
368
417
|
rapidlyChangingMotionState: e,
|
|
369
418
|
dhParameters: r,
|
|
370
419
|
...n
|
|
371
420
|
}) {
|
|
372
|
-
const l = new w(),
|
|
373
|
-
|
|
374
|
-
|
|
421
|
+
const l = new w(), i = R([]), d = R([]);
|
|
422
|
+
ve.useEffect(() => {
|
|
423
|
+
i.current = new Array(r.length).fill(null), d.current = new Array(r.length).fill(null);
|
|
375
424
|
}, [r.length]);
|
|
376
|
-
function s
|
|
377
|
-
const
|
|
378
|
-
l.decompose(
|
|
379
|
-
const y =
|
|
380
|
-
|
|
381
|
-
).multiply(new w().makeTranslation(0,
|
|
382
|
-
return l.multiply(
|
|
425
|
+
function u(s, p) {
|
|
426
|
+
const o = new V(), a = new J(), c = new V();
|
|
427
|
+
l.decompose(o, a, c);
|
|
428
|
+
const y = o.clone(), h = new w().makeRotationY(
|
|
429
|
+
s.theta + p * (s.reverse_rotation_direction ? -1 : 1)
|
|
430
|
+
).multiply(new w().makeTranslation(0, s.d / 1e3, 0)).multiply(new w().makeTranslation(s.a / 1e3, 0, 0)).multiply(new w().makeRotationX(s.alpha));
|
|
431
|
+
return l.multiply(h), l.decompose(o, a, c), { a: y, b: o };
|
|
383
432
|
}
|
|
384
|
-
function
|
|
433
|
+
function m(s, p, o, a) {
|
|
385
434
|
if (!r)
|
|
386
435
|
return;
|
|
387
|
-
const
|
|
388
|
-
if (!
|
|
436
|
+
const c = r[s];
|
|
437
|
+
if (!c)
|
|
389
438
|
return;
|
|
390
|
-
const { a: y, b:
|
|
391
|
-
|
|
439
|
+
const { a: y, b: h } = u(c, a);
|
|
440
|
+
p.geometry.setPositions([y.toArray(), h.toArray()].flat()), o.position.set(h.x, h.y, h.z);
|
|
392
441
|
}
|
|
393
|
-
function
|
|
442
|
+
function f(s, p) {
|
|
394
443
|
l.identity();
|
|
395
|
-
for (let
|
|
396
|
-
const
|
|
397
|
-
|
|
444
|
+
for (let o = 0; o < Math.min(s.length, p.length); o++) {
|
|
445
|
+
const a = i.current[o], c = d.current[o];
|
|
446
|
+
a && c && m(o, a, c, p[o]);
|
|
398
447
|
}
|
|
399
448
|
}
|
|
400
449
|
return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsx(
|
|
401
|
-
|
|
450
|
+
pe,
|
|
402
451
|
{
|
|
403
452
|
rapidlyChangingMotionState: e,
|
|
404
453
|
dhParameters: r,
|
|
405
|
-
onRotationChanged:
|
|
454
|
+
onRotationChanged: f,
|
|
406
455
|
children: /* @__PURE__ */ t.jsxs("group", { ...n, name: "Scene", children: [
|
|
407
456
|
/* @__PURE__ */ t.jsxs("mesh", { children: [
|
|
408
457
|
/* @__PURE__ */ t.jsx("sphereGeometry", { args: [0.01, 32, 32] }),
|
|
409
458
|
/* @__PURE__ */ t.jsx("meshStandardMaterial", { color: "black", depthTest: !0 })
|
|
410
459
|
] }),
|
|
411
|
-
r.map((
|
|
412
|
-
const { a:
|
|
413
|
-
|
|
414
|
-
e.joint_position[
|
|
415
|
-
),
|
|
416
|
-
return /* @__PURE__ */ t.jsxs("group", { name:
|
|
460
|
+
r.map((s, p) => {
|
|
461
|
+
const { a: o, b: a } = u(
|
|
462
|
+
s,
|
|
463
|
+
e.joint_position[p] ?? 0
|
|
464
|
+
), c = `dhrobot_J0${p}`;
|
|
465
|
+
return /* @__PURE__ */ t.jsxs("group", { name: c, children: [
|
|
417
466
|
/* @__PURE__ */ t.jsx(
|
|
418
|
-
|
|
467
|
+
z,
|
|
419
468
|
{
|
|
420
469
|
ref: (y) => {
|
|
421
|
-
|
|
470
|
+
i.current[p] = y;
|
|
422
471
|
},
|
|
423
|
-
name:
|
|
424
|
-
points: [
|
|
472
|
+
name: Ce,
|
|
473
|
+
points: [o, a],
|
|
425
474
|
color: "white",
|
|
426
475
|
lineWidth: 5
|
|
427
476
|
}
|
|
@@ -430,32 +479,32 @@ function Ue({
|
|
|
430
479
|
"mesh",
|
|
431
480
|
{
|
|
432
481
|
ref: (y) => {
|
|
433
|
-
|
|
482
|
+
d.current[p] = y;
|
|
434
483
|
},
|
|
435
|
-
name:
|
|
436
|
-
position:
|
|
484
|
+
name: Ue,
|
|
485
|
+
position: a,
|
|
437
486
|
children: [
|
|
438
487
|
/* @__PURE__ */ t.jsx("sphereGeometry", { args: [0.01, 32, 32] }),
|
|
439
488
|
/* @__PURE__ */ t.jsx("meshStandardMaterial", { color: "black", depthTest: !0 })
|
|
440
489
|
]
|
|
441
490
|
},
|
|
442
|
-
"mesh_" +
|
|
491
|
+
"mesh_" + p
|
|
443
492
|
)
|
|
444
|
-
] },
|
|
493
|
+
] }, c);
|
|
445
494
|
})
|
|
446
495
|
] })
|
|
447
496
|
}
|
|
448
497
|
) });
|
|
449
498
|
}
|
|
450
|
-
const
|
|
451
|
-
function
|
|
452
|
-
return
|
|
499
|
+
const Je = console.warn;
|
|
500
|
+
function me() {
|
|
501
|
+
return M(() => {
|
|
453
502
|
console.warn = (e) => {
|
|
454
|
-
e !== "Cannot call the manual advancement of rafz whilst frameLoop is not set as demand" &&
|
|
503
|
+
e !== "Cannot call the manual advancement of rafz whilst frameLoop is not set as demand" && Je(e);
|
|
455
504
|
};
|
|
456
505
|
}, []), /* @__PURE__ */ t.jsx(t.Fragment, {});
|
|
457
506
|
}
|
|
458
|
-
function
|
|
507
|
+
function ze(e) {
|
|
459
508
|
return e.type === "Mesh";
|
|
460
509
|
}
|
|
461
510
|
function Be({
|
|
@@ -464,72 +513,72 @@ function Be({
|
|
|
464
513
|
postModelRender: n,
|
|
465
514
|
...l
|
|
466
515
|
}) {
|
|
467
|
-
const
|
|
468
|
-
let
|
|
516
|
+
const i = Te(e);
|
|
517
|
+
let d;
|
|
469
518
|
try {
|
|
470
|
-
|
|
471
|
-
} catch (
|
|
472
|
-
throw
|
|
519
|
+
d = Oe(i, "robot.glb").gltf;
|
|
520
|
+
} catch (f) {
|
|
521
|
+
throw f;
|
|
473
522
|
}
|
|
474
|
-
const
|
|
475
|
-
(
|
|
476
|
-
|
|
523
|
+
const u = T(
|
|
524
|
+
(f) => {
|
|
525
|
+
f && n && n();
|
|
477
526
|
},
|
|
478
527
|
[n]
|
|
479
528
|
);
|
|
480
|
-
function
|
|
529
|
+
function m(f) {
|
|
481
530
|
try {
|
|
482
|
-
return
|
|
531
|
+
return ze(f) ? f.geometry ? /* @__PURE__ */ t.jsx(
|
|
483
532
|
"mesh",
|
|
484
533
|
{
|
|
485
|
-
name:
|
|
486
|
-
geometry:
|
|
487
|
-
material:
|
|
488
|
-
position:
|
|
489
|
-
rotation:
|
|
534
|
+
name: f.name,
|
|
535
|
+
geometry: f.geometry,
|
|
536
|
+
material: f.material,
|
|
537
|
+
position: f.position,
|
|
538
|
+
rotation: f.rotation
|
|
490
539
|
},
|
|
491
|
-
|
|
492
|
-
) : /* @__PURE__ */ t.jsx("group", { name:
|
|
540
|
+
f.uuid
|
|
541
|
+
) : /* @__PURE__ */ t.jsx("group", { name: f.name, position: f.position, rotation: f.rotation }, f.uuid) : /* @__PURE__ */ t.jsx(
|
|
493
542
|
"group",
|
|
494
543
|
{
|
|
495
|
-
name:
|
|
496
|
-
position:
|
|
497
|
-
rotation:
|
|
498
|
-
ref: fe(
|
|
499
|
-
children:
|
|
544
|
+
name: f.name,
|
|
545
|
+
position: f.position,
|
|
546
|
+
rotation: f.rotation,
|
|
547
|
+
ref: fe(f) ? r : void 0,
|
|
548
|
+
children: f.children.map(m)
|
|
500
549
|
},
|
|
501
|
-
|
|
550
|
+
f.uuid
|
|
502
551
|
);
|
|
503
|
-
} catch (
|
|
504
|
-
return console.warn("Error rendering node",
|
|
552
|
+
} catch (s) {
|
|
553
|
+
return console.warn("Error rendering node", f.name, s), null;
|
|
505
554
|
}
|
|
506
555
|
}
|
|
507
|
-
return /* @__PURE__ */ t.jsx("group", { ...l, dispose: null, ref:
|
|
556
|
+
return /* @__PURE__ */ t.jsx("group", { ...l, dispose: null, ref: u, children: m(d.scene) });
|
|
508
557
|
}
|
|
509
|
-
function
|
|
558
|
+
function he({
|
|
510
559
|
modelURL: e,
|
|
511
560
|
flangeRef: r,
|
|
512
561
|
postModelRender: n,
|
|
513
562
|
...l
|
|
514
563
|
}) {
|
|
515
|
-
const [
|
|
516
|
-
return
|
|
564
|
+
const [i, d] = S(null);
|
|
565
|
+
return M(() => {
|
|
517
566
|
(async () => {
|
|
518
567
|
try {
|
|
519
568
|
if (typeof e == "string")
|
|
520
|
-
|
|
569
|
+
d(e);
|
|
521
570
|
else {
|
|
522
|
-
const
|
|
523
|
-
|
|
571
|
+
const m = await e;
|
|
572
|
+
d(m);
|
|
524
573
|
}
|
|
525
|
-
} catch (
|
|
526
|
-
console.error("Failed to resolve model URL:",
|
|
574
|
+
} catch (m) {
|
|
575
|
+
console.error("Failed to resolve model URL:", m);
|
|
527
576
|
}
|
|
528
577
|
})();
|
|
529
|
-
}, [e]),
|
|
578
|
+
}, [e]), i ? /* @__PURE__ */ t.jsx(
|
|
530
579
|
Be,
|
|
531
580
|
{
|
|
532
|
-
url:
|
|
581
|
+
url: i,
|
|
533
582
|
flangeRef: r,
|
|
534
583
|
postModelRender: n,
|
|
535
584
|
...l
|
|
@@ -540,7 +589,7 @@ const xe = (e, r) => {
|
|
|
540
589
|
e.userData.isGhost || (e.traverse((n) => {
|
|
541
590
|
if (n instanceof x.Mesh) {
|
|
542
591
|
n.material instanceof x.Material && (n.material.colorWrite = !1);
|
|
543
|
-
const l = n.clone(),
|
|
592
|
+
const l = n.clone(), i = n.clone();
|
|
544
593
|
l.material = new x.MeshStandardMaterial({
|
|
545
594
|
depthTest: !0,
|
|
546
595
|
depthWrite: !0,
|
|
@@ -548,7 +597,7 @@ const xe = (e, r) => {
|
|
|
548
597
|
polygonOffset: !0,
|
|
549
598
|
polygonOffsetFactor: -1,
|
|
550
599
|
side: x.DoubleSide
|
|
551
|
-
}), l.userData.isGhost = !0,
|
|
600
|
+
}), l.userData.isGhost = !0, i.material = new x.MeshStandardMaterial({
|
|
552
601
|
color: r,
|
|
553
602
|
opacity: 0.3,
|
|
554
603
|
depthTest: !0,
|
|
@@ -557,7 +606,7 @@ const xe = (e, r) => {
|
|
|
557
606
|
polygonOffset: !0,
|
|
558
607
|
polygonOffsetFactor: -2,
|
|
559
608
|
side: x.DoubleSide
|
|
560
|
-
}),
|
|
609
|
+
}), i.userData.isGhost = !0, n.parent && (n.parent.add(l), n.parent.add(i));
|
|
561
610
|
}
|
|
562
611
|
}), e.userData.isGhost = !0);
|
|
563
612
|
}, ye = (e) => {
|
|
@@ -569,64 +618,64 @@ const xe = (e, r) => {
|
|
|
569
618
|
}), r.forEach((n) => {
|
|
570
619
|
n.parent && n.parent.remove(n);
|
|
571
620
|
}), e.userData.isGhost = !1;
|
|
572
|
-
}, ge =
|
|
621
|
+
}, ge = O(
|
|
573
622
|
({
|
|
574
623
|
rapidlyChangingMotionState: e,
|
|
575
624
|
modelFromController: r,
|
|
576
625
|
dhParameters: n,
|
|
577
|
-
getModel: l =
|
|
578
|
-
flangeRef:
|
|
579
|
-
postModelRender:
|
|
580
|
-
transparentColor:
|
|
581
|
-
instanceUrl:
|
|
582
|
-
...
|
|
626
|
+
getModel: l = C,
|
|
627
|
+
flangeRef: i,
|
|
628
|
+
postModelRender: d,
|
|
629
|
+
transparentColor: u,
|
|
630
|
+
instanceUrl: m,
|
|
631
|
+
...f
|
|
583
632
|
}) => {
|
|
584
|
-
const [
|
|
585
|
-
|
|
633
|
+
const [s, p] = S(null), o = T((c) => {
|
|
634
|
+
p(c);
|
|
586
635
|
}, []);
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
}, [
|
|
590
|
-
const
|
|
591
|
-
|
|
636
|
+
M(() => {
|
|
637
|
+
s && (u ? xe(s, u) : ye(s));
|
|
638
|
+
}, [s, u]);
|
|
639
|
+
const a = /* @__PURE__ */ t.jsx(
|
|
640
|
+
Ee,
|
|
592
641
|
{
|
|
593
642
|
rapidlyChangingMotionState: e,
|
|
594
643
|
dhParameters: n,
|
|
595
|
-
...
|
|
644
|
+
...f
|
|
596
645
|
}
|
|
597
646
|
);
|
|
598
647
|
return /* @__PURE__ */ t.jsxs(
|
|
599
648
|
ce,
|
|
600
649
|
{
|
|
601
|
-
fallback:
|
|
602
|
-
onError: (
|
|
603
|
-
console.warn(
|
|
650
|
+
fallback: a,
|
|
651
|
+
onError: (c) => {
|
|
652
|
+
console.warn(c);
|
|
604
653
|
},
|
|
605
654
|
children: [
|
|
606
|
-
/* @__PURE__ */ t.jsx(oe, { fallback:
|
|
607
|
-
|
|
655
|
+
/* @__PURE__ */ t.jsx(oe, { fallback: a, children: /* @__PURE__ */ t.jsx("group", { ref: o, children: /* @__PURE__ */ t.jsx(
|
|
656
|
+
pe,
|
|
608
657
|
{
|
|
609
658
|
rapidlyChangingMotionState: e,
|
|
610
659
|
dhParameters: n,
|
|
611
660
|
children: /* @__PURE__ */ t.jsx(
|
|
612
|
-
|
|
661
|
+
he,
|
|
613
662
|
{
|
|
614
663
|
modelURL: (() => {
|
|
615
|
-
const
|
|
616
|
-
if (!
|
|
617
|
-
const y = new Blob([], { type: "model/gltf-binary" }),
|
|
618
|
-
return Promise.resolve(URL.createObjectURL(
|
|
664
|
+
const c = l(r, m);
|
|
665
|
+
if (!c) {
|
|
666
|
+
const y = new Blob([], { type: "model/gltf-binary" }), h = new File([y], `${r}.glb`, { type: "model/gltf-binary" });
|
|
667
|
+
return Promise.resolve(URL.createObjectURL(h));
|
|
619
668
|
}
|
|
620
|
-
return
|
|
669
|
+
return c;
|
|
621
670
|
})(),
|
|
622
|
-
postModelRender:
|
|
623
|
-
flangeRef:
|
|
624
|
-
...
|
|
671
|
+
postModelRender: d,
|
|
672
|
+
flangeRef: i,
|
|
673
|
+
...f
|
|
625
674
|
}
|
|
626
675
|
)
|
|
627
676
|
}
|
|
628
677
|
) }) }),
|
|
629
|
-
/* @__PURE__ */ t.jsx(
|
|
678
|
+
/* @__PURE__ */ t.jsx(me, {})
|
|
630
679
|
]
|
|
631
680
|
}
|
|
632
681
|
);
|
|
@@ -634,11 +683,11 @@ const xe = (e, r) => {
|
|
|
634
683
|
);
|
|
635
684
|
function We({
|
|
636
685
|
connectedMotionGroup: e,
|
|
637
|
-
getModel: r =
|
|
686
|
+
getModel: r = C,
|
|
638
687
|
flangeRef: n,
|
|
639
688
|
transparentColor: l,
|
|
640
|
-
postModelRender:
|
|
641
|
-
...
|
|
689
|
+
postModelRender: i,
|
|
690
|
+
...d
|
|
642
691
|
}) {
|
|
643
692
|
return e.dhParameters ? /* @__PURE__ */ t.jsx(
|
|
644
693
|
ge,
|
|
@@ -649,55 +698,55 @@ function We({
|
|
|
649
698
|
getModel: r,
|
|
650
699
|
flangeRef: n,
|
|
651
700
|
transparentColor: l,
|
|
652
|
-
postModelRender:
|
|
653
|
-
...
|
|
701
|
+
postModelRender: i,
|
|
702
|
+
...d
|
|
654
703
|
}
|
|
655
704
|
) : null;
|
|
656
705
|
}
|
|
657
|
-
const at =
|
|
658
|
-
|
|
706
|
+
const at = O(
|
|
707
|
+
Ae(
|
|
659
708
|
({
|
|
660
709
|
robotName: e,
|
|
661
710
|
programState: r,
|
|
662
711
|
safetyState: n,
|
|
663
712
|
operationMode: l,
|
|
664
|
-
driveToHomeEnabled:
|
|
665
|
-
onDriveToHomePress:
|
|
666
|
-
onDriveToHomeRelease:
|
|
667
|
-
connectedMotionGroup:
|
|
668
|
-
robotComponent:
|
|
669
|
-
customContentComponent:
|
|
670
|
-
className:
|
|
713
|
+
driveToHomeEnabled: i = !1,
|
|
714
|
+
onDriveToHomePress: d,
|
|
715
|
+
onDriveToHomeRelease: u,
|
|
716
|
+
connectedMotionGroup: m,
|
|
717
|
+
robotComponent: f = We,
|
|
718
|
+
customContentComponent: s,
|
|
719
|
+
className: p
|
|
671
720
|
}) => {
|
|
672
721
|
var $;
|
|
673
|
-
const
|
|
674
|
-
|
|
675
|
-
const
|
|
722
|
+
const o = Ve(), { t: a } = Fe(), [c, y] = S(!1), h = R(null), j = R(null), [g, U] = S(!1), [L, Re] = S({ width: 400, height: 600 }), [He, Me] = S(0);
|
|
723
|
+
M(() => {
|
|
724
|
+
const I = () => {
|
|
676
725
|
if (j.current) {
|
|
677
|
-
const { offsetWidth: N, offsetHeight:
|
|
678
|
-
|
|
726
|
+
const { offsetWidth: N, offsetHeight: q } = j.current;
|
|
727
|
+
U(N > q), Re({ width: N, height: q });
|
|
679
728
|
}
|
|
680
729
|
};
|
|
681
|
-
|
|
682
|
-
const H = new ResizeObserver(
|
|
730
|
+
I();
|
|
731
|
+
const H = new ResizeObserver(I);
|
|
683
732
|
return j.current && H.observe(j.current), () => {
|
|
684
733
|
H.disconnect();
|
|
685
734
|
};
|
|
686
735
|
}, []);
|
|
687
|
-
const B =
|
|
688
|
-
|
|
689
|
-
}, []),
|
|
690
|
-
!
|
|
691
|
-
}, [
|
|
692
|
-
!
|
|
693
|
-
}, [
|
|
694
|
-
|
|
695
|
-
}, [
|
|
736
|
+
const B = T(() => {
|
|
737
|
+
Me((I) => I + 1);
|
|
738
|
+
}, []), G = T(() => {
|
|
739
|
+
!i || !d || (y(!0), d());
|
|
740
|
+
}, [i, d]), P = T(() => {
|
|
741
|
+
!i || !u || (y(!1), u());
|
|
742
|
+
}, [i, u]), W = T(() => {
|
|
743
|
+
c && u && (y(!1), u());
|
|
744
|
+
}, [c, u]), _ = g ? L.width < 350 : L.height < 200, k = g ? L.height < 310 : L.height < 450;
|
|
696
745
|
return /* @__PURE__ */ t.jsx(
|
|
697
|
-
|
|
746
|
+
Se,
|
|
698
747
|
{
|
|
699
748
|
ref: j,
|
|
700
|
-
className:
|
|
749
|
+
className: p,
|
|
701
750
|
sx: {
|
|
702
751
|
width: "100%",
|
|
703
752
|
height: "100%",
|
|
@@ -708,10 +757,10 @@ const at = C(
|
|
|
708
757
|
minWidth: { xs: 180, sm: 220, md: 250 },
|
|
709
758
|
minHeight: g ? { xs: 200, sm: 240, md: 260 } : { xs: 150, sm: 180, md: 220 },
|
|
710
759
|
// Allow progressive hiding in portrait mode
|
|
711
|
-
border: `1px solid ${
|
|
760
|
+
border: `1px solid ${o.palette.divider}`,
|
|
712
761
|
borderRadius: "18px",
|
|
713
762
|
boxShadow: "none",
|
|
714
|
-
backgroundColor: (($ =
|
|
763
|
+
backgroundColor: (($ = o.palette.backgroundPaperElevation) == null ? void 0 : $[8]) || "#2A2A3F",
|
|
715
764
|
backgroundImage: "none"
|
|
716
765
|
// Override any gradient from elevation
|
|
717
766
|
},
|
|
@@ -733,7 +782,7 @@ const at = C(
|
|
|
733
782
|
display: _ ? "none" : "block"
|
|
734
783
|
},
|
|
735
784
|
children: !_ && /* @__PURE__ */ t.jsxs(
|
|
736
|
-
|
|
785
|
+
Y,
|
|
737
786
|
{
|
|
738
787
|
orthographic: !0,
|
|
739
788
|
camera: {
|
|
@@ -743,7 +792,7 @@ const at = C(
|
|
|
743
792
|
shadows: !0,
|
|
744
793
|
frameloop: "demand",
|
|
745
794
|
style: {
|
|
746
|
-
borderRadius:
|
|
795
|
+
borderRadius: o.shape.borderRadius,
|
|
747
796
|
width: "100%",
|
|
748
797
|
height: "100%",
|
|
749
798
|
background: "transparent",
|
|
@@ -756,9 +805,9 @@ const at = C(
|
|
|
756
805
|
children: [
|
|
757
806
|
/* @__PURE__ */ t.jsx(te, {}),
|
|
758
807
|
/* @__PURE__ */ t.jsx(X, { fit: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ t.jsx(
|
|
759
|
-
|
|
808
|
+
f,
|
|
760
809
|
{
|
|
761
|
-
connectedMotionGroup:
|
|
810
|
+
connectedMotionGroup: m,
|
|
762
811
|
postModelRender: B
|
|
763
812
|
}
|
|
764
813
|
) })
|
|
@@ -811,15 +860,15 @@ const at = C(
|
|
|
811
860
|
justifyContent: "space-between"
|
|
812
861
|
},
|
|
813
862
|
children: [
|
|
814
|
-
!
|
|
815
|
-
/* @__PURE__ */ t.jsx(
|
|
863
|
+
!k && s && /* @__PURE__ */ t.jsxs(b, { children: [
|
|
864
|
+
/* @__PURE__ */ t.jsx(s, {}),
|
|
816
865
|
/* @__PURE__ */ t.jsx(
|
|
817
866
|
Q,
|
|
818
867
|
{
|
|
819
868
|
sx: {
|
|
820
869
|
mt: 1,
|
|
821
870
|
mb: 0,
|
|
822
|
-
borderColor:
|
|
871
|
+
borderColor: o.palette.divider,
|
|
823
872
|
opacity: 0.5
|
|
824
873
|
}
|
|
825
874
|
}
|
|
@@ -829,7 +878,7 @@ const at = C(
|
|
|
829
878
|
b,
|
|
830
879
|
{
|
|
831
880
|
sx: {
|
|
832
|
-
mt: !
|
|
881
|
+
mt: !k && s ? "auto" : 0
|
|
833
882
|
},
|
|
834
883
|
children: /* @__PURE__ */ t.jsx(
|
|
835
884
|
b,
|
|
@@ -843,22 +892,22 @@ const at = C(
|
|
|
843
892
|
children: /* @__PURE__ */ t.jsx(
|
|
844
893
|
Z,
|
|
845
894
|
{
|
|
846
|
-
ref:
|
|
895
|
+
ref: h,
|
|
847
896
|
variant: "contained",
|
|
848
897
|
color: "secondary",
|
|
849
898
|
size: "small",
|
|
850
|
-
disabled: !
|
|
851
|
-
onMouseDown:
|
|
852
|
-
onMouseUp:
|
|
899
|
+
disabled: !i,
|
|
900
|
+
onMouseDown: G,
|
|
901
|
+
onMouseUp: P,
|
|
853
902
|
onMouseLeave: W,
|
|
854
|
-
onTouchStart:
|
|
855
|
-
onTouchEnd:
|
|
903
|
+
onTouchStart: G,
|
|
904
|
+
onTouchEnd: P,
|
|
856
905
|
sx: {
|
|
857
906
|
textTransform: "none",
|
|
858
907
|
px: 1.5,
|
|
859
908
|
py: 0.5
|
|
860
909
|
},
|
|
861
|
-
children:
|
|
910
|
+
children: a("RobotCard.DriveToHome.bt")
|
|
862
911
|
}
|
|
863
912
|
)
|
|
864
913
|
}
|
|
@@ -905,7 +954,7 @@ const at = C(
|
|
|
905
954
|
display: _ ? "none" : "block"
|
|
906
955
|
},
|
|
907
956
|
children: !_ && /* @__PURE__ */ t.jsxs(
|
|
908
|
-
|
|
957
|
+
Y,
|
|
909
958
|
{
|
|
910
959
|
orthographic: !0,
|
|
911
960
|
camera: {
|
|
@@ -915,7 +964,7 @@ const at = C(
|
|
|
915
964
|
shadows: !0,
|
|
916
965
|
frameloop: "demand",
|
|
917
966
|
style: {
|
|
918
|
-
borderRadius:
|
|
967
|
+
borderRadius: o.shape.borderRadius,
|
|
919
968
|
width: "100%",
|
|
920
969
|
height: "100%",
|
|
921
970
|
background: "transparent",
|
|
@@ -926,9 +975,9 @@ const at = C(
|
|
|
926
975
|
children: [
|
|
927
976
|
/* @__PURE__ */ t.jsx(te, {}),
|
|
928
977
|
/* @__PURE__ */ t.jsx(X, { fit: !0, clip: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ t.jsx(
|
|
929
|
-
|
|
978
|
+
f,
|
|
930
979
|
{
|
|
931
|
-
connectedMotionGroup:
|
|
980
|
+
connectedMotionGroup: m,
|
|
932
981
|
postModelRender: B
|
|
933
982
|
}
|
|
934
983
|
) })
|
|
@@ -938,15 +987,15 @@ const at = C(
|
|
|
938
987
|
}
|
|
939
988
|
),
|
|
940
989
|
/* @__PURE__ */ t.jsxs(b, { children: [
|
|
941
|
-
!
|
|
942
|
-
/* @__PURE__ */ t.jsx(
|
|
990
|
+
!k && s && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
991
|
+
/* @__PURE__ */ t.jsx(s, {}),
|
|
943
992
|
/* @__PURE__ */ t.jsx(
|
|
944
993
|
Q,
|
|
945
994
|
{
|
|
946
995
|
sx: {
|
|
947
996
|
mt: 1,
|
|
948
997
|
mb: 0,
|
|
949
|
-
borderColor:
|
|
998
|
+
borderColor: o.palette.divider,
|
|
950
999
|
opacity: 0.5
|
|
951
1000
|
}
|
|
952
1001
|
}
|
|
@@ -958,28 +1007,28 @@ const at = C(
|
|
|
958
1007
|
sx: {
|
|
959
1008
|
display: "flex",
|
|
960
1009
|
justifyContent: "flex-start",
|
|
961
|
-
mt: !
|
|
1010
|
+
mt: !k && s ? { xs: 1, sm: 2, md: 5 } : { xs: 0.5, sm: 1, md: 2 },
|
|
962
1011
|
mb: { xs: 0.5, sm: 0.75, md: 1 }
|
|
963
1012
|
},
|
|
964
1013
|
children: /* @__PURE__ */ t.jsx(
|
|
965
1014
|
Z,
|
|
966
1015
|
{
|
|
967
|
-
ref:
|
|
1016
|
+
ref: h,
|
|
968
1017
|
variant: "contained",
|
|
969
1018
|
color: "secondary",
|
|
970
1019
|
size: "small",
|
|
971
|
-
disabled: !
|
|
972
|
-
onMouseDown:
|
|
973
|
-
onMouseUp:
|
|
1020
|
+
disabled: !i,
|
|
1021
|
+
onMouseDown: G,
|
|
1022
|
+
onMouseUp: P,
|
|
974
1023
|
onMouseLeave: W,
|
|
975
|
-
onTouchStart:
|
|
976
|
-
onTouchEnd:
|
|
1024
|
+
onTouchStart: G,
|
|
1025
|
+
onTouchEnd: P,
|
|
977
1026
|
sx: {
|
|
978
1027
|
textTransform: "none",
|
|
979
1028
|
px: 1.5,
|
|
980
1029
|
py: 0.5
|
|
981
1030
|
},
|
|
982
|
-
children:
|
|
1031
|
+
children: a("RobotCard.DriveToHome.bt")
|
|
983
1032
|
}
|
|
984
1033
|
)
|
|
985
1034
|
}
|
|
@@ -999,95 +1048,95 @@ function je({
|
|
|
999
1048
|
onTranslationChanged: n,
|
|
1000
1049
|
children: l
|
|
1001
1050
|
}) {
|
|
1002
|
-
const
|
|
1003
|
-
|
|
1004
|
-
const
|
|
1005
|
-
(
|
|
1051
|
+
const i = R([]), d = R([]), u = R(null), { invalidate: m } = se();
|
|
1052
|
+
M(() => {
|
|
1053
|
+
const o = e.joint_position.filter(
|
|
1054
|
+
(a) => a !== void 0
|
|
1006
1055
|
);
|
|
1007
|
-
return
|
|
1056
|
+
return u.current = new ae(o, {
|
|
1008
1057
|
tension: 120,
|
|
1009
1058
|
// Controls spring stiffness - higher values create faster, more responsive motion
|
|
1010
1059
|
friction: 20,
|
|
1011
1060
|
// Controls damping - higher values reduce oscillation and create smoother settling
|
|
1012
1061
|
threshold: 1e-3
|
|
1013
1062
|
}), () => {
|
|
1014
|
-
var
|
|
1015
|
-
(
|
|
1063
|
+
var a;
|
|
1064
|
+
(a = u.current) == null || a.destroy();
|
|
1016
1065
|
};
|
|
1017
|
-
}, []), ie((
|
|
1018
|
-
if (
|
|
1019
|
-
const
|
|
1020
|
-
|
|
1066
|
+
}, []), ie((o, a) => {
|
|
1067
|
+
if (u.current) {
|
|
1068
|
+
const c = u.current.update(a);
|
|
1069
|
+
s(), c || m();
|
|
1021
1070
|
}
|
|
1022
1071
|
});
|
|
1023
|
-
function
|
|
1024
|
-
|
|
1072
|
+
function f(o) {
|
|
1073
|
+
o && (d.current = ue(o), s(), m());
|
|
1025
1074
|
}
|
|
1026
|
-
function
|
|
1027
|
-
var
|
|
1028
|
-
const
|
|
1075
|
+
function s() {
|
|
1076
|
+
var a;
|
|
1077
|
+
const o = ((a = u.current) == null ? void 0 : a.getCurrentValues()) || [];
|
|
1029
1078
|
if (n)
|
|
1030
|
-
n(
|
|
1079
|
+
n(d.current, o);
|
|
1031
1080
|
else
|
|
1032
|
-
for (const [
|
|
1033
|
-
const j = r[
|
|
1034
|
-
y.position.y = j * (
|
|
1081
|
+
for (const [c, y] of d.current.entries()) {
|
|
1082
|
+
const j = r[c].reverse_rotation_direction ? -1 : 1;
|
|
1083
|
+
y.position.y = j * (o[c] || 0) / 1e3;
|
|
1035
1084
|
}
|
|
1036
1085
|
}
|
|
1037
|
-
const
|
|
1038
|
-
const
|
|
1039
|
-
(
|
|
1086
|
+
const p = T(() => {
|
|
1087
|
+
const o = e.joint_position.filter(
|
|
1088
|
+
(a) => a !== void 0
|
|
1040
1089
|
);
|
|
1041
1090
|
requestAnimationFrame(() => {
|
|
1042
|
-
var
|
|
1043
|
-
|
|
1091
|
+
var a;
|
|
1092
|
+
i.current = o, (a = u.current) == null || a.setTarget(o);
|
|
1044
1093
|
});
|
|
1045
1094
|
}, [e]);
|
|
1046
|
-
return
|
|
1047
|
-
|
|
1048
|
-
}, [e,
|
|
1049
|
-
|
|
1050
|
-
}), /* @__PURE__ */ t.jsx("group", { ref:
|
|
1095
|
+
return M(() => {
|
|
1096
|
+
p();
|
|
1097
|
+
}, [e, p]), le(() => {
|
|
1098
|
+
p();
|
|
1099
|
+
}), /* @__PURE__ */ t.jsx("group", { ref: f, children: l });
|
|
1051
1100
|
}
|
|
1052
1101
|
function we({
|
|
1053
1102
|
rapidlyChangingMotionState: e,
|
|
1054
1103
|
dhParameters: r,
|
|
1055
1104
|
...n
|
|
1056
1105
|
}) {
|
|
1057
|
-
const l = new w(),
|
|
1058
|
-
function s
|
|
1059
|
-
const
|
|
1106
|
+
const l = new w(), i = R(null), d = R(null);
|
|
1107
|
+
function u(s) {
|
|
1108
|
+
const p = new w();
|
|
1060
1109
|
for (let y = 0; y < r.length; y++) {
|
|
1061
|
-
const
|
|
1110
|
+
const h = r[y], j = s[y] ?? 0, g = new w().makeRotationY(h.theta).multiply(
|
|
1062
1111
|
new w().makeTranslation(
|
|
1063
|
-
|
|
1064
|
-
(
|
|
1112
|
+
h.a / 1e3,
|
|
1113
|
+
(h.d + j * (h.reverse_rotation_direction ? -1 : 1)) / 1e3,
|
|
1065
1114
|
0
|
|
1066
1115
|
)
|
|
1067
|
-
).multiply(new w().makeRotationX(
|
|
1068
|
-
|
|
1116
|
+
).multiply(new w().makeRotationX(h.alpha));
|
|
1117
|
+
p.multiply(g);
|
|
1069
1118
|
}
|
|
1070
|
-
const
|
|
1071
|
-
return
|
|
1119
|
+
const o = new V(), a = new J(), c = new V();
|
|
1120
|
+
return p.decompose(o, a, c), o;
|
|
1072
1121
|
}
|
|
1073
|
-
const
|
|
1074
|
-
function
|
|
1122
|
+
const m = u(e.joint_position);
|
|
1123
|
+
function f(s, p) {
|
|
1075
1124
|
l.identity();
|
|
1076
|
-
let
|
|
1077
|
-
for (let
|
|
1078
|
-
const j =
|
|
1125
|
+
let o = new V();
|
|
1126
|
+
for (let h = 0; h < r.length; h++) {
|
|
1127
|
+
const j = p[h] ?? 0, g = r[h], U = new w().makeRotationY(g.theta).multiply(
|
|
1079
1128
|
new w().makeTranslation(
|
|
1080
1129
|
g.a / 1e3,
|
|
1081
1130
|
(g.d + j * (g.reverse_rotation_direction ? -1 : 1)) / 1e3,
|
|
1082
1131
|
0
|
|
1083
1132
|
)
|
|
1084
1133
|
).multiply(new w().makeRotationX(g.alpha));
|
|
1085
|
-
l.multiply(
|
|
1134
|
+
l.multiply(U);
|
|
1086
1135
|
}
|
|
1087
|
-
const
|
|
1088
|
-
if (l.decompose(
|
|
1089
|
-
const
|
|
1090
|
-
|
|
1136
|
+
const a = new V(), c = new J(), y = new V();
|
|
1137
|
+
if (l.decompose(a, c, y), o = a, i.current && i.current.position.set(o.x, o.y, o.z), d.current) {
|
|
1138
|
+
const h = d.current.geometry;
|
|
1139
|
+
h && h.setPositions && h.setPositions([0, 0, 0, o.x, o.y, o.z]);
|
|
1091
1140
|
}
|
|
1092
1141
|
}
|
|
1093
1142
|
return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsx(
|
|
@@ -1095,22 +1144,22 @@ function we({
|
|
|
1095
1144
|
{
|
|
1096
1145
|
rapidlyChangingMotionState: e,
|
|
1097
1146
|
dhParameters: r,
|
|
1098
|
-
onTranslationChanged:
|
|
1147
|
+
onTranslationChanged: f,
|
|
1099
1148
|
children: /* @__PURE__ */ t.jsxs("group", { ...n, name: "Scene", children: [
|
|
1100
1149
|
/* @__PURE__ */ t.jsxs("mesh", { name: "Base", position: [0, 0, 0], children: [
|
|
1101
1150
|
/* @__PURE__ */ t.jsx("sphereGeometry", { args: [0.02, 32, 32] }),
|
|
1102
1151
|
/* @__PURE__ */ t.jsx("meshStandardMaterial", { color: "green", depthTest: !0 })
|
|
1103
1152
|
] }),
|
|
1104
1153
|
/* @__PURE__ */ t.jsx(
|
|
1105
|
-
|
|
1154
|
+
z,
|
|
1106
1155
|
{
|
|
1107
|
-
ref:
|
|
1108
|
-
points: [new
|
|
1156
|
+
ref: d,
|
|
1157
|
+
points: [new V(0, 0, 0), m],
|
|
1109
1158
|
color: "White",
|
|
1110
1159
|
lineWidth: 5
|
|
1111
1160
|
}
|
|
1112
1161
|
),
|
|
1113
|
-
/* @__PURE__ */ t.jsxs("mesh", { ref:
|
|
1162
|
+
/* @__PURE__ */ t.jsxs("mesh", { ref: i, name: "TCP", position: m, children: [
|
|
1114
1163
|
/* @__PURE__ */ t.jsx("sphereGeometry", { args: [0.025, 32, 32] }),
|
|
1115
1164
|
/* @__PURE__ */ t.jsx("meshStandardMaterial", { color: "red", depthTest: !0 })
|
|
1116
1165
|
] })
|
|
@@ -1118,64 +1167,64 @@ function we({
|
|
|
1118
1167
|
}
|
|
1119
1168
|
) });
|
|
1120
1169
|
}
|
|
1121
|
-
const be =
|
|
1170
|
+
const be = O(
|
|
1122
1171
|
({
|
|
1123
1172
|
rapidlyChangingMotionState: e,
|
|
1124
1173
|
modelFromController: r,
|
|
1125
1174
|
dhParameters: n,
|
|
1126
|
-
getModel: l =
|
|
1127
|
-
flangeRef:
|
|
1128
|
-
postModelRender:
|
|
1129
|
-
transparentColor:
|
|
1130
|
-
instanceUrl:
|
|
1131
|
-
...
|
|
1175
|
+
getModel: l = C,
|
|
1176
|
+
flangeRef: i,
|
|
1177
|
+
postModelRender: d,
|
|
1178
|
+
transparentColor: u,
|
|
1179
|
+
instanceUrl: m,
|
|
1180
|
+
...f
|
|
1132
1181
|
}) => {
|
|
1133
|
-
const [
|
|
1134
|
-
|
|
1182
|
+
const [s, p] = S(null), o = T((c) => {
|
|
1183
|
+
p(c);
|
|
1135
1184
|
}, []);
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
}, [
|
|
1139
|
-
const
|
|
1185
|
+
M(() => {
|
|
1186
|
+
s && (u ? xe(s, u) : ye(s));
|
|
1187
|
+
}, [s, u]);
|
|
1188
|
+
const a = /* @__PURE__ */ t.jsx(
|
|
1140
1189
|
we,
|
|
1141
1190
|
{
|
|
1142
1191
|
rapidlyChangingMotionState: e,
|
|
1143
1192
|
dhParameters: n,
|
|
1144
|
-
...
|
|
1193
|
+
...f
|
|
1145
1194
|
}
|
|
1146
1195
|
);
|
|
1147
1196
|
return /* @__PURE__ */ t.jsxs(
|
|
1148
1197
|
ce,
|
|
1149
1198
|
{
|
|
1150
|
-
fallback:
|
|
1151
|
-
onError: (
|
|
1152
|
-
console.warn(
|
|
1199
|
+
fallback: a,
|
|
1200
|
+
onError: (c) => {
|
|
1201
|
+
console.warn(c);
|
|
1153
1202
|
},
|
|
1154
1203
|
children: [
|
|
1155
|
-
/* @__PURE__ */ t.jsx(oe, { fallback:
|
|
1204
|
+
/* @__PURE__ */ t.jsx(oe, { fallback: a, children: /* @__PURE__ */ t.jsx("group", { ref: o, children: /* @__PURE__ */ t.jsx(
|
|
1156
1205
|
je,
|
|
1157
1206
|
{
|
|
1158
1207
|
rapidlyChangingMotionState: e,
|
|
1159
1208
|
dhParameters: n,
|
|
1160
1209
|
children: /* @__PURE__ */ t.jsx(
|
|
1161
|
-
|
|
1210
|
+
he,
|
|
1162
1211
|
{
|
|
1163
1212
|
modelURL: (() => {
|
|
1164
|
-
const
|
|
1165
|
-
if (!
|
|
1166
|
-
const y = new Blob([], { type: "model/gltf-binary" }),
|
|
1167
|
-
return Promise.resolve(URL.createObjectURL(
|
|
1213
|
+
const c = l(r, m);
|
|
1214
|
+
if (!c) {
|
|
1215
|
+
const y = new Blob([], { type: "model/gltf-binary" }), h = new File([y], `${r}.glb`, { type: "model/gltf-binary" });
|
|
1216
|
+
return Promise.resolve(URL.createObjectURL(h));
|
|
1168
1217
|
}
|
|
1169
|
-
return
|
|
1218
|
+
return c;
|
|
1170
1219
|
})(),
|
|
1171
|
-
postModelRender:
|
|
1172
|
-
flangeRef:
|
|
1173
|
-
...
|
|
1220
|
+
postModelRender: d,
|
|
1221
|
+
flangeRef: i,
|
|
1222
|
+
...f
|
|
1174
1223
|
}
|
|
1175
1224
|
)
|
|
1176
1225
|
}
|
|
1177
1226
|
) }) }),
|
|
1178
|
-
/* @__PURE__ */ t.jsx(
|
|
1227
|
+
/* @__PURE__ */ t.jsx(me, {})
|
|
1179
1228
|
]
|
|
1180
1229
|
}
|
|
1181
1230
|
);
|
|
@@ -1183,41 +1232,41 @@ const be = C(
|
|
|
1183
1232
|
);
|
|
1184
1233
|
function ct({
|
|
1185
1234
|
connectedMotionGroup: e,
|
|
1186
|
-
getModel: r =
|
|
1235
|
+
getModel: r = C,
|
|
1187
1236
|
flangeRef: n,
|
|
1188
1237
|
transparentColor: l,
|
|
1189
|
-
postModelRender:
|
|
1190
|
-
...
|
|
1238
|
+
postModelRender: i,
|
|
1239
|
+
...d
|
|
1191
1240
|
}) {
|
|
1192
1241
|
if (!e.dhParameters)
|
|
1193
1242
|
return null;
|
|
1194
|
-
const
|
|
1195
|
-
return
|
|
1243
|
+
const u = e.modelFromController || "";
|
|
1244
|
+
return u && r(u) ? /* @__PURE__ */ t.jsx(
|
|
1196
1245
|
be,
|
|
1197
1246
|
{
|
|
1198
1247
|
rapidlyChangingMotionState: e.rapidlyChangingMotionState,
|
|
1199
|
-
modelFromController:
|
|
1248
|
+
modelFromController: u,
|
|
1200
1249
|
dhParameters: e.dhParameters,
|
|
1201
1250
|
getModel: r,
|
|
1202
1251
|
flangeRef: n,
|
|
1203
1252
|
transparentColor: l,
|
|
1204
|
-
postModelRender:
|
|
1205
|
-
...
|
|
1253
|
+
postModelRender: i,
|
|
1254
|
+
...d
|
|
1206
1255
|
}
|
|
1207
1256
|
) : /* @__PURE__ */ t.jsx(
|
|
1208
1257
|
we,
|
|
1209
1258
|
{
|
|
1210
1259
|
rapidlyChangingMotionState: e.rapidlyChangingMotionState,
|
|
1211
1260
|
dhParameters: e.dhParameters,
|
|
1212
|
-
...
|
|
1261
|
+
...d
|
|
1213
1262
|
}
|
|
1214
1263
|
);
|
|
1215
1264
|
}
|
|
1216
1265
|
const ne = {
|
|
1217
|
-
[
|
|
1218
|
-
[
|
|
1219
|
-
[
|
|
1220
|
-
[
|
|
1266
|
+
[v.Abb]: [0, 0, 0, 0, Math.PI / 2, 0, 0],
|
|
1267
|
+
[v.Fanuc]: [0, 0, 0, 0, -Math.PI / 2, 0, 0],
|
|
1268
|
+
[v.Yaskawa]: [0, 0, 0, 0, -Math.PI / 2, 0, 0],
|
|
1269
|
+
[v.Kuka]: [
|
|
1221
1270
|
0,
|
|
1222
1271
|
-Math.PI / 2,
|
|
1223
1272
|
Math.PI / 2,
|
|
@@ -1226,7 +1275,7 @@ const ne = {
|
|
|
1226
1275
|
0,
|
|
1227
1276
|
0
|
|
1228
1277
|
],
|
|
1229
|
-
[
|
|
1278
|
+
[v.Universalrobots]: [
|
|
1230
1279
|
0,
|
|
1231
1280
|
-Math.PI / 2,
|
|
1232
1281
|
-Math.PI / 2,
|
|
@@ -1240,15 +1289,15 @@ function $e(e) {
|
|
|
1240
1289
|
const [r] = e.split("_");
|
|
1241
1290
|
switch (r) {
|
|
1242
1291
|
case "ABB":
|
|
1243
|
-
return
|
|
1292
|
+
return v.Abb;
|
|
1244
1293
|
case "FANUC":
|
|
1245
|
-
return
|
|
1294
|
+
return v.Fanuc;
|
|
1246
1295
|
case "YASKAWA":
|
|
1247
|
-
return
|
|
1296
|
+
return v.Yaskawa;
|
|
1248
1297
|
case "KUKA":
|
|
1249
|
-
return
|
|
1298
|
+
return v.Kuka;
|
|
1250
1299
|
case "UniversalRobots":
|
|
1251
|
-
return
|
|
1300
|
+
return v.Universalrobots;
|
|
1252
1301
|
default:
|
|
1253
1302
|
return null;
|
|
1254
1303
|
}
|
|
@@ -1257,17 +1306,17 @@ function ut(e, r) {
|
|
|
1257
1306
|
const n = $e(e);
|
|
1258
1307
|
return n && n in ne ? ne[n] : r || null;
|
|
1259
1308
|
}
|
|
1260
|
-
const ft =
|
|
1309
|
+
const ft = O((e) => {
|
|
1261
1310
|
const {
|
|
1262
1311
|
inverseSolver: r,
|
|
1263
1312
|
dhParameters: n,
|
|
1264
1313
|
...l
|
|
1265
|
-
} = e, [
|
|
1266
|
-
|
|
1267
|
-
n.length &&
|
|
1314
|
+
} = e, [i, d] = S(D.RevoluteJoint);
|
|
1315
|
+
M(() => {
|
|
1316
|
+
n.length && d(n[0].type ?? D.RevoluteJoint);
|
|
1268
1317
|
}, [n]);
|
|
1269
|
-
const
|
|
1270
|
-
return
|
|
1318
|
+
const u = F(() => r === null && i === D.RevoluteJoint, [r, i]), m = F(() => r === null && i === D.PrismaticJoint, [r, i]);
|
|
1319
|
+
return F(() => !!r, [r]) || u ? /* @__PURE__ */ t.jsx(ge, { dhParameters: n, ...l }) : m ? /* @__PURE__ */ t.jsx(be, { dhParameters: n, ...l }) : /* @__PURE__ */ t.jsx(t.Fragment, {});
|
|
1271
1320
|
});
|
|
1272
1321
|
export {
|
|
1273
1322
|
ot as C,
|
|
@@ -1282,8 +1331,8 @@ export {
|
|
|
1282
1331
|
be as c,
|
|
1283
1332
|
ge as d,
|
|
1284
1333
|
lt as e,
|
|
1285
|
-
|
|
1334
|
+
C as f,
|
|
1286
1335
|
$e as g,
|
|
1287
1336
|
ut as h
|
|
1288
1337
|
};
|
|
1289
|
-
//# sourceMappingURL=MotionGroupVisualizer-
|
|
1338
|
+
//# sourceMappingURL=MotionGroupVisualizer-BlWkdkaM.js.map
|