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