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