@wandelbots/wandelbots-js-react-components 6.1.0 → 6.2.0

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