@wandelbots/wandelbots-js-react-components 5.6.0 → 5.6.1-pr.dev-new-nova-js-client.614.2bc5666
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 +1 -1
- package/dist/3d.cjs +1 -1
- package/dist/3d.js +1 -1
- package/dist/chunks/{MotionGroupVisualizer-Q7ifc7Kd.js → MotionGroupVisualizer-CrJO299j.js} +53 -50
- package/dist/chunks/MotionGroupVisualizer-OZwEAMLA.cjs +1 -0
- package/dist/chunks/{theming-BzdFBdeq.js → theming-0c4oqtVL.js} +1374 -1318
- package/dist/chunks/theming-yiP4EVro.cjs +4 -0
- package/dist/components/jogging/JoggingPanel.d.ts +5 -3
- package/dist/components/jogging/JoggingStore.d.ts +3 -2
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/lib/ConnectedMotionGroup.d.ts +11 -5
- package/dist/lib/JoggerConnection.d.ts +7 -3
- package/dist/lib/MotionStreamConnection.d.ts +10 -4
- package/dist/lib/novaCompat.d.ts +16 -0
- package/package.json +2 -2
- package/dist/chunks/MotionGroupVisualizer-MKZ2-1oY.cjs +0 -1
- package/dist/chunks/theming-D8Twj4Yc.cjs +0 -4
package/README.md
CHANGED
|
@@ -196,7 +196,7 @@ Styling system for consistent robotics applications.
|
|
|
196
196
|
|
|
197
197
|
Components integrate with the Wandelbots Nova ecosystem:
|
|
198
198
|
|
|
199
|
-
- **NovaClient Integration** - Components accept either `
|
|
199
|
+
- **NovaClient Integration** - Components accept either `Nova` instances or URL strings
|
|
200
200
|
- **Real-time Updates** - WebSocket connections for live robot state updates
|
|
201
201
|
- **Motion Group Management** - Direct integration with `ConnectedMotionGroup` objects
|
|
202
202
|
- **State Synchronization** - Automatic state management with MobX reactivity
|
package/dist/3d.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/MotionGroupVisualizer-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/MotionGroupVisualizer-OZwEAMLA.cjs");exports.CollisionSceneRenderer=e.CollisionSceneRenderer;exports.LinearAxis=e.LinearAxis;exports.MANUFACTURER_HOME_CONFIGS=e.MANUFACTURER_HOME_CONFIGS;exports.MotionGroupVisualizer=e.MotionGroupVisualizer;exports.PresetEnvironment=e.PresetEnvironment;exports.Robot=e.Robot;exports.RobotCard=e.RobotCard;exports.SafetyZonesRenderer=e.SafetyZonesRenderer;exports.SupportedLinearAxis=e.SupportedLinearAxis;exports.SupportedRobot=e.SupportedRobot;exports.TrajectoryRenderer=e.TrajectoryRenderer;exports.defaultAxisConfig=e.defaultAxisConfig;exports.defaultGetModel=e.defaultGetModel;exports.extractManufacturer=e.extractManufacturer;exports.getDefaultHomeConfig=e.getDefaultHomeConfig;
|
package/dist/3d.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as o, L as r, M as s, h as t, P as n, b as i, R as d, S as f, c as u, f as R, T as l, a as C, d as p, e as M, g as S } from "./chunks/MotionGroupVisualizer-
|
|
1
|
+
import { C as o, L as r, M as s, h as t, P as n, b as i, R as d, S as f, c as u, f as R, T as l, a as C, d as p, e as M, g as S } from "./chunks/MotionGroupVisualizer-CrJO299j.js";
|
|
2
2
|
export {
|
|
3
3
|
o as CollisionSceneRenderer,
|
|
4
4
|
r as LinearAxis,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as r, jsxs as b, Fragment as
|
|
1
|
+
import { jsx as r, jsxs as b, Fragment as C } from "react/jsx-runtime";
|
|
2
2
|
import * as g from "three";
|
|
3
3
|
import { Matrix4 as R, Vector3 as k, Quaternion as W } from "three";
|
|
4
4
|
import { ConvexGeometry as se, RoundedBoxGeometry as ke } from "three-stdlib";
|
|
5
|
-
import Ge, { useMemo as
|
|
6
|
-
import { d as Le, v as
|
|
7
|
-
import { Environment as
|
|
5
|
+
import Ge, { useMemo as P, useRef as _, useEffect as T, useState as G, useCallback as L, Suspense as ae } from "react";
|
|
6
|
+
import { d as Le, v as Ie, o as Pe, e as J } from "./externalizeComponent-EDymnaGR.js";
|
|
7
|
+
import { Environment as Ae, Lightformer as I, Line as $, useGLTF as Fe, Bounds as Z } from "@react-three/drei";
|
|
8
8
|
import { useTheme as De } from "@mui/material/styles";
|
|
9
9
|
import v from "@mui/material/Box";
|
|
10
10
|
import Q from "@mui/material/Button";
|
|
@@ -15,9 +15,9 @@ import { useThree as le, useFrame as ce, Canvas as te } from "@react-three/fiber
|
|
|
15
15
|
import { observer as Ve } from "mobx-react-lite";
|
|
16
16
|
import { useTranslation as Ee } from "react-i18next";
|
|
17
17
|
import { V as ue, c as fe, b as re } from "./interpolation-DG8VTxzS.js";
|
|
18
|
-
import {
|
|
18
|
+
import { Nova as Ue, Manufacturer as M, JointTypeEnum as U } from "@wandelbots/nova-js/v2";
|
|
19
19
|
import { ErrorBoundary as pe } from "react-error-boundary";
|
|
20
|
-
function
|
|
20
|
+
function Ce(e) {
|
|
21
21
|
switch (e.shape_type) {
|
|
22
22
|
case "convex_hull":
|
|
23
23
|
return new se(
|
|
@@ -71,7 +71,7 @@ function Je({
|
|
|
71
71
|
l[2]
|
|
72
72
|
).divideScalar(1e3),
|
|
73
73
|
rotation: new g.Euler(i[0], i[1], i[2], "XYZ"),
|
|
74
|
-
geometry:
|
|
74
|
+
geometry: Ce(n.shape),
|
|
75
75
|
children: t
|
|
76
76
|
}
|
|
77
77
|
);
|
|
@@ -106,13 +106,13 @@ function wt({
|
|
|
106
106
|
) });
|
|
107
107
|
}
|
|
108
108
|
function ne() {
|
|
109
|
-
return /* @__PURE__ */ r(
|
|
109
|
+
return /* @__PURE__ */ r(Ae, { frames: 1, children: /* @__PURE__ */ r(We, {}) });
|
|
110
110
|
}
|
|
111
111
|
const Be = [2, 0, 2, 0, 2, 0, 2, 0];
|
|
112
112
|
function We({ positions: e = Be }) {
|
|
113
|
-
return /* @__PURE__ */ b(
|
|
113
|
+
return /* @__PURE__ */ b(C, { children: [
|
|
114
114
|
/* @__PURE__ */ r(
|
|
115
|
-
|
|
115
|
+
I,
|
|
116
116
|
{
|
|
117
117
|
intensity: 5,
|
|
118
118
|
"rotation-x": Math.PI / 2,
|
|
@@ -121,7 +121,7 @@ function We({ positions: e = Be }) {
|
|
|
121
121
|
}
|
|
122
122
|
),
|
|
123
123
|
/* @__PURE__ */ r("group", { rotation: [0, 0.5, 0], children: /* @__PURE__ */ r("group", { children: e.map((n, t) => /* @__PURE__ */ r(
|
|
124
|
-
|
|
124
|
+
I,
|
|
125
125
|
{
|
|
126
126
|
form: "circle",
|
|
127
127
|
intensity: 5,
|
|
@@ -132,7 +132,7 @@ function We({ positions: e = Be }) {
|
|
|
132
132
|
t
|
|
133
133
|
)) }) }),
|
|
134
134
|
/* @__PURE__ */ r(
|
|
135
|
-
|
|
135
|
+
I,
|
|
136
136
|
{
|
|
137
137
|
intensity: 40,
|
|
138
138
|
"rotation-y": Math.PI / 2,
|
|
@@ -141,7 +141,7 @@ function We({ positions: e = Be }) {
|
|
|
141
141
|
}
|
|
142
142
|
),
|
|
143
143
|
/* @__PURE__ */ r(
|
|
144
|
-
|
|
144
|
+
I,
|
|
145
145
|
{
|
|
146
146
|
intensity: 20,
|
|
147
147
|
"rotation-y": -Math.PI,
|
|
@@ -150,7 +150,7 @@ function We({ positions: e = Be }) {
|
|
|
150
150
|
}
|
|
151
151
|
),
|
|
152
152
|
/* @__PURE__ */ r(
|
|
153
|
-
|
|
153
|
+
I,
|
|
154
154
|
{
|
|
155
155
|
"rotation-y": Math.PI / 2,
|
|
156
156
|
position: [-5, -1, -1],
|
|
@@ -159,7 +159,7 @@ function We({ positions: e = Be }) {
|
|
|
159
159
|
}
|
|
160
160
|
),
|
|
161
161
|
/* @__PURE__ */ r(
|
|
162
|
-
|
|
162
|
+
I,
|
|
163
163
|
{
|
|
164
164
|
"rotation-y": -Math.PI / 2,
|
|
165
165
|
position: [10, 1, 0],
|
|
@@ -168,7 +168,7 @@ function We({ positions: e = Be }) {
|
|
|
168
168
|
}
|
|
169
169
|
),
|
|
170
170
|
/* @__PURE__ */ r(
|
|
171
|
-
|
|
171
|
+
I,
|
|
172
172
|
{
|
|
173
173
|
form: "ring",
|
|
174
174
|
color: "white",
|
|
@@ -194,7 +194,7 @@ function bt({
|
|
|
194
194
|
dhParameters: n,
|
|
195
195
|
...t
|
|
196
196
|
}) {
|
|
197
|
-
const l =
|
|
197
|
+
const l = P(
|
|
198
198
|
() => Le(n ?? []),
|
|
199
199
|
[n]
|
|
200
200
|
), i = (c, o) => {
|
|
@@ -242,7 +242,7 @@ function bt({
|
|
|
242
242
|
case "convex_hull": {
|
|
243
243
|
const p = (o == null ? void 0 : o.shape).vertices.map(
|
|
244
244
|
(w) => new g.Vector3(w[0] / 1e3, w[1] / 1e3, w[2] / 1e3)
|
|
245
|
-
), m =
|
|
245
|
+
), m = Ie(p);
|
|
246
246
|
if (m.isCoplanar && m.normal) {
|
|
247
247
|
const x = new g.Vector3().addVectors(
|
|
248
248
|
p[0],
|
|
@@ -271,11 +271,11 @@ function bt({
|
|
|
271
271
|
* Basically a rounded box with a rectangular cross-section.
|
|
272
272
|
*/
|
|
273
273
|
case "rectangular_capsule": {
|
|
274
|
-
const p = o.shape, m = p.radius / 1e3, w = p.sphere_center_distance_x / 1e3, x = p.sphere_center_distance_y / 1e3,
|
|
274
|
+
const p = o.shape, m = p.radius / 1e3, w = p.sphere_center_distance_x / 1e3, x = p.sphere_center_distance_y / 1e3, A = m * 2;
|
|
275
275
|
h = /* @__PURE__ */ r(
|
|
276
276
|
"primitive",
|
|
277
277
|
{
|
|
278
|
-
object: new ke(w, x,
|
|
278
|
+
object: new ke(w, x, A, 2, m),
|
|
279
279
|
attach: "geometry"
|
|
280
280
|
}
|
|
281
281
|
);
|
|
@@ -292,7 +292,7 @@ function bt({
|
|
|
292
292
|
{
|
|
293
293
|
renderOrder: c,
|
|
294
294
|
position: y,
|
|
295
|
-
quaternion:
|
|
295
|
+
quaternion: Pe(s),
|
|
296
296
|
children: [
|
|
297
297
|
h,
|
|
298
298
|
/* @__PURE__ */ r("meshStandardMaterial", { ...a, polygonOffsetFactor: -c })
|
|
@@ -300,7 +300,7 @@ function bt({
|
|
|
300
300
|
},
|
|
301
301
|
`safety-zone-${o.shape.shape_type}-${c}`
|
|
302
302
|
);
|
|
303
|
-
}, f =
|
|
303
|
+
}, f = P(() => Object.values(e ?? {}).map(
|
|
304
304
|
(c, o) => i(o, c)
|
|
305
305
|
), [e, l]);
|
|
306
306
|
return /* @__PURE__ */ r("group", { ...t, children: f });
|
|
@@ -334,7 +334,7 @@ async function j(e, n) {
|
|
|
334
334
|
return B.get(e);
|
|
335
335
|
const t = (async () => {
|
|
336
336
|
var c;
|
|
337
|
-
const l = n || "", i = new
|
|
337
|
+
const l = n || "", i = new Ue({ instanceUrl: l }), f = i.api.motionGroupModels;
|
|
338
338
|
(c = f.axios) != null && c.interceptors && f.axios.interceptors.request.use((o) => {
|
|
339
339
|
var y;
|
|
340
340
|
return (y = o.url) != null && y.includes("/glb") && (o.responseType = "blob"), o;
|
|
@@ -386,7 +386,7 @@ function ye({
|
|
|
386
386
|
onRotationChanged: t,
|
|
387
387
|
children: l
|
|
388
388
|
}) {
|
|
389
|
-
const i =
|
|
389
|
+
const i = _([]), f = _(null), { invalidate: c } = le(), o = _(e);
|
|
390
390
|
o.current = e, T(() => {
|
|
391
391
|
const a = e.joint_position.filter(
|
|
392
392
|
(u) => u !== void 0
|
|
@@ -440,7 +440,7 @@ function Ye({
|
|
|
440
440
|
dhParameters: n,
|
|
441
441
|
...t
|
|
442
442
|
}) {
|
|
443
|
-
const l = new R(), i =
|
|
443
|
+
const l = new R(), i = _([]), f = _([]);
|
|
444
444
|
Ge.useEffect(() => {
|
|
445
445
|
i.current = new Array(n.length).fill(null), f.current = new Array(n.length).fill(null);
|
|
446
446
|
}, [n.length]);
|
|
@@ -658,7 +658,7 @@ const be = (e, n) => {
|
|
|
658
658
|
T(() => {
|
|
659
659
|
s && (c ? be(s, c) : xe(s));
|
|
660
660
|
}, [s, c]);
|
|
661
|
-
const u =
|
|
661
|
+
const u = P(() => {
|
|
662
662
|
const p = l(n, o);
|
|
663
663
|
if (!p)
|
|
664
664
|
throw new Error(
|
|
@@ -741,12 +741,12 @@ const Rt = J(
|
|
|
741
741
|
className: h
|
|
742
742
|
}) => {
|
|
743
743
|
var Y;
|
|
744
|
-
const a = De(), { t: u } = Ee(), [d, p] = G(!1), m =
|
|
744
|
+
const a = De(), { t: u } = Ee(), [d, p] = G(!1), m = _(null), w = _(null), [x, A] = G(!1), [F, Te] = G({ width: 400, height: 600 }), [ze, Se] = G(0);
|
|
745
745
|
T(() => {
|
|
746
746
|
const E = () => {
|
|
747
747
|
if (w.current) {
|
|
748
748
|
const { offsetWidth: X, offsetHeight: K } = w.current;
|
|
749
|
-
|
|
749
|
+
A(X > K), Te({ width: X, height: K });
|
|
750
750
|
}
|
|
751
751
|
};
|
|
752
752
|
E();
|
|
@@ -786,7 +786,7 @@ const Rt = J(
|
|
|
786
786
|
backgroundImage: "none"
|
|
787
787
|
// Override any gradient from elevation
|
|
788
788
|
},
|
|
789
|
-
children: x ? /* @__PURE__ */ b(
|
|
789
|
+
children: x ? /* @__PURE__ */ b(C, { children: [
|
|
790
790
|
/* @__PURE__ */ r(
|
|
791
791
|
v,
|
|
792
792
|
{
|
|
@@ -942,7 +942,7 @@ const Rt = J(
|
|
|
942
942
|
]
|
|
943
943
|
}
|
|
944
944
|
)
|
|
945
|
-
] }) : /* @__PURE__ */ r(
|
|
945
|
+
] }) : /* @__PURE__ */ r(C, { children: /* @__PURE__ */ b(
|
|
946
946
|
v,
|
|
947
947
|
{
|
|
948
948
|
sx: {
|
|
@@ -1009,7 +1009,7 @@ const Rt = J(
|
|
|
1009
1009
|
}
|
|
1010
1010
|
),
|
|
1011
1011
|
/* @__PURE__ */ b(v, { children: [
|
|
1012
|
-
!V && s && /* @__PURE__ */ b(
|
|
1012
|
+
!V && s && /* @__PURE__ */ b(C, { children: [
|
|
1013
1013
|
/* @__PURE__ */ r(s, {}),
|
|
1014
1014
|
/* @__PURE__ */ r(
|
|
1015
1015
|
z,
|
|
@@ -1070,7 +1070,7 @@ function ve({
|
|
|
1070
1070
|
onTranslationChanged: t,
|
|
1071
1071
|
children: l
|
|
1072
1072
|
}) {
|
|
1073
|
-
const i =
|
|
1073
|
+
const i = _([]), f = _([]), c = _(null), { invalidate: o } = le();
|
|
1074
1074
|
T(() => {
|
|
1075
1075
|
const a = e.joint_position.filter(
|
|
1076
1076
|
(u) => u !== void 0
|
|
@@ -1125,7 +1125,7 @@ function Me({
|
|
|
1125
1125
|
dhParameters: n,
|
|
1126
1126
|
...t
|
|
1127
1127
|
}) {
|
|
1128
|
-
const l = new R(), i =
|
|
1128
|
+
const l = new R(), i = _(null), f = _(null);
|
|
1129
1129
|
function c(s) {
|
|
1130
1130
|
const h = new R();
|
|
1131
1131
|
for (let p = 0; p < n.length; p++) {
|
|
@@ -1148,14 +1148,14 @@ function Me({
|
|
|
1148
1148
|
l.identity();
|
|
1149
1149
|
let a = new k();
|
|
1150
1150
|
for (let m = 0; m < n.length; m++) {
|
|
1151
|
-
const w = h[m] ?? 0, x = n[m],
|
|
1151
|
+
const w = h[m] ?? 0, x = n[m], A = new R().makeRotationY(x.theta).multiply(
|
|
1152
1152
|
new R().makeTranslation(
|
|
1153
1153
|
x.a / 1e3,
|
|
1154
1154
|
(x.d + w * (x.reverse_rotation_direction ? -1 : 1)) / 1e3,
|
|
1155
1155
|
0
|
|
1156
1156
|
)
|
|
1157
1157
|
).multiply(new R().makeRotationX(x.alpha));
|
|
1158
|
-
l.multiply(
|
|
1158
|
+
l.multiply(A);
|
|
1159
1159
|
}
|
|
1160
1160
|
const u = new k(), d = new W(), p = new k();
|
|
1161
1161
|
if (l.decompose(u, d, p), a = u, i.current && i.current.position.set(
|
|
@@ -1302,10 +1302,10 @@ function Mt({
|
|
|
1302
1302
|
);
|
|
1303
1303
|
}
|
|
1304
1304
|
const ie = {
|
|
1305
|
-
[
|
|
1306
|
-
[
|
|
1307
|
-
[
|
|
1308
|
-
[
|
|
1305
|
+
[M.Abb]: [0, 0, 0, 0, Math.PI / 2, 0, 0],
|
|
1306
|
+
[M.Fanuc]: [0, 0, 0, 0, -Math.PI / 2, 0, 0],
|
|
1307
|
+
[M.Yaskawa]: [0, 0, 0, 0, -Math.PI / 2, 0, 0],
|
|
1308
|
+
[M.Kuka]: [
|
|
1309
1309
|
0,
|
|
1310
1310
|
-Math.PI / 2,
|
|
1311
1311
|
Math.PI / 2,
|
|
@@ -1314,7 +1314,7 @@ const ie = {
|
|
|
1314
1314
|
0,
|
|
1315
1315
|
0
|
|
1316
1316
|
],
|
|
1317
|
-
[
|
|
1317
|
+
[M.Universalrobots]: [
|
|
1318
1318
|
0,
|
|
1319
1319
|
-Math.PI / 2,
|
|
1320
1320
|
-Math.PI / 2,
|
|
@@ -1322,21 +1322,24 @@ const ie = {
|
|
|
1322
1322
|
Math.PI / 2,
|
|
1323
1323
|
-Math.PI / 2,
|
|
1324
1324
|
0
|
|
1325
|
-
]
|
|
1325
|
+
],
|
|
1326
|
+
[M.Staubli]: [0, -Math.PI / 2, Math.PI / 2, 0, 0, 0, 0]
|
|
1326
1327
|
};
|
|
1327
1328
|
function Qe(e) {
|
|
1328
1329
|
const [n] = e.split("_");
|
|
1329
1330
|
switch (n) {
|
|
1330
1331
|
case "ABB":
|
|
1331
|
-
return
|
|
1332
|
+
return M.Abb;
|
|
1332
1333
|
case "FANUC":
|
|
1333
|
-
return
|
|
1334
|
+
return M.Fanuc;
|
|
1334
1335
|
case "YASKAWA":
|
|
1335
|
-
return
|
|
1336
|
+
return M.Yaskawa;
|
|
1336
1337
|
case "KUKA":
|
|
1337
|
-
return
|
|
1338
|
+
return M.Kuka;
|
|
1338
1339
|
case "UniversalRobots":
|
|
1339
|
-
return
|
|
1340
|
+
return M.Universalrobots;
|
|
1341
|
+
case "STAUBLI":
|
|
1342
|
+
return M.Staubli;
|
|
1340
1343
|
default:
|
|
1341
1344
|
return null;
|
|
1342
1345
|
}
|
|
@@ -1347,13 +1350,13 @@ function _t(e, n) {
|
|
|
1347
1350
|
}
|
|
1348
1351
|
const Tt = J((e) => {
|
|
1349
1352
|
const { inverseSolver: n, dhParameters: t, ...l } = e, [i, f] = G(
|
|
1350
|
-
|
|
1353
|
+
U.RevoluteJoint
|
|
1351
1354
|
);
|
|
1352
1355
|
T(() => {
|
|
1353
|
-
t.length && f(t[0].type ??
|
|
1356
|
+
t.length && f(t[0].type ?? U.RevoluteJoint);
|
|
1354
1357
|
}, [t]);
|
|
1355
|
-
const c =
|
|
1356
|
-
return
|
|
1358
|
+
const c = P(() => n === null && i === U.RevoluteJoint, [n, i]), o = P(() => n === null && i === U.PrismaticJoint, [n, i]);
|
|
1359
|
+
return P(() => !!n, [n]) || c ? /* @__PURE__ */ r(Re, { dhParameters: t, ...l }) : o ? /* @__PURE__ */ r(_e, { dhParameters: t, ...l }) : null;
|
|
1357
1360
|
});
|
|
1358
1361
|
export {
|
|
1359
1362
|
wt as C,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),g=require("three"),V=require("three-stdlib"),d=require("react"),_=require("./externalizeComponent-OO4jcrz5.cjs"),M=require("@react-three/drei"),pe=require("@mui/material/styles"),v=require("@mui/material/Box"),Y=require("@mui/material/Button"),he=require("@mui/material/Card"),Q=require("@mui/material/Divider"),X=require("@mui/material/Typography"),T=require("@react-three/fiber"),me=require("mobx-react-lite"),xe=require("react-i18next"),L=require("./interpolation-C9sLsved.cjs"),R=require("@wandelbots/nova-js/v2"),K=require("react-error-boundary");function ye(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return n.default=e,Object.freeze(n)}const j=ye(g);function ge(e){switch(e.shape_type){case"convex_hull":return new V.ConvexGeometry(e.vertices.map(r=>new j.Vector3(r[0]/1e3,r[1]/1e3,r[2]/1e3)));case"box":return new j.BoxGeometry(e.size_x/1e3,e.size_y/1e3,e.size_z/1e3);case"sphere":return new j.SphereGeometry(e.radius/1e3);case"capsule":return new j.CapsuleGeometry(e.radius/1e3,e.cylinder_height/1e3);case"cylinder":return new j.CylinderGeometry(e.radius/1e3,e.radius/1e3,e.height/1e3);case"rectangle":return new j.BoxGeometry(e.size_x/1e3,e.size_y/1e3,0);default:return console.warn(`${e.shape_type} is not supported`),new j.BufferGeometry}}function je({name:e,collider:n,children:r}){var f,u;const o=((f=n.pose)==null?void 0:f.position)??[0,0,0],i=((u=n.pose)==null?void 0:u.orientation)??[0,0,0];return n.margin&&console.warn(`${e} margin is not supported`),t.jsx("mesh",{name:e,position:new j.Vector3(o[0],o[1],o[2]).divideScalar(1e3),rotation:new j.Euler(i[0],i[1],i[2],"XYZ"),geometry:ge(n.shape),children:r})}function be({name:e,colliders:n,meshChildrenProvider:r,...o}){return t.jsx("group",{name:e,...o,children:Object.entries(n).map(([i,f])=>t.jsx(je,{name:i,collider:f,children:r(i,f)},i))})}function we({scene:e,meshChildrenProvider:n}){const r=e.colliders;return t.jsx("group",{children:r&&t.jsx(be,{meshChildrenProvider:n,colliders:r})})}function O(){return t.jsx(M.Environment,{frames:1,children:t.jsx(Me,{})})}const Re=[2,0,2,0,2,0,2,0];function Me({positions:e=Re}){return t.jsxs(t.Fragment,{children:[t.jsx(M.Lightformer,{intensity:5,"rotation-x":Math.PI/2,position:[0,5,-9],scale:[10,10,1]}),t.jsx("group",{rotation:[0,.5,0],children:t.jsx("group",{children:e.map((n,r)=>t.jsx(M.Lightformer,{form:"circle",intensity:5,rotation:[Math.PI/2,0,0],position:[n,4,r*4],scale:[3,1,1]},r))})}),t.jsx(M.Lightformer,{intensity:40,"rotation-y":Math.PI/2,position:[-5,1,-1],scale:[20,.1,1]}),t.jsx(M.Lightformer,{intensity:20,"rotation-y":-Math.PI,position:[-5,-2,-1],scale:[20,.1,1]}),t.jsx(M.Lightformer,{"rotation-y":Math.PI/2,position:[-5,-1,-1],scale:[20,.5,1],intensity:5}),t.jsx(M.Lightformer,{"rotation-y":-Math.PI/2,position:[10,1,0],scale:[20,1,1],intensity:10}),t.jsx(M.Lightformer,{form:"ring",color:"white",intensity:5,scale:10,position:[-15,4,-18],target:[0,0,0]})]})}const Z={attach:"material",color:"#009f4d",opacity:.2,depthTest:!1,depthWrite:!1,transparent:!0,polygonOffset:!0};function ve({safetyZones:e,dhParameters:n,...r}){const o=d.useMemo(()=>_.dhParametersToPlaneSize(n??[]),[n]),i=(u,s)=>{var l,h;if(!((l=s==null?void 0:s.pose)!=null&&l.position)||!((h=s==null?void 0:s.pose)!=null&&h.orientation))return null;const y=new j.Vector3(s.pose.position[0]/1e3,s.pose.position[1]/1e3,s.pose.position[2]/1e3),a=new j.Vector3(s.pose.orientation[0],s.pose.orientation[1],s.pose.orientation[2]);let m;const c=s.shape.shape_type==="plane"?{...Z,side:j.DoubleSide}:{...Z,side:j.FrontSide};switch(s.shape.shape_type){case"plane":m=t.jsx("planeGeometry",{args:[o,o]});break;case"sphere":{const p=(s==null?void 0:s.shape).radius/1e3;m=t.jsx("sphereGeometry",{args:[p]});break}case"capsule":{const p=(s==null?void 0:s.shape).radius/1e3,x=(s==null?void 0:s.shape).cylinder_height/1e3;m=t.jsx("capsuleGeometry",{args:[p,x]});break}case"convex_hull":{const p=(s==null?void 0:s.shape).vertices.map(b=>new j.Vector3(b[0]/1e3,b[1]/1e3,b[2]/1e3)),x=_.verticesToCoplanarity(p);if(x.isCoplanar&&x.normal){const w=new j.Vector3().addVectors(p[0],x.normal.multiplyScalar(1e-4));p.push(w)}try{m=t.jsx("primitive",{object:new V.ConvexGeometry(p),attach:"geometry"})}catch(b){return console.log("Error creating ConvexGeometry:",b),null}break}case"rectangular_capsule":{const p=s.shape,x=p.radius/1e3,b=p.sphere_center_distance_x/1e3,w=p.sphere_center_distance_y/1e3,k=x*2;m=t.jsx("primitive",{object:new V.RoundedBoxGeometry(b,w,k,2,x),attach:"geometry"});break}default:console.warn("Unsupported safety zone shape type:",s.shape.shape_type),m=null}return t.jsxs("mesh",{renderOrder:u,position:y,quaternion:_.orientationToQuaternion(a),children:[m,t.jsx("meshStandardMaterial",{...c,polygonOffsetFactor:-u})]},`safety-zone-${s.shape.shape_type}-${u}`)},f=d.useMemo(()=>Object.values(e??{}).map((u,s)=>i(s,u)),[e,o]);return t.jsx("group",{...r,children:f})}function Se({trajectory:e,...n}){const r=(e==null?void 0:e.map(o=>{if(o.position&&o.position.length>=3){const[i,f,u]=o.position;if(Number.isFinite(i)&&Number.isFinite(f)&&Number.isFinite(u))return new j.Vector3(i/1e3,u/1e3,-f/1e3)}return null}).filter(o=>o!==null))||[];return t.jsx("group",{...n,children:r.length>0&&t.jsx(M.Line,{points:r,lineWidth:3,polygonOffset:!0,polygonOffsetFactor:10,polygonOffsetUnits:10})})}const F=new Map;async function E(e,n){if(F.has(e))return F.get(e);const r=(async()=>{var u;const o=n||"",i=new R.Nova({instanceUrl:o}),f=i.api.motionGroupModels;(u=f.axios)!=null&&u.interceptors&&f.axios.interceptors.request.use(s=>{var y;return(y=s.url)!=null&&y.includes("/glb")&&(s.responseType="blob"),s});try{const s=await i.api.motionGroupModels.getMotionGroupGlbModel(e);return URL.createObjectURL(s)}catch(s){throw console.error("Failed to fetch model:",s),s}})();return F.set(e,r),r}function z(e){function n(r){return r.children.length===0?[r]:[r,...r.children.flatMap(o=>n(o))]}return n(e).filter(r=>te(r))}function ee(e){return e.name.endsWith("_FLG")}function te(e){return/_J[0-9]+$/.test(e.name)}function _e(e,n){let r;function o(i){if(ee(i)){if(r)throw Error(`Found multiple flange groups in robot model ${n}; first ${r.name} then ${i.name}. Only one _FLG group is allowed.`);r=i}te(i),i.children.map(o)}if(o(e.scene),!r)throw Error(`No flange group found in robot model ${n}. Flange must be identified with a name ending in _FLG.`);return{gltf:e}}function re({rapidlyChangingMotionState:e,dhParameters:n,onRotationChanged:r,children:o}){const i=d.useRef([]),f=d.useRef(null),{invalidate:u}=T.useThree(),s=d.useRef(e);s.current=e,d.useEffect(()=>{const c=e.joint_position.filter(l=>l!==void 0);return f.current=new L.ValueInterpolator(c,{tension:120,friction:20,threshold:.001}),()=>{var l;(l=f.current)==null||l.destroy()}},[]),T.useFrame((c,l)=>{if(f.current){const h=f.current.update(l);a(),h||u()}});function y(c){c&&(i.current=z(c),a(),u())}function a(){var l;const c=((l=f.current)==null?void 0:l.getCurrentValues())||[];if(r)r(i.current,c);else for(const[h,p]of i.current.entries()){const x=n[h],b=x.theta||0,w=x.reverse_rotation_direction?-1:1;p.rotation.y=w*(c[h]||0)+b}}function m(c){var h;const l=c.joint_position.filter(p=>p!==void 0);(h=f.current)==null||h.setTarget(l),u()}return L.useAutorun(()=>{m(s.current)}),d.useEffect(()=>{m(e)},[e]),t.jsx("group",{ref:y,children:o})}const Te="line",Le="mesh";function ke({rapidlyChangingMotionState:e,dhParameters:n,...r}){const o=new g.Matrix4,i=d.useRef([]),f=d.useRef([]);d.useEffect(()=>{i.current=new Array(n.length).fill(null),f.current=new Array(n.length).fill(null)},[n.length]);function u(a,m){const c=new g.Vector3,l=new g.Quaternion,h=new g.Vector3;o.decompose(c,l,h);const p=c.clone(),x=new g.Matrix4().makeRotationY(a.theta+m*(a.reverse_rotation_direction?-1:1)).multiply(new g.Matrix4().makeTranslation(0,a.d/1e3,0)).multiply(new g.Matrix4().makeTranslation(a.a/1e3,0,0)).multiply(new g.Matrix4().makeRotationX(a.alpha));return o.multiply(x),o.decompose(c,l,h),{a:p,b:c}}function s(a,m,c,l){if(!n)return;const h=n[a];if(!h)return;const{a:p,b:x}=u(h,l);m.geometry.setPositions([p.toArray(),x.toArray()].flat()),c.position.set(x.x,x.y,x.z)}function y(a,m){o.identity();for(let c=0;c<Math.min(a.length,m.length);c++){const l=i.current[c],h=f.current[c];l&&h&&s(c,l,h,m[c])}}return t.jsx(re,{rapidlyChangingMotionState:e,dhParameters:n,onRotationChanged:y,children:t.jsxs("group",{...r,name:"Scene",children:[t.jsxs("mesh",{children:[t.jsx("sphereGeometry",{args:[.01,32,32]}),t.jsx("meshStandardMaterial",{color:"black",depthTest:!0})]}),n==null?void 0:n.map((a,m)=>{const{a:c,b:l}=u(a,e.joint_position[m]??0),h=`dhrobot_J0${m}`;return t.jsxs("group",{name:h,children:[t.jsx(M.Line,{ref:p=>{i.current[m]=p},name:Te,points:[c,l],color:"white",lineWidth:5}),t.jsxs("mesh",{ref:p=>{f.current[m]=p},name:Le,position:l,children:[t.jsx("sphereGeometry",{args:[.01,32,32]}),t.jsx("meshStandardMaterial",{color:"black",depthTest:!0})]},`mesh_${m}`)]},h)})]})})}const Ee=console.warn;function ne(){return d.useEffect(()=>{console.warn=e=>{e!=="Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"&&Ee(e)}},[]),null}function Ge(e){return e.type==="Mesh"}function Ae({url:e,flangeRef:n,postModelRender:r,...o}){const i=M.useGLTF(e),u=_e(i,"robot.glb").gltf,s=d.useCallback(a=>{a&&r&&r()},[r]);function y(a){try{return Ge(a)?a.geometry?t.jsx("mesh",{name:a.name,geometry:a.geometry,material:a.material,position:a.position,rotation:a.rotation},a.uuid):t.jsx("group",{name:a.name,position:a.position,rotation:a.rotation},a.uuid):t.jsx("group",{name:a.name,position:a.position,rotation:a.rotation,ref:ee(a)?n:void 0,children:a.children.map(y)},a.uuid)}catch(m){return console.warn("Error rendering node",a.name,m),null}}return t.jsx("group",{...o,dispose:null,ref:s,children:y(u.scene)})}function se({modelURL:e,flangeRef:n,postModelRender:r,...o}){const[i,f]=d.useState(null);return d.useEffect(()=>{let u=!1;return(async()=>{try{const y=typeof e=="string"?e:await e;u||f(a=>a===y?a:y)}catch(y){console.error("Failed to resolve model URL:",y)}})(),()=>{u=!0}},[e]),i?t.jsx(Ae,{url:i,flangeRef:n,postModelRender:r,...o}):null}const oe=(e,n)=>{e.userData.isGhost||(e.traverse(r=>{if(r instanceof j.Mesh){r.material instanceof j.Material&&(r.material.colorWrite=!1);const o=r.clone(),i=r.clone();o.material=new j.MeshStandardMaterial({depthTest:!0,depthWrite:!0,colorWrite:!1,polygonOffset:!0,polygonOffsetFactor:-1,side:j.DoubleSide}),o.userData.isGhost=!0,i.material=new j.MeshStandardMaterial({color:n,opacity:.3,depthTest:!0,depthWrite:!1,transparent:!0,polygonOffset:!0,polygonOffsetFactor:-2,side:j.DoubleSide}),i.userData.isGhost=!0,r.parent&&(r.parent.add(o),r.parent.add(i))}}),e.userData.isGhost=!0)},ie=e=>{if(!e.userData.isGhost)return;const n=[];e.traverse(r=>{var o;r instanceof j.Mesh&&((o=r.userData)!=null&&o.isGhost?n.push(r):r.material instanceof j.Material&&(r.material.colorWrite=!0))}),n.forEach(r=>{r.parent&&r.parent.remove(r)}),e.userData.isGhost=!1},q=_.externalizeComponent(({rapidlyChangingMotionState:e,modelFromController:n,dhParameters:r,getModel:o=E,flangeRef:i,postModelRender:f,transparentColor:u,instanceUrl:s,...y})=>{const[a,m]=d.useState(null),c=d.useCallback(p=>{m(p)},[]);d.useEffect(()=>{a&&(u?oe(a,u):ie(a))},[a,u]);const l=d.useMemo(()=>{const p=o(n,s);if(!p)throw new Error(`No model found for robot "${n}". Ensure the model is available or provide a custom getModel function.`);return p},[n,s,o]),h=t.jsx(ke,{rapidlyChangingMotionState:e,dhParameters:r,...y});return t.jsxs(K.ErrorBoundary,{fallback:h,onError:p=>{console.warn(p)},children:[t.jsx(d.Suspense,{fallback:h,children:t.jsx("group",{ref:c,children:t.jsx(re,{rapidlyChangingMotionState:e,dhParameters:r,children:t.jsx(se,{modelURL:l,postModelRender:f,flangeRef:i,...y})})})}),t.jsx(ne,{})]})});function ae({connectedMotionGroup:e,getModel:n=E,flangeRef:r,transparentColor:o,postModelRender:i,...f}){return e.dhParameters?t.jsx(q,{rapidlyChangingMotionState:e.rapidlyChangingMotionState,modelFromController:e.modelFromController||"",dhParameters:e.dhParameters,getModel:n,flangeRef:r,transparentColor:o,postModelRender:i,...f}):null}const Ce=_.externalizeComponent(me.observer(({robotName:e,programState:n,safetyState:r,operationMode:o,driveToHomeEnabled:i=!1,onDriveToHomePress:f,onDriveToHomeRelease:u,connectedMotionGroup:s,robotComponent:y=ae,customContentComponent:a,className:m})=>{var N;const c=pe.useTheme(),{t:l}=xe.useTranslation(),[h,p]=d.useState(!1),x=d.useRef(null),b=d.useRef(null),[w,k]=d.useState(!1),[G,fe]=d.useState({width:400,height:600}),[Oe,de]=d.useState(0);d.useEffect(()=>{const P=()=>{if(b.current){const{offsetWidth:$,offsetHeight:H}=b.current;k($>H),fe({width:$,height:H})}};P();const W=new ResizeObserver(P);return b.current&&W.observe(b.current),()=>{W.disconnect()}},[]);const J=d.useCallback(()=>{de(P=>P+1)},[]),A=d.useCallback(()=>{!i||!f||(p(!0),f())},[i,f]),C=d.useCallback(()=>{!i||!u||(p(!1),u())},[i,u]),B=d.useCallback(()=>{h&&u&&(p(!1),u())},[h,u]),S=w?G.width<350:G.height<200,I=w?G.height<310:G.height<450;return t.jsx(he,{ref:b,className:m,sx:{width:"100%",height:"100%",display:"flex",flexDirection:w?"row":"column",position:"relative",overflow:"hidden",minWidth:{xs:180,sm:220,md:250},minHeight:w?{xs:200,sm:240,md:260}:{xs:150,sm:180,md:220},border:`1px solid ${c.palette.divider}`,borderRadius:"18px",boxShadow:"none",backgroundColor:((N=c.palette.backgroundPaperElevation)==null?void 0:N[8])||"#2A2A3F",backgroundImage:"none"},children:w?t.jsxs(t.Fragment,{children:[t.jsx(v,{sx:{flex:"0 0 50%",position:"relative",height:"100%",minHeight:"100%",maxHeight:"100%",borderRadius:1,m:{xs:1.5,sm:2,md:3},mr:{xs:.75,sm:1,md:1.5},overflow:"hidden",display:S?"none":"block"},children:!S&&t.jsxs(T.Canvas,{orthographic:!0,camera:{position:[3,2,3],zoom:1},shadows:!0,frameloop:"demand",style:{borderRadius:c.shape.borderRadius,width:"100%",height:"100%",background:"transparent",position:"absolute",top:0,left:0},dpr:[1,2],gl:{alpha:!0,antialias:!0},children:[t.jsx(O,{}),t.jsx(M.Bounds,{fit:!0,observe:!0,margin:1,maxDuration:1,children:t.jsx(y,{connectedMotionGroup:s,postModelRender:J})})]})}),t.jsxs(v,{sx:{flex:"1",display:"flex",flexDirection:"column",justifyContent:"flex-start",width:S?"100%":"50%"},children:[t.jsxs(v,{sx:{p:{xs:1.5,sm:2,md:3},pb:{xs:1,sm:1.5,md:2},textAlign:"left"},children:[t.jsx(X,{variant:"h6",component:"h2",sx:{mb:1},children:e}),t.jsx(L.ProgramStateIndicator,{programState:n,safetyState:r,operationMode:o})]}),t.jsxs(v,{sx:{p:{xs:1.5,sm:2,md:3},pt:0,flex:"1",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[!I&&a&&t.jsxs(v,{children:[t.jsx(a,{}),t.jsx(Q,{sx:{mt:1,mb:0,borderColor:c.palette.divider,opacity:.5}})]}),t.jsx(v,{sx:{mt:!I&&a?"auto":0},children:t.jsx(v,{sx:{display:"flex",justifyContent:"flex-start",mt:{xs:1,sm:1.5,md:2},mb:{xs:.5,sm:.75,md:1}},children:t.jsx(Y,{ref:x,variant:"contained",color:"secondary",size:"small",disabled:!i,onMouseDown:A,onMouseUp:C,onMouseLeave:B,onTouchStart:A,onTouchEnd:C,sx:{textTransform:"none",px:1.5,py:.5},children:l("RobotCard.DriveToHome.bt")})})})]})]})]}):t.jsx(t.Fragment,{children:t.jsxs(v,{sx:{p:3,height:"100%",display:"flex",flexDirection:"column"},children:[t.jsxs(v,{children:[t.jsx(X,{variant:"h6",component:"h2",sx:{mb:1},children:e}),t.jsx(L.ProgramStateIndicator,{programState:n,safetyState:r,operationMode:o})]}),t.jsx(v,{sx:{flex:S?0:1,position:"relative",minHeight:S?0:{xs:120,sm:150,md:200},height:S?0:"auto",borderRadius:1,overflow:"hidden",display:S?"none":"block"},children:!S&&t.jsxs(T.Canvas,{orthographic:!0,camera:{position:[3,2,3],zoom:1},shadows:!0,frameloop:"demand",style:{borderRadius:c.shape.borderRadius,width:"100%",height:"100%",background:"transparent",position:"absolute"},dpr:[1,2],gl:{alpha:!0,antialias:!0},children:[t.jsx(O,{}),t.jsx(M.Bounds,{fit:!0,clip:!0,observe:!0,margin:1,maxDuration:1,children:t.jsx(y,{connectedMotionGroup:s,postModelRender:J})})]})}),t.jsxs(v,{children:[!I&&a&&t.jsxs(t.Fragment,{children:[t.jsx(a,{}),t.jsx(Q,{sx:{mt:1,mb:0,borderColor:c.palette.divider,opacity:.5}})]}),t.jsx(v,{sx:{display:"flex",justifyContent:"flex-start",mt:!I&&a?{xs:1,sm:2,md:5}:{xs:.5,sm:1,md:2},mb:{xs:.5,sm:.75,md:1}},children:t.jsx(Y,{ref:x,variant:"contained",color:"secondary",size:"small",disabled:!i,onMouseDown:A,onMouseUp:C,onMouseLeave:B,onTouchStart:A,onTouchEnd:C,sx:{textTransform:"none",px:1.5,py:.5},children:l("RobotCard.DriveToHome.bt")})})]})]})})})})),Ie=Array(6).fill(2*Math.PI);function ce({rapidlyChangingMotionState:e,dhParameters:n,onTranslationChanged:r,children:o}){const i=d.useRef([]),f=d.useRef([]),u=d.useRef(null),{invalidate:s}=T.useThree();d.useEffect(()=>{const c=e.joint_position.filter(l=>l!==void 0);return u.current=new L.ValueInterpolator(c,{tension:120,friction:20,threshold:.001}),()=>{var l;(l=u.current)==null||l.destroy()}},[]),T.useFrame((c,l)=>{if(u.current){const h=u.current.update(l);a(),h||s()}});function y(c){c&&(f.current=z(c),a(),s())}function a(){var l;const c=((l=u.current)==null?void 0:l.getCurrentValues())||[];if(r)r(f.current,c);else for(const[h,p]of f.current.entries()){const b=n[h].reverse_rotation_direction?-1:1;p.position.y=b*(c[h]||0)/1e3}}const m=d.useCallback(()=>{const c=e.joint_position.filter(l=>l!==void 0);requestAnimationFrame(()=>{var l;i.current=c,(l=u.current)==null||l.setTarget(c)})},[e]);return d.useEffect(()=>{m()},[e,m]),L.useAutorun(()=>{m()}),t.jsx("group",{ref:y,children:o})}function ue({rapidlyChangingMotionState:e,dhParameters:n,...r}){const o=new g.Matrix4,i=d.useRef(null),f=d.useRef(null);function u(a){const m=new g.Matrix4;for(let p=0;p<n.length;p++){const x=n[p],b=a[p]??0,w=new g.Matrix4().makeRotationY(x.theta).multiply(new g.Matrix4().makeTranslation(x.a/1e3,(x.d+b*(x.reverse_rotation_direction?-1:1))/1e3,0)).multiply(new g.Matrix4().makeRotationX(x.alpha));m.multiply(w)}const c=new g.Vector3,l=new g.Quaternion,h=new g.Vector3;return m.decompose(c,l,h),c}const s=u(e.joint_position);function y(a,m){o.identity();let c=new g.Vector3;for(let x=0;x<n.length;x++){const b=m[x]??0,w=n[x],k=new g.Matrix4().makeRotationY(w.theta).multiply(new g.Matrix4().makeTranslation(w.a/1e3,(w.d+b*(w.reverse_rotation_direction?-1:1))/1e3,0)).multiply(new g.Matrix4().makeRotationX(w.alpha));o.multiply(k)}const l=new g.Vector3,h=new g.Quaternion,p=new g.Vector3;if(o.decompose(l,h,p),c=l,i.current&&i.current.position.set(c.x,c.y,c.z),f.current){const x=f.current.geometry;x!=null&&x.setPositions&&x.setPositions([0,0,0,c.x,c.y,c.z])}}return t.jsx(ce,{rapidlyChangingMotionState:e,dhParameters:n,onTranslationChanged:y,children:t.jsxs("group",{...r,name:"Scene",children:[t.jsxs("mesh",{name:"Base",position:[0,0,0],children:[t.jsx("sphereGeometry",{args:[.02,32,32]}),t.jsx("meshStandardMaterial",{color:"green",depthTest:!0})]}),t.jsx(M.Line,{ref:f,points:[new g.Vector3(0,0,0),s],color:"White",lineWidth:5}),t.jsxs("mesh",{ref:i,name:"TCP",position:s,children:[t.jsx("sphereGeometry",{args:[.025,32,32]}),t.jsx("meshStandardMaterial",{color:"red",depthTest:!0})]})]})})}const U=_.externalizeComponent(({rapidlyChangingMotionState:e,modelFromController:n,dhParameters:r,getModel:o=E,flangeRef:i,postModelRender:f,transparentColor:u,instanceUrl:s,...y})=>{const[a,m]=d.useState(null),c=d.useCallback(h=>{m(h)},[]);d.useEffect(()=>{a&&(u?oe(a,u):ie(a))},[a,u]);const l=t.jsx(ue,{rapidlyChangingMotionState:e,dhParameters:r,...y});return t.jsxs(K.ErrorBoundary,{fallback:l,onError:h=>{console.warn(h)},children:[t.jsx(d.Suspense,{fallback:l,children:t.jsx("group",{ref:c,children:t.jsx(ce,{rapidlyChangingMotionState:e,dhParameters:r,children:t.jsx(se,{modelURL:(()=>{const h=o(n,s);if(!h){const p=new Blob([],{type:"model/gltf-binary"}),x=new File([p],`${n}.glb`,{type:"model/gltf-binary"});return Promise.resolve(URL.createObjectURL(x))}return h})(),postModelRender:f,flangeRef:i,...y})})})}),t.jsx(ne,{})]})});function Pe({connectedMotionGroup:e,getModel:n=E,flangeRef:r,transparentColor:o,postModelRender:i,...f}){if(!e.dhParameters)return null;const u=e.modelFromController||"";return u&&n(u)?t.jsx(U,{rapidlyChangingMotionState:e.rapidlyChangingMotionState,modelFromController:u,dhParameters:e.dhParameters,getModel:n,flangeRef:r,transparentColor:o,postModelRender:i,...f}):t.jsx(ue,{rapidlyChangingMotionState:e.rapidlyChangingMotionState,dhParameters:e.dhParameters,...f})}const D={[R.Manufacturer.Abb]:[0,0,0,0,Math.PI/2,0,0],[R.Manufacturer.Fanuc]:[0,0,0,0,-Math.PI/2,0,0],[R.Manufacturer.Yaskawa]:[0,0,0,0,-Math.PI/2,0,0],[R.Manufacturer.Kuka]:[0,-Math.PI/2,Math.PI/2,0,Math.PI/2,0,0],[R.Manufacturer.Universalrobots]:[0,-Math.PI/2,-Math.PI/2,-Math.PI/2,Math.PI/2,-Math.PI/2,0],[R.Manufacturer.Staubli]:[0,-Math.PI/2,Math.PI/2,0,0,0,0]};function le(e){const[n]=e.split("_");switch(n){case"ABB":return R.Manufacturer.Abb;case"FANUC":return R.Manufacturer.Fanuc;case"YASKAWA":return R.Manufacturer.Yaskawa;case"KUKA":return R.Manufacturer.Kuka;case"UniversalRobots":return R.Manufacturer.Universalrobots;case"STAUBLI":return R.Manufacturer.Staubli;default:return null}}function Fe(e,n){const r=le(e);return r&&r in D?D[r]:n||null}const Ve=_.externalizeComponent(e=>{const{inverseSolver:n,dhParameters:r,...o}=e,[i,f]=d.useState(R.JointTypeEnum.RevoluteJoint);d.useEffect(()=>{r.length&&f(r[0].type??R.JointTypeEnum.RevoluteJoint)},[r]);const u=d.useMemo(()=>n===null&&i===R.JointTypeEnum.RevoluteJoint,[n,i]),s=d.useMemo(()=>n===null&&i===R.JointTypeEnum.PrismaticJoint,[n,i]);return d.useMemo(()=>!!n,[n])||u?t.jsx(q,{dhParameters:r,...o}):s?t.jsx(U,{dhParameters:r,...o}):null});exports.CollisionSceneRenderer=we;exports.LinearAxis=Pe;exports.MANUFACTURER_HOME_CONFIGS=D;exports.MotionGroupVisualizer=Ve;exports.PresetEnvironment=O;exports.Robot=ae;exports.RobotCard=Ce;exports.SafetyZonesRenderer=ve;exports.SupportedLinearAxis=U;exports.SupportedRobot=q;exports.TrajectoryRenderer=Se;exports.defaultAxisConfig=Ie;exports.defaultGetModel=E;exports.extractManufacturer=le;exports.getDefaultHomeConfig=Fe;
|