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