@wandelbots/wandelbots-js-react-components 6.4.0-pr.revamp.667.bd2ec84 → 6.4.0-pr.revamp.667.ca77f09
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +172 -40
- package/dist/3d.cjs +1 -1
- package/dist/3d.d.ts +3 -4
- package/dist/3d.js +35 -38
- package/dist/CurrentPose/index.cjs +1 -1
- package/dist/CurrentPose/index.js +2 -2
- package/dist/CurrentPoseBar/index.cjs +1 -1
- package/dist/CurrentPoseBar/index.js +1 -1
- package/dist/JoggingButtons/index.cjs +1 -1
- package/dist/JoggingButtons/index.js +1 -1
- package/dist/JoggingGizmo/index.cjs +1 -1
- package/dist/JoggingGizmo/index.js +2 -2
- package/dist/JoggingJointSlider/index.cjs +1 -1
- package/dist/JoggingJointSlider/index.js +1 -1
- package/dist/RobotControl/index.cjs +1 -1
- package/dist/RobotControl/index.js +2 -2
- package/dist/RobotControlPanel/index.cjs +1 -1
- package/dist/RobotControlPanel/index.d.ts +1 -1
- package/dist/RobotControlPanel/index.js +1 -1
- package/dist/RobotHeader/index.cjs +1 -1
- package/dist/RobotHeader/index.d.ts +3 -5
- package/dist/RobotHeader/index.js +6 -7
- package/dist/RobotScene/index.cjs +1 -1
- package/dist/RobotScene/index.js +3 -3
- package/dist/RobotView/index.cjs +1 -1
- package/dist/RobotView/index.js +2 -2
- package/dist/SafetyBar/IndicatorWithExplanation.d.ts +12 -1
- package/dist/SafetyBar/SafetyBar.d.ts +15 -1
- package/dist/SafetyBar/index.cjs +1 -1
- package/dist/SafetyBar/index.d.ts +0 -1
- package/dist/SafetyBar/index.js +3 -4
- package/dist/SafetyBar/robotSafetyOf.d.ts +1 -0
- package/dist/chunks/{ConnectedMotionGroup-BifrgwV1.js → ConnectedMotionGroup-DNYakgxy.js} +6 -5
- package/dist/chunks/ConnectedMotionGroup-IRTsTxwB.cjs +3 -0
- package/dist/chunks/{CurrentPose-CMqO8oqX.cjs → CurrentPose-CAq9e9JY.cjs} +1 -1
- package/dist/chunks/{CurrentPose-CdD2ZB7B.js → CurrentPose-CgdINEh2.js} +3 -3
- package/dist/chunks/{CurrentPoseBar-CX1xFBtm.js → CurrentPoseBar--HkZBGnN.js} +11 -11
- package/dist/chunks/{CurrentPoseBar-BTBAwIO4.cjs → CurrentPoseBar-DoOUfRRs.cjs} +1 -1
- package/dist/chunks/{JoggingButtons-aijK-3g6.js → JoggingButtons-BNOnpcTH.js} +1 -1
- package/dist/chunks/{JoggingButtons-BOHl7hVq.cjs → JoggingButtons-Boaym2hQ.cjs} +1 -1
- package/dist/chunks/{JoggingGizmo-CoKYUtXq.cjs → JoggingGizmo-CNFjpWDv.cjs} +1 -1
- package/dist/chunks/{JoggingGizmo-DHvrJouR.js → JoggingGizmo-RDiEVQes.js} +1 -1
- package/dist/chunks/{JoggingGizmoOrientation-CIvIAIeO.js → JoggingGizmoOrientation-Dzzz2gEz.js} +1 -1
- package/dist/chunks/{JoggingGizmoOrientation-DVcagPRJ.cjs → JoggingGizmoOrientation-laUrgY0N.cjs} +1 -1
- package/dist/chunks/{JoggingJointSlider-DQtt4-pa.js → JoggingJointSlider-BY-Tof8G.js} +1 -1
- package/dist/chunks/{JoggingJointSlider-CTFYKzsU.cjs → JoggingJointSlider-Dm3vILd3.cjs} +1 -1
- package/dist/chunks/{JoggingRefusedError-BIkUM6-g.js → JoggingRefusedError-C4D8_YR_.js} +5 -3
- package/dist/chunks/JoggingRefusedError-DqyrfUcc.cjs +1 -0
- package/dist/chunks/Pose3-BfBNPRDM.cjs +1 -0
- package/dist/chunks/{Pose3-B_fLR-Wv.js → Pose3-DWxfC6Dj.js} +1 -2
- package/dist/chunks/{Robot-C-IWfxP9.js → Robot-B-VAYuAr.js} +5 -5
- package/dist/chunks/{Robot-Cfhjv9Z8.cjs → Robot-DRf8T9Zf.cjs} +1 -1
- package/dist/chunks/RobotActivation-CRVxXvlx.cjs +1 -0
- package/dist/chunks/RobotActivation-oR-8Y0iq.js +143 -0
- package/dist/chunks/RobotControl-Dbe50ZKM.cjs +1 -0
- package/dist/chunks/RobotControl-Ms1F7fFe.js +332 -0
- package/dist/chunks/RobotControlPanel-B7NxoHsO.cjs +1 -0
- package/dist/chunks/RobotControlPanel-CkQlkq8x.js +1029 -0
- package/dist/chunks/RobotHeader-CjOaf9s6.cjs +1 -0
- package/dist/chunks/RobotHeader-LSuRTDFB.js +395 -0
- package/dist/chunks/RobotScene-Au6zpHH1.cjs +1 -0
- package/dist/chunks/RobotScene-C6XEgaVR.js +1284 -0
- package/dist/chunks/RobotSessionProvider-CoF_tX0O.cjs +1 -0
- package/dist/chunks/RobotSessionProvider-DuHi-dtw.js +30 -0
- package/dist/chunks/{RobotView-BGYlAWj-.cjs → RobotView-Cg6JfGiY.cjs} +1 -1
- package/dist/chunks/{RobotView-D-v8jCM7.js → RobotView-CrAxNkyG.js} +3 -3
- package/dist/chunks/{robotSafetyOf-DuKKma1_.js → SafetyBar-C85BAKsL.js} +244 -215
- package/dist/chunks/SafetyBar-D2l81Omq.cjs +1 -0
- package/dist/chunks/externalizeComponent-CA_sHzyH.cjs +2 -0
- package/dist/chunks/{externalizeComponent-4juwPKL5.js → externalizeComponent-CChY_1bN.js} +34 -8
- package/dist/chunks/{useSmoothedMotionState-BSSV8aZN.js → hooks-BWoeBWLV.js} +43 -87
- package/dist/chunks/hooks-BXe2bNMo.cjs +1 -0
- package/dist/chunks/loadRobotSession-BzY9H3F8.cjs +1 -0
- package/dist/chunks/{loadRobotSession-GHHtv5dv.js → loadRobotSession-Ts2MumBB.js} +1065 -679
- package/dist/chunks/poseText-BxG4Caa-.js +48 -0
- package/dist/chunks/poseText-CwplkbDM.cjs +1 -0
- package/dist/chunks/useSmoothedMotionState-CCXmMZ0S.cjs +1 -0
- package/dist/chunks/useSmoothedMotionState-CELh-YJa.js +50 -0
- package/dist/components/VelocitySlider.d.ts +14 -1
- package/dist/components/connectionWarning/ConnectionWarning.d.ts +18 -4
- package/dist/components/connectionWarning/connectionWarningOf.d.ts +1 -11
- package/dist/components/jogging/JoggingCartesianAxisControl.d.ts +7 -1
- package/dist/components/jogging/JoggingCartesianTab.d.ts +6 -0
- package/dist/components/jogging/JoggingJointTab.d.ts +5 -0
- package/dist/components/jogging/JoggingJointValueControl.d.ts +7 -1
- package/dist/components/jogging/JoggingPanel.d.ts +11 -0
- package/dist/components/jogging/JoggingRefusedError.d.ts +8 -3
- package/dist/components/jogging/JoggingStore.d.ts +206 -17
- package/dist/components/jogging/joggingColors.d.ts +6 -0
- package/dist/components/robotControl/CartesianJogTab.d.ts +14 -3
- package/dist/components/robotControl/JogArea.d.ts +6 -3
- package/dist/components/robotControl/JogDisabledReason.d.ts +15 -0
- package/dist/components/robotControl/JointJogTab.d.ts +10 -2
- package/dist/components/robotControl/MoveToTab.d.ts +24 -3
- package/dist/components/robotControl/PoseField.d.ts +3 -1
- package/dist/components/robotControl/RobotControl.d.ts +3 -0
- package/dist/components/robotControl/RobotControlPanel.d.ts +91 -22
- package/dist/components/robotControl/VelocityRow.d.ts +8 -2
- package/dist/components/robotControl/atPose.d.ts +6 -0
- package/dist/components/robotControl/poseText.d.ts +13 -1
- package/dist/components/robotControl/units.d.ts +10 -2
- package/dist/components/robotControl/useRobotControlProps.d.ts +7 -4
- package/dist/components/robotControl/velocityText.d.ts +18 -0
- package/dist/components/robotHeader/ActivationSwitch.d.ts +13 -2
- package/dist/components/robotHeader/RobotHeader.d.ts +25 -4
- package/dist/components/robotHeader/robotActivationOf.d.ts +1 -8
- package/dist/components/robotScene/RobotScene.d.ts +7 -1
- package/dist/components/robots/MotionGroupVisualizer.d.ts +6 -4
- package/dist/components/robots/SupportedLinearAxis.d.ts +6 -4
- package/dist/components/robots/SupportedRobot.d.ts +7 -5
- package/dist/components/robots/useFrameSmoothedMotionState.d.ts +25 -0
- package/dist/components/utils/useSmoothedMotionState.d.ts +11 -2
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +8 -10
- package/dist/core.js +60 -69
- package/dist/index.cjs +1 -1
- package/dist/index.js +100 -113
- package/dist/lib/ConnectedMotionGroup.d.ts +11 -0
- package/dist/lib/ControllerStateStream.d.ts +9 -9
- package/dist/lib/JoggerConnection.d.ts +48 -13
- package/dist/lib/MotionStreamConnection.d.ts +3 -2
- package/dist/lib/TrajectoryExecutionStore.d.ts +58 -20
- package/dist/lib/controllerStateSource.d.ts +6 -5
- package/dist/lib/robotSession/RobotActivation.d.ts +52 -21
- package/dist/lib/robotSession/RobotSession.d.ts +27 -8
- package/dist/lib/robotSession/RobotTargetPose.d.ts +4 -2
- package/dist/lib/robotSession/loadRobotSession.d.ts +1 -1
- package/dist/lib/robotSession/robotPose.d.ts +0 -6
- package/dist/session.cjs +1 -1
- package/dist/session.d.ts +6 -6
- package/dist/session.js +30 -38
- package/package.json +22 -1
- package/dist/chunks/ConnectedMotionGroup-CybwJHkh.cjs +0 -3
- package/dist/chunks/JoggingRefusedError-BuCGsVsa.cjs +0 -1
- package/dist/chunks/Pose3-Ch4xVeXV.cjs +0 -1
- package/dist/chunks/RobotActivation-Bb0oNSBN.cjs +0 -1
- package/dist/chunks/RobotActivation-C0rrwpQZ.js +0 -115
- package/dist/chunks/RobotControl-Cv6Sr1Ni.js +0 -289
- package/dist/chunks/RobotControl-DFnOYMAa.cjs +0 -1
- package/dist/chunks/RobotControlPanel-B1_9g9D-.js +0 -850
- package/dist/chunks/RobotControlPanel-BpTpRBgy.cjs +0 -1
- package/dist/chunks/RobotScene-0ZJzXL50.cjs +0 -1
- package/dist/chunks/RobotScene-DpFeFpnx.js +0 -1255
- package/dist/chunks/RobotSessionProvider--AekyPqD.cjs +0 -1
- package/dist/chunks/RobotSessionProvider-TVaKGzqa.js +0 -25
- package/dist/chunks/externalizeComponent-Br_U-QAr.cjs +0 -2
- package/dist/chunks/loadRobotSession-DYbeNnTI.cjs +0 -1
- package/dist/chunks/poseText-BXUaQWnK.cjs +0 -1
- package/dist/chunks/poseText-pg4cxE8R.js +0 -41
- package/dist/chunks/robotActivationOf-B4oV10Za.cjs +0 -1
- package/dist/chunks/robotActivationOf-EzcT9g07.js +0 -368
- package/dist/chunks/robotSafetyOf-Dxm6s7Pp.cjs +0 -1
- package/dist/chunks/useSmoothedMotionState-B9WO73k0.cjs +0 -1
- package/dist/components/robotHeader/robotSafetyOf.d.ts +0 -11
|
@@ -0,0 +1,1284 @@
|
|
|
1
|
+
import { jsx as a, jsxs as S, Fragment as k } from "react/jsx-runtime";
|
|
2
|
+
import { observer as _t } from "mobx-react-lite";
|
|
3
|
+
import { a as bt } from "./RobotSessionProvider-DuHi-dtw.js";
|
|
4
|
+
import { useTheme as St } from "@mui/material/styles";
|
|
5
|
+
import Tt, { useMemo as x, useRef as b, useEffect as A, forwardRef as Y, useImperativeHandle as Z, useState as C, useCallback as q, Suspense as K } from "react";
|
|
6
|
+
import { Environment as Ot, Lightformer as G, PivotControls as Mt, Line as z, useGLTF as xt } from "@react-three/drei";
|
|
7
|
+
import * as R from "three";
|
|
8
|
+
import { Euler as At, Vector3 as M, Quaternion as L, Matrix4 as T } from "three";
|
|
9
|
+
import { RoundedBoxGeometry as It, ConvexGeometry as Gt } from "three-stdlib";
|
|
10
|
+
import { JointTypeEnum as I } from "@wandelbots/nova-js/v2";
|
|
11
|
+
import { e as V } from "./externalizeComponent-CChY_1bN.js";
|
|
12
|
+
import { ErrorBoundary as tt } from "react-error-boundary";
|
|
13
|
+
import { useThree as F, useFrame as et } from "@react-three/fiber";
|
|
14
|
+
import { V as nt, b as ot } from "./hooks-BWoeBWLV.js";
|
|
15
|
+
import { g as Vt, j as Et, r as Lt } from "./PoseTransformer-CmuoS76S.js";
|
|
16
|
+
import { P as jt, p as J } from "./Pose3-DWxfC6Dj.js";
|
|
17
|
+
import { autorun as rt, observable as Ct, runInAction as it, computed as qt } from "mobx";
|
|
18
|
+
function Ft() {
|
|
19
|
+
return /* @__PURE__ */ a(Ot, { frames: 1, children: /* @__PURE__ */ a(kt, {}) });
|
|
20
|
+
}
|
|
21
|
+
const Pt = [2, 0, 2, 0, 2, 0, 2, 0];
|
|
22
|
+
function kt({ positions: t = Pt }) {
|
|
23
|
+
return /* @__PURE__ */ S(k, { children: [
|
|
24
|
+
/* @__PURE__ */ a(
|
|
25
|
+
G,
|
|
26
|
+
{
|
|
27
|
+
intensity: 5,
|
|
28
|
+
"rotation-x": Math.PI / 2,
|
|
29
|
+
position: [0, 5, -9],
|
|
30
|
+
scale: [10, 10, 1]
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
/* @__PURE__ */ a("group", { rotation: [0, 0.5, 0], children: /* @__PURE__ */ a("group", { children: t.map((n, e) => /* @__PURE__ */ a(
|
|
34
|
+
G,
|
|
35
|
+
{
|
|
36
|
+
form: "circle",
|
|
37
|
+
intensity: 5,
|
|
38
|
+
rotation: [Math.PI / 2, 0, 0],
|
|
39
|
+
position: [n, 4, e * 4],
|
|
40
|
+
scale: [3, 1, 1]
|
|
41
|
+
},
|
|
42
|
+
e
|
|
43
|
+
)) }) }),
|
|
44
|
+
/* @__PURE__ */ a(
|
|
45
|
+
G,
|
|
46
|
+
{
|
|
47
|
+
intensity: 40,
|
|
48
|
+
"rotation-y": Math.PI / 2,
|
|
49
|
+
position: [-5, 1, -1],
|
|
50
|
+
scale: [20, 0.1, 1]
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ a(
|
|
54
|
+
G,
|
|
55
|
+
{
|
|
56
|
+
intensity: 20,
|
|
57
|
+
"rotation-y": -Math.PI,
|
|
58
|
+
position: [-5, -2, -1],
|
|
59
|
+
scale: [20, 0.1, 1]
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ a(
|
|
63
|
+
G,
|
|
64
|
+
{
|
|
65
|
+
"rotation-y": Math.PI / 2,
|
|
66
|
+
position: [-5, -1, -1],
|
|
67
|
+
scale: [20, 0.5, 1],
|
|
68
|
+
intensity: 5
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ a(
|
|
72
|
+
G,
|
|
73
|
+
{
|
|
74
|
+
"rotation-y": -Math.PI / 2,
|
|
75
|
+
position: [10, 1, 0],
|
|
76
|
+
scale: [20, 1, 1],
|
|
77
|
+
intensity: 10
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ a(
|
|
81
|
+
G,
|
|
82
|
+
{
|
|
83
|
+
form: "ring",
|
|
84
|
+
color: "white",
|
|
85
|
+
intensity: 5,
|
|
86
|
+
scale: 10,
|
|
87
|
+
position: [-15, 4, -18],
|
|
88
|
+
target: [0, 0, 0]
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
] });
|
|
92
|
+
}
|
|
93
|
+
function Jt(t) {
|
|
94
|
+
const n = t.length(), e = new R.Quaternion();
|
|
95
|
+
if (n > 1e-6) {
|
|
96
|
+
const o = t.clone().normalize();
|
|
97
|
+
e.setFromAxisAngle(o, n);
|
|
98
|
+
}
|
|
99
|
+
return e;
|
|
100
|
+
}
|
|
101
|
+
function Nt(t) {
|
|
102
|
+
if (!t || t.length === 0)
|
|
103
|
+
return 5;
|
|
104
|
+
const o = t.reduce((r, c) => r + Math.abs(c.a ?? 0) / 1e3 + Math.abs(c.d ?? 0) / 1e3, 0) * 2;
|
|
105
|
+
return !Number.isFinite(o) || o <= 0 ? 5 : o;
|
|
106
|
+
}
|
|
107
|
+
function Dt(t) {
|
|
108
|
+
if (t.length < 3)
|
|
109
|
+
return console.log("Not enough vertices to define a plane"), { isCoplanar: !1 };
|
|
110
|
+
const n = new R.Vector3(t[0].x, t[0].y, t[0].z), e = new R.Vector3(t[1].x, t[1].y, t[1].z), o = new R.Vector3(t[2].x, t[2].y, t[2].z), r = new R.Vector3().subVectors(e, n), c = new R.Vector3().subVectors(o, n), l = new R.Vector3().crossVectors(r, c).normalize();
|
|
111
|
+
for (let i = 3; i < t.length; i++) {
|
|
112
|
+
const m = new R.Vector3(t[i].x, t[i].y, t[i].z), p = new R.Vector3().subVectors(m, n), h = l.dot(p);
|
|
113
|
+
if (Math.abs(h) > 1e-6)
|
|
114
|
+
return console.log("Vertices are not on the same plane"), { isCoplanar: !1 };
|
|
115
|
+
}
|
|
116
|
+
return { isCoplanar: !0, normal: l };
|
|
117
|
+
}
|
|
118
|
+
const B = {
|
|
119
|
+
attach: "material",
|
|
120
|
+
color: "#009f4d",
|
|
121
|
+
opacity: 0.2,
|
|
122
|
+
depthTest: !1,
|
|
123
|
+
depthWrite: !1,
|
|
124
|
+
transparent: !0,
|
|
125
|
+
polygonOffset: !0
|
|
126
|
+
};
|
|
127
|
+
function $t({
|
|
128
|
+
safetyZones: t,
|
|
129
|
+
dhParameters: n,
|
|
130
|
+
...e
|
|
131
|
+
}) {
|
|
132
|
+
const o = x(
|
|
133
|
+
() => Nt(n ?? []),
|
|
134
|
+
[n]
|
|
135
|
+
), r = (l, i) => {
|
|
136
|
+
var y, g;
|
|
137
|
+
if (!((y = i == null ? void 0 : i.pose) != null && y.position) || !((g = i == null ? void 0 : i.pose) != null && g.orientation))
|
|
138
|
+
return null;
|
|
139
|
+
const m = new R.Vector3(
|
|
140
|
+
i.pose.position[0] / 1e3,
|
|
141
|
+
i.pose.position[1] / 1e3,
|
|
142
|
+
i.pose.position[2] / 1e3
|
|
143
|
+
), p = new R.Vector3(
|
|
144
|
+
i.pose.orientation[0],
|
|
145
|
+
i.pose.orientation[1],
|
|
146
|
+
i.pose.orientation[2]
|
|
147
|
+
);
|
|
148
|
+
let h;
|
|
149
|
+
const s = i.shape.shape_type === "plane" ? { ...B, side: R.DoubleSide } : { ...B, side: R.FrontSide };
|
|
150
|
+
switch (i.shape.shape_type) {
|
|
151
|
+
/**
|
|
152
|
+
* Plane shape, uses DH parameters to calculate the size of the plane (reach distance of a robot)
|
|
153
|
+
*/
|
|
154
|
+
case "plane":
|
|
155
|
+
h = /* @__PURE__ */ a("planeGeometry", { args: [o, o] });
|
|
156
|
+
break;
|
|
157
|
+
/**
|
|
158
|
+
* Sphere shape
|
|
159
|
+
*/
|
|
160
|
+
case "sphere": {
|
|
161
|
+
const f = (i == null ? void 0 : i.shape).radius / 1e3;
|
|
162
|
+
h = /* @__PURE__ */ a("sphereGeometry", { args: [f] });
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Capsule shape
|
|
167
|
+
*/
|
|
168
|
+
case "capsule": {
|
|
169
|
+
const f = (i == null ? void 0 : i.shape).radius / 1e3, u = (i == null ? void 0 : i.shape).cylinder_height / 1e3;
|
|
170
|
+
h = /* @__PURE__ */ a("capsuleGeometry", { args: [f, u] });
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Convex hull, checks at first if the vertices are coplanar - if yes, adds a small offset for
|
|
175
|
+
* renderer to be able to visualize the convex hull.
|
|
176
|
+
*/
|
|
177
|
+
case "convex_hull": {
|
|
178
|
+
const f = (i == null ? void 0 : i.shape).vertices.map(
|
|
179
|
+
(w) => new R.Vector3(w[0] / 1e3, w[1] / 1e3, w[2] / 1e3)
|
|
180
|
+
), u = Dt(f);
|
|
181
|
+
if (u.isCoplanar && u.normal) {
|
|
182
|
+
const d = new R.Vector3().addVectors(
|
|
183
|
+
f[0],
|
|
184
|
+
u.normal.multiplyScalar(1e-4)
|
|
185
|
+
);
|
|
186
|
+
f.push(d);
|
|
187
|
+
}
|
|
188
|
+
try {
|
|
189
|
+
h = /* @__PURE__ */ a(
|
|
190
|
+
"primitive",
|
|
191
|
+
{
|
|
192
|
+
object: new Gt(f),
|
|
193
|
+
attach: "geometry"
|
|
194
|
+
}
|
|
195
|
+
);
|
|
196
|
+
} catch (w) {
|
|
197
|
+
return console.log("Error creating ConvexGeometry:", w), null;
|
|
198
|
+
}
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Convex hull around four spheres. Sphere center points in x/y-plane,
|
|
203
|
+
* offset by either combination "+/- sizeX" or "+/- sizeY".
|
|
204
|
+
* Alternative description: Rectangle in x/y-plane with a 3D padding (source: nova-api docs)
|
|
205
|
+
*
|
|
206
|
+
* Basically a rounded box with a rectangular cross-section.
|
|
207
|
+
*/
|
|
208
|
+
case "rectangular_capsule": {
|
|
209
|
+
const f = i.shape, u = f.radius / 1e3, w = f.sphere_center_distance_x / 1e3, d = f.sphere_center_distance_y / 1e3, v = u * 2;
|
|
210
|
+
h = /* @__PURE__ */ a(
|
|
211
|
+
"primitive",
|
|
212
|
+
{
|
|
213
|
+
object: new It(w, d, v, 2, u),
|
|
214
|
+
attach: "geometry"
|
|
215
|
+
}
|
|
216
|
+
);
|
|
217
|
+
break;
|
|
218
|
+
}
|
|
219
|
+
default:
|
|
220
|
+
console.warn(
|
|
221
|
+
"Unsupported safety zone shape type:",
|
|
222
|
+
i.shape.shape_type
|
|
223
|
+
), h = null;
|
|
224
|
+
}
|
|
225
|
+
return /* @__PURE__ */ S(
|
|
226
|
+
"mesh",
|
|
227
|
+
{
|
|
228
|
+
renderOrder: l,
|
|
229
|
+
position: m,
|
|
230
|
+
quaternion: Jt(p),
|
|
231
|
+
children: [
|
|
232
|
+
h,
|
|
233
|
+
/* @__PURE__ */ a("meshStandardMaterial", { ...s, polygonOffsetFactor: -l })
|
|
234
|
+
]
|
|
235
|
+
},
|
|
236
|
+
`safety-zone-${i.shape.shape_type}-${l}`
|
|
237
|
+
);
|
|
238
|
+
}, c = x(() => Object.values(t ?? {}).map(
|
|
239
|
+
(l, i) => r(i, l)
|
|
240
|
+
), [t, o]);
|
|
241
|
+
return /* @__PURE__ */ a("group", { ...e, children: c });
|
|
242
|
+
}
|
|
243
|
+
const Bt = ["#ff2060", "#20df80", "#2080ff"], Ut = [
|
|
244
|
+
"#6A6A6A",
|
|
245
|
+
"#9B9B9B",
|
|
246
|
+
"#727272"
|
|
247
|
+
], Ht = "#BBBBBB", Wt = 0.5;
|
|
248
|
+
function U(t) {
|
|
249
|
+
if (!t) return [0, 0, 0, 0, 0, 0, 1];
|
|
250
|
+
const { position: n, quaternion: e } = jt.fromPose(t);
|
|
251
|
+
return [
|
|
252
|
+
n.x / 1e3,
|
|
253
|
+
n.y / 1e3,
|
|
254
|
+
n.z / 1e3,
|
|
255
|
+
e.x,
|
|
256
|
+
e.y,
|
|
257
|
+
e.z,
|
|
258
|
+
e.w
|
|
259
|
+
];
|
|
260
|
+
}
|
|
261
|
+
function Qt({
|
|
262
|
+
base: t,
|
|
263
|
+
tcpOffset: n,
|
|
264
|
+
rapidlyChangingMotionState: e,
|
|
265
|
+
orientation: o,
|
|
266
|
+
rotate: r = !1
|
|
267
|
+
}) {
|
|
268
|
+
const c = b(null), l = b(null), i = F((p) => p.invalidate), m = o === "tool";
|
|
269
|
+
return A(() => {
|
|
270
|
+
const p = new nt(
|
|
271
|
+
U(e.flange_pose),
|
|
272
|
+
{ tension: 120, friction: 20, threshold: 1e-3 }
|
|
273
|
+
);
|
|
274
|
+
return l.current = p, () => {
|
|
275
|
+
p.destroy(), l.current = null;
|
|
276
|
+
};
|
|
277
|
+
}, []), A(
|
|
278
|
+
() => rt(() => {
|
|
279
|
+
var h;
|
|
280
|
+
const p = e.flange_pose;
|
|
281
|
+
p && ((h = l.current) == null || h.setTarget(U(p)), i());
|
|
282
|
+
}),
|
|
283
|
+
[e, i]
|
|
284
|
+
), et((p, h) => {
|
|
285
|
+
const s = l.current, y = c.current;
|
|
286
|
+
if (!s || !y) return;
|
|
287
|
+
const g = s.update(h), [f = 0, u = 0, w = 0, d = 0, v = 0, _ = 0, O = 1] = s.getCurrentValues();
|
|
288
|
+
y.position.set(f, u, w), y.quaternion.set(d, v, _, O), g || i();
|
|
289
|
+
}), /* @__PURE__ */ S(k, { children: [
|
|
290
|
+
/* @__PURE__ */ a(H, { transform: t, children: /* @__PURE__ */ a(W, { active: !m, rotate: !1 }) }),
|
|
291
|
+
/* @__PURE__ */ a("group", { ref: c, children: /* @__PURE__ */ a(H, { transform: n, children: /* @__PURE__ */ a(W, { active: m, rotate: r }) }) })
|
|
292
|
+
] });
|
|
293
|
+
}
|
|
294
|
+
function H({
|
|
295
|
+
transform: t,
|
|
296
|
+
children: n
|
|
297
|
+
}) {
|
|
298
|
+
const e = t == null ? void 0 : t.position;
|
|
299
|
+
return /* @__PURE__ */ a(
|
|
300
|
+
"group",
|
|
301
|
+
{
|
|
302
|
+
position: [
|
|
303
|
+
((e == null ? void 0 : e[0]) ?? 0) / 1e3,
|
|
304
|
+
((e == null ? void 0 : e[1]) ?? 0) / 1e3,
|
|
305
|
+
((e == null ? void 0 : e[2]) ?? 0) / 1e3
|
|
306
|
+
],
|
|
307
|
+
quaternion: J(
|
|
308
|
+
(t == null ? void 0 : t.orientation) ?? [0, 0, 0],
|
|
309
|
+
(t == null ? void 0 : t.orientation_type) ?? "ROTATION_VECTOR"
|
|
310
|
+
),
|
|
311
|
+
children: n
|
|
312
|
+
}
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
function W({ active: t, rotate: n }) {
|
|
316
|
+
return /* @__PURE__ */ a(
|
|
317
|
+
Mt,
|
|
318
|
+
{
|
|
319
|
+
depthTest: !1,
|
|
320
|
+
scale: 0.12,
|
|
321
|
+
disableRotations: !n,
|
|
322
|
+
disableSliders: !0,
|
|
323
|
+
disableScaling: !0,
|
|
324
|
+
autoTransform: !1,
|
|
325
|
+
opacity: t ? 1 : Wt,
|
|
326
|
+
axisColors: t ? Bt : Ut,
|
|
327
|
+
hoveredColor: t ? void 0 : Ht
|
|
328
|
+
}
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
const st = new At(Math.PI / 2, 0, 0), Xt = console.warn;
|
|
332
|
+
function at() {
|
|
333
|
+
return A(() => {
|
|
334
|
+
console.warn = (t) => {
|
|
335
|
+
t !== "Cannot call the manual advancement of rafz whilst frameLoop is not set as demand" && Xt(t);
|
|
336
|
+
};
|
|
337
|
+
}, []), null;
|
|
338
|
+
}
|
|
339
|
+
const Yt = new M(0, 1, 0), ct = /_J([0-9]+)$/, Zt = "_FLG", P = "_REST", j = /* @__PURE__ */ new Map();
|
|
340
|
+
async function N(t, n, e) {
|
|
341
|
+
const o = n || "";
|
|
342
|
+
if (!o)
|
|
343
|
+
throw new Error(
|
|
344
|
+
`Cannot download the model "${t}": no NOVA instance. Give defaultGetModel the URL of the instance or a NOVA client, or give the component its instanceUrl or getModel.`
|
|
345
|
+
);
|
|
346
|
+
const r = `${Kt(o)} ${t} ${e ?? ""}`, c = j.get(r);
|
|
347
|
+
if (c) return c;
|
|
348
|
+
const l = (async () => {
|
|
349
|
+
const i = Vt(o);
|
|
350
|
+
try {
|
|
351
|
+
const m = e ? await Et(
|
|
352
|
+
i,
|
|
353
|
+
t,
|
|
354
|
+
e,
|
|
355
|
+
"glb"
|
|
356
|
+
) : await i.api.motionGroupModels.getMotionGroupGlbModel(
|
|
357
|
+
t,
|
|
358
|
+
{ responseType: "blob" }
|
|
359
|
+
);
|
|
360
|
+
return URL.createObjectURL(m);
|
|
361
|
+
} catch (m) {
|
|
362
|
+
throw console.error("Failed to fetch model:", m), m;
|
|
363
|
+
}
|
|
364
|
+
})();
|
|
365
|
+
return j.set(r, l), l.catch(() => {
|
|
366
|
+
j.get(r) === l && j.delete(r);
|
|
367
|
+
}), l;
|
|
368
|
+
}
|
|
369
|
+
function Kt(t) {
|
|
370
|
+
return typeof t == "string" ? t : t.config.instanceUrl;
|
|
371
|
+
}
|
|
372
|
+
function lt(t) {
|
|
373
|
+
function n(e) {
|
|
374
|
+
return e.children.length === 0 ? [e] : [e, ...e.children.flatMap((o) => n(o))];
|
|
375
|
+
}
|
|
376
|
+
return n(t).filter((e) => ft(e));
|
|
377
|
+
}
|
|
378
|
+
function zt(t, n) {
|
|
379
|
+
return t.clone().multiply(new L().setFromAxisAngle(Yt, -n));
|
|
380
|
+
}
|
|
381
|
+
function te(t, n, e) {
|
|
382
|
+
const o = D(t);
|
|
383
|
+
if (o === null) return null;
|
|
384
|
+
const r = n[o];
|
|
385
|
+
if (!r || r.type === I.PrismaticJoint) return null;
|
|
386
|
+
const c = r.theta ?? 0, l = o === 0 && e ? e.position : t.position, i = o === 0 && e ? e.quaternion : t.quaternion;
|
|
387
|
+
return {
|
|
388
|
+
position: l,
|
|
389
|
+
frame: zt(i, c),
|
|
390
|
+
theta: c
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
function ee(t, n) {
|
|
394
|
+
var e;
|
|
395
|
+
return D(t) === 0 && ((e = n[0]) == null ? void 0 : e.type) === I.PrismaticJoint;
|
|
396
|
+
}
|
|
397
|
+
function ut(t) {
|
|
398
|
+
const n = new L().setFromEuler(st), e = n.clone().invert(), [o = 0, r = 0, c = 0] = (t == null ? void 0 : t.position) ?? [], l = new M(o, r, c).divideScalar(1e3).applyQuaternion(e), [i = 0, m = 0, p = 0] = (t == null ? void 0 : t.orientation) ?? [], h = e.clone().multiply(J([i, m, p], "ROTATION_VECTOR")).multiply(n);
|
|
399
|
+
return { position: l, quaternion: h };
|
|
400
|
+
}
|
|
401
|
+
function ne(t, n) {
|
|
402
|
+
const e = D(t);
|
|
403
|
+
if (e === null) return null;
|
|
404
|
+
const o = n[e];
|
|
405
|
+
return !o || o.type !== I.PrismaticJoint ? null : {
|
|
406
|
+
position: t.position.clone(),
|
|
407
|
+
quaternion: t.quaternion.clone()
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
function pt(t) {
|
|
411
|
+
return t.name.endsWith(Zt);
|
|
412
|
+
}
|
|
413
|
+
function ft(t) {
|
|
414
|
+
return ct.test(t.name);
|
|
415
|
+
}
|
|
416
|
+
function D(t) {
|
|
417
|
+
var e;
|
|
418
|
+
const n = (e = t.name.match(ct)) == null ? void 0 : e[1];
|
|
419
|
+
return n === void 0 ? null : Number.parseInt(n, 10);
|
|
420
|
+
}
|
|
421
|
+
function oe(t, n) {
|
|
422
|
+
let e;
|
|
423
|
+
function o(r) {
|
|
424
|
+
if (pt(r)) {
|
|
425
|
+
if (e)
|
|
426
|
+
throw Error(
|
|
427
|
+
`Found multiple flange groups in robot model ${n}; first ${e.name} then ${r.name}. Only one _FLG group is allowed.`
|
|
428
|
+
);
|
|
429
|
+
e = r;
|
|
430
|
+
}
|
|
431
|
+
ft(r), r.children.map(o);
|
|
432
|
+
}
|
|
433
|
+
if (o(t.scene), !e)
|
|
434
|
+
throw Error(
|
|
435
|
+
`No flange group found in robot model ${n}. Flange must be identified with a name ending in _FLG.`
|
|
436
|
+
);
|
|
437
|
+
return { gltf: t };
|
|
438
|
+
}
|
|
439
|
+
const ht = Y(function({
|
|
440
|
+
rapidlyChangingMotionState: n,
|
|
441
|
+
dhParameters: e,
|
|
442
|
+
chainOffsetPosition: o,
|
|
443
|
+
chainOffsetQuaternion: r,
|
|
444
|
+
onTranslationChanged: c,
|
|
445
|
+
children: l
|
|
446
|
+
}, i) {
|
|
447
|
+
const m = b(null), p = b([]), h = b(
|
|
448
|
+
n.joint_position.filter(
|
|
449
|
+
(d) => d !== void 0
|
|
450
|
+
)
|
|
451
|
+
), { invalidate: s } = F(), y = b(n);
|
|
452
|
+
y.current = n;
|
|
453
|
+
function g(d) {
|
|
454
|
+
m.current = d, d && f();
|
|
455
|
+
}
|
|
456
|
+
function f() {
|
|
457
|
+
m.current && (p.current = lt(m.current), u(), s());
|
|
458
|
+
}
|
|
459
|
+
Z(i, () => ({ recollectJoints: f }));
|
|
460
|
+
function u() {
|
|
461
|
+
const d = h.current;
|
|
462
|
+
if (c)
|
|
463
|
+
c(p.current, d);
|
|
464
|
+
else
|
|
465
|
+
for (const [v, _] of p.current.entries()) {
|
|
466
|
+
const O = e[v];
|
|
467
|
+
if ((O == null ? void 0 : O.type) !== I.PrismaticJoint) continue;
|
|
468
|
+
const E = O.reverse_rotation_direction ? -1 : 1;
|
|
469
|
+
_.position.y = E * (d[v] || 0) / 1e3;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
function w(d) {
|
|
473
|
+
h.current = d.joint_position.filter(
|
|
474
|
+
(v) => v !== void 0
|
|
475
|
+
), u(), s();
|
|
476
|
+
}
|
|
477
|
+
return ot(() => {
|
|
478
|
+
w(y.current);
|
|
479
|
+
}), A(() => {
|
|
480
|
+
w(n);
|
|
481
|
+
}, [n]), /* @__PURE__ */ a(
|
|
482
|
+
"group",
|
|
483
|
+
{
|
|
484
|
+
ref: g,
|
|
485
|
+
position: o,
|
|
486
|
+
quaternion: r,
|
|
487
|
+
children: l
|
|
488
|
+
}
|
|
489
|
+
);
|
|
490
|
+
});
|
|
491
|
+
function re({
|
|
492
|
+
rapidlyChangingMotionState: t,
|
|
493
|
+
dhParameters: n,
|
|
494
|
+
...e
|
|
495
|
+
}) {
|
|
496
|
+
const o = new T(), r = b(null), c = b(null);
|
|
497
|
+
function l(p) {
|
|
498
|
+
const h = new T();
|
|
499
|
+
for (let f = 0; f < n.length; f++) {
|
|
500
|
+
const u = n[f], w = p[f] ?? 0, d = new T().makeRotationY(u.theta).multiply(
|
|
501
|
+
new T().makeTranslation(
|
|
502
|
+
u.a / 1e3,
|
|
503
|
+
(u.d + w * (u.reverse_rotation_direction ? -1 : 1)) / 1e3,
|
|
504
|
+
0
|
|
505
|
+
)
|
|
506
|
+
).multiply(new T().makeRotationX(u.alpha));
|
|
507
|
+
h.multiply(d);
|
|
508
|
+
}
|
|
509
|
+
const s = new M(), y = new L(), g = new M();
|
|
510
|
+
return h.decompose(s, y, g), s;
|
|
511
|
+
}
|
|
512
|
+
const i = l(
|
|
513
|
+
t.joint_position
|
|
514
|
+
);
|
|
515
|
+
function m(p, h) {
|
|
516
|
+
o.identity();
|
|
517
|
+
let s = new M();
|
|
518
|
+
for (let u = 0; u < n.length; u++) {
|
|
519
|
+
const w = h[u] ?? 0, d = n[u], v = new T().makeRotationY(d.theta).multiply(
|
|
520
|
+
new T().makeTranslation(
|
|
521
|
+
d.a / 1e3,
|
|
522
|
+
(d.d + w * (d.reverse_rotation_direction ? -1 : 1)) / 1e3,
|
|
523
|
+
0
|
|
524
|
+
)
|
|
525
|
+
).multiply(new T().makeRotationX(d.alpha));
|
|
526
|
+
o.multiply(v);
|
|
527
|
+
}
|
|
528
|
+
const y = new M(), g = new L(), f = new M();
|
|
529
|
+
if (o.decompose(y, g, f), s = y, r.current && r.current.position.set(
|
|
530
|
+
s.x,
|
|
531
|
+
s.y,
|
|
532
|
+
s.z
|
|
533
|
+
), c.current) {
|
|
534
|
+
const u = c.current.geometry;
|
|
535
|
+
u != null && u.setPositions && u.setPositions([
|
|
536
|
+
0,
|
|
537
|
+
0,
|
|
538
|
+
0,
|
|
539
|
+
s.x,
|
|
540
|
+
s.y,
|
|
541
|
+
s.z
|
|
542
|
+
]);
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
return /* @__PURE__ */ a(
|
|
546
|
+
ht,
|
|
547
|
+
{
|
|
548
|
+
rapidlyChangingMotionState: t,
|
|
549
|
+
dhParameters: n,
|
|
550
|
+
onTranslationChanged: m,
|
|
551
|
+
children: /* @__PURE__ */ S("group", { ...e, name: "Scene", children: [
|
|
552
|
+
/* @__PURE__ */ S("mesh", { name: "Base", position: [0, 0, 0], children: [
|
|
553
|
+
/* @__PURE__ */ a("sphereGeometry", { args: [0.02, 32, 32] }),
|
|
554
|
+
/* @__PURE__ */ a("meshStandardMaterial", { color: "green", depthTest: !0 })
|
|
555
|
+
] }),
|
|
556
|
+
/* @__PURE__ */ a(
|
|
557
|
+
z,
|
|
558
|
+
{
|
|
559
|
+
ref: c,
|
|
560
|
+
points: [new M(0, 0, 0), i],
|
|
561
|
+
color: "White",
|
|
562
|
+
lineWidth: 5
|
|
563
|
+
}
|
|
564
|
+
),
|
|
565
|
+
/* @__PURE__ */ S("mesh", { ref: r, name: "TCP", position: i, children: [
|
|
566
|
+
/* @__PURE__ */ a("sphereGeometry", { args: [0.025, 32, 32] }),
|
|
567
|
+
/* @__PURE__ */ a("meshStandardMaterial", { color: "red", depthTest: !0 })
|
|
568
|
+
] })
|
|
569
|
+
] })
|
|
570
|
+
}
|
|
571
|
+
);
|
|
572
|
+
}
|
|
573
|
+
function ie(t) {
|
|
574
|
+
return t.type === "Mesh";
|
|
575
|
+
}
|
|
576
|
+
function se({
|
|
577
|
+
url: t,
|
|
578
|
+
flangeRef: n,
|
|
579
|
+
postModelRender: e,
|
|
580
|
+
dhParameters: o = [],
|
|
581
|
+
kinematicChainOffset: r,
|
|
582
|
+
...c
|
|
583
|
+
}) {
|
|
584
|
+
const l = xt(t), m = oe(l, "robot.glb").gltf, p = x(
|
|
585
|
+
() => ut(r),
|
|
586
|
+
[r]
|
|
587
|
+
);
|
|
588
|
+
A(() => {
|
|
589
|
+
e == null || e();
|
|
590
|
+
}, [t, e]);
|
|
591
|
+
function h(s) {
|
|
592
|
+
try {
|
|
593
|
+
if (ie(s))
|
|
594
|
+
return s.geometry ? /* @__PURE__ */ a(
|
|
595
|
+
"mesh",
|
|
596
|
+
{
|
|
597
|
+
name: s.name,
|
|
598
|
+
geometry: s.geometry,
|
|
599
|
+
material: s.material,
|
|
600
|
+
position: s.position,
|
|
601
|
+
rotation: s.rotation
|
|
602
|
+
},
|
|
603
|
+
s.uuid
|
|
604
|
+
) : /* @__PURE__ */ a(
|
|
605
|
+
"group",
|
|
606
|
+
{
|
|
607
|
+
name: s.name,
|
|
608
|
+
position: s.position,
|
|
609
|
+
rotation: s.rotation
|
|
610
|
+
},
|
|
611
|
+
s.uuid
|
|
612
|
+
);
|
|
613
|
+
if (ee(s, o))
|
|
614
|
+
return /* @__PURE__ */ a(
|
|
615
|
+
"group",
|
|
616
|
+
{
|
|
617
|
+
name: `${s.name}${P}`,
|
|
618
|
+
position: p.position,
|
|
619
|
+
quaternion: p.quaternion,
|
|
620
|
+
children: /* @__PURE__ */ a("group", { name: s.name, children: s.children.map(h) })
|
|
621
|
+
},
|
|
622
|
+
s.uuid
|
|
623
|
+
);
|
|
624
|
+
const y = ne(s, o);
|
|
625
|
+
if (y)
|
|
626
|
+
return /* @__PURE__ */ a(
|
|
627
|
+
"group",
|
|
628
|
+
{
|
|
629
|
+
name: `${s.name}${P}`,
|
|
630
|
+
position: y.position,
|
|
631
|
+
quaternion: y.quaternion,
|
|
632
|
+
children: /* @__PURE__ */ a("group", { name: s.name, children: s.children.map(h) })
|
|
633
|
+
},
|
|
634
|
+
s.uuid
|
|
635
|
+
);
|
|
636
|
+
const g = te(
|
|
637
|
+
s,
|
|
638
|
+
o,
|
|
639
|
+
r ? p : void 0
|
|
640
|
+
);
|
|
641
|
+
return g ? /* @__PURE__ */ a(
|
|
642
|
+
"group",
|
|
643
|
+
{
|
|
644
|
+
name: `${s.name}${P}`,
|
|
645
|
+
position: g.position,
|
|
646
|
+
quaternion: g.frame,
|
|
647
|
+
children: /* @__PURE__ */ a("group", { name: s.name, rotation: [0, g.theta, 0], children: s.children.map(h) })
|
|
648
|
+
},
|
|
649
|
+
s.uuid
|
|
650
|
+
) : /* @__PURE__ */ a(
|
|
651
|
+
"group",
|
|
652
|
+
{
|
|
653
|
+
name: s.name,
|
|
654
|
+
position: s.position,
|
|
655
|
+
rotation: s.rotation,
|
|
656
|
+
ref: pt(s) ? n : void 0,
|
|
657
|
+
children: s.children.map(h)
|
|
658
|
+
},
|
|
659
|
+
s.uuid
|
|
660
|
+
);
|
|
661
|
+
} catch (y) {
|
|
662
|
+
return console.warn("Error rendering node", s.name, y), null;
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
return /* @__PURE__ */ a("group", { ...c, dispose: null, children: h(m.scene) });
|
|
666
|
+
}
|
|
667
|
+
function mt({
|
|
668
|
+
modelURL: t,
|
|
669
|
+
flangeRef: n,
|
|
670
|
+
postModelRender: e,
|
|
671
|
+
dhParameters: o,
|
|
672
|
+
kinematicChainOffset: r,
|
|
673
|
+
...c
|
|
674
|
+
}) {
|
|
675
|
+
const [l, i] = C(null);
|
|
676
|
+
return A(() => {
|
|
677
|
+
let m = !1;
|
|
678
|
+
return (async () => {
|
|
679
|
+
try {
|
|
680
|
+
const h = typeof t == "string" ? t : await t;
|
|
681
|
+
m || i((s) => s === h ? s : h);
|
|
682
|
+
} catch (h) {
|
|
683
|
+
console.error("Failed to resolve model URL:", h);
|
|
684
|
+
}
|
|
685
|
+
})(), () => {
|
|
686
|
+
m = !0;
|
|
687
|
+
};
|
|
688
|
+
}, [t]), l ? /* @__PURE__ */ a(
|
|
689
|
+
se,
|
|
690
|
+
{
|
|
691
|
+
url: l,
|
|
692
|
+
flangeRef: n,
|
|
693
|
+
postModelRender: e,
|
|
694
|
+
dhParameters: o,
|
|
695
|
+
kinematicChainOffset: r,
|
|
696
|
+
...c
|
|
697
|
+
}
|
|
698
|
+
) : null;
|
|
699
|
+
}
|
|
700
|
+
const Q = (t, n) => {
|
|
701
|
+
const e = [];
|
|
702
|
+
t.traverse((o) => {
|
|
703
|
+
o instanceof R.Mesh && !o.userData.isGhost && !o.userData.hasGhost && e.push(o);
|
|
704
|
+
});
|
|
705
|
+
for (const o of e) {
|
|
706
|
+
if (!o.parent) continue;
|
|
707
|
+
const r = o.clone();
|
|
708
|
+
r.visible = !0, r.material = new R.MeshStandardMaterial({
|
|
709
|
+
depthTest: !0,
|
|
710
|
+
depthWrite: !0,
|
|
711
|
+
colorWrite: !1,
|
|
712
|
+
polygonOffset: !0,
|
|
713
|
+
polygonOffsetFactor: -1,
|
|
714
|
+
side: R.DoubleSide
|
|
715
|
+
}), r.userData.isGhost = !0;
|
|
716
|
+
const c = o.clone();
|
|
717
|
+
c.visible = !0, c.material = new R.MeshStandardMaterial({
|
|
718
|
+
color: n,
|
|
719
|
+
opacity: 0.3,
|
|
720
|
+
depthTest: !0,
|
|
721
|
+
depthWrite: !1,
|
|
722
|
+
transparent: !0,
|
|
723
|
+
polygonOffset: !0,
|
|
724
|
+
polygonOffsetFactor: -2,
|
|
725
|
+
side: R.DoubleSide
|
|
726
|
+
}), c.userData.isGhost = !0, o.parent.add(r), o.parent.add(c), o.visible = !1, o.userData.hasGhost = !0;
|
|
727
|
+
}
|
|
728
|
+
}, ae = (t) => {
|
|
729
|
+
var e;
|
|
730
|
+
const n = [];
|
|
731
|
+
t.traverse((o) => {
|
|
732
|
+
o instanceof R.Mesh && (o.userData.isGhost ? n.push(o) : o.userData.hasGhost && (o.visible = !0, o.userData.hasGhost = !1));
|
|
733
|
+
});
|
|
734
|
+
for (const o of n)
|
|
735
|
+
(e = o.parent) == null || e.remove(o), o.material instanceof R.Material && o.material.dispose();
|
|
736
|
+
};
|
|
737
|
+
function dt(t) {
|
|
738
|
+
const n = b(null), e = b(t);
|
|
739
|
+
e.current = t, A(() => {
|
|
740
|
+
const r = n.current;
|
|
741
|
+
r && (ae(r), t && Q(r, t));
|
|
742
|
+
}, [t]);
|
|
743
|
+
const o = q(() => {
|
|
744
|
+
const r = n.current;
|
|
745
|
+
r && e.current && Q(r, e.current);
|
|
746
|
+
}, []);
|
|
747
|
+
return { groupRef: n, styleDrawnModel: o };
|
|
748
|
+
}
|
|
749
|
+
function $(t) {
|
|
750
|
+
const n = F((c) => c.invalidate), [e] = C(
|
|
751
|
+
() => Ct({ ...t })
|
|
752
|
+
), [o] = C(() => new nt(X(t))), r = b(null);
|
|
753
|
+
return et((c, l) => {
|
|
754
|
+
const i = r.current;
|
|
755
|
+
if (i === null) return;
|
|
756
|
+
const m = Math.min(l, (performance.now() - i) / 1e3), p = o.update(m);
|
|
757
|
+
it(() => {
|
|
758
|
+
e.joint_position = o.getCurrentValues();
|
|
759
|
+
}), p ? r.current = null : n();
|
|
760
|
+
}), A(
|
|
761
|
+
() => rt(() => {
|
|
762
|
+
o.setTarget(X(t)), ce(t, e), r.current ?? (r.current = performance.now()), n();
|
|
763
|
+
}),
|
|
764
|
+
[t, e, o, n]
|
|
765
|
+
), e;
|
|
766
|
+
}
|
|
767
|
+
function X(t) {
|
|
768
|
+
return t.joint_position.filter(
|
|
769
|
+
(n) => n !== void 0
|
|
770
|
+
);
|
|
771
|
+
}
|
|
772
|
+
function ce(t, n) {
|
|
773
|
+
it(() => {
|
|
774
|
+
const e = t, o = n;
|
|
775
|
+
for (const r of Object.keys(e))
|
|
776
|
+
r !== "joint_position" && o[r] !== e[r] && (o[r] = e[r]);
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
const yt = V(
|
|
780
|
+
({
|
|
781
|
+
rapidlyChangingMotionState: t,
|
|
782
|
+
modelFromController: n,
|
|
783
|
+
dhParameters: e,
|
|
784
|
+
serialNumber: o,
|
|
785
|
+
kinematicChainOffset: r,
|
|
786
|
+
chainOffsetPosition: c,
|
|
787
|
+
chainOffsetQuaternion: l,
|
|
788
|
+
getModel: i = N,
|
|
789
|
+
flangeRef: m,
|
|
790
|
+
postModelRender: p,
|
|
791
|
+
transparentColor: h,
|
|
792
|
+
instanceUrl: s,
|
|
793
|
+
...y
|
|
794
|
+
}) => {
|
|
795
|
+
const g = b(null), f = dt(h), { styleDrawnModel: u } = f, w = q(() => {
|
|
796
|
+
var _;
|
|
797
|
+
(_ = g.current) == null || _.recollectJoints(), u(), p == null || p();
|
|
798
|
+
}, [p, u]), d = x(() => {
|
|
799
|
+
const _ = i(n, s, o);
|
|
800
|
+
if (!_) {
|
|
801
|
+
const O = new Blob([], { type: "model/gltf-binary" }), E = new File([O], `${n}.glb`, {
|
|
802
|
+
type: "model/gltf-binary"
|
|
803
|
+
});
|
|
804
|
+
return Promise.resolve(URL.createObjectURL(E));
|
|
805
|
+
}
|
|
806
|
+
return _;
|
|
807
|
+
}, [n, s, o, i]), v = /* @__PURE__ */ a(
|
|
808
|
+
re,
|
|
809
|
+
{
|
|
810
|
+
rapidlyChangingMotionState: t,
|
|
811
|
+
dhParameters: e,
|
|
812
|
+
...y
|
|
813
|
+
}
|
|
814
|
+
);
|
|
815
|
+
return /* @__PURE__ */ S(
|
|
816
|
+
tt,
|
|
817
|
+
{
|
|
818
|
+
fallback: v,
|
|
819
|
+
onError: (_) => {
|
|
820
|
+
console.warn(_);
|
|
821
|
+
},
|
|
822
|
+
children: [
|
|
823
|
+
/* @__PURE__ */ a(K, { fallback: v, children: /* @__PURE__ */ a("group", { ref: f.groupRef, children: /* @__PURE__ */ a(
|
|
824
|
+
ht,
|
|
825
|
+
{
|
|
826
|
+
ref: g,
|
|
827
|
+
rapidlyChangingMotionState: t,
|
|
828
|
+
dhParameters: e,
|
|
829
|
+
chainOffsetPosition: c,
|
|
830
|
+
chainOffsetQuaternion: l,
|
|
831
|
+
children: /* @__PURE__ */ a(
|
|
832
|
+
mt,
|
|
833
|
+
{
|
|
834
|
+
modelURL: d,
|
|
835
|
+
postModelRender: w,
|
|
836
|
+
flangeRef: m,
|
|
837
|
+
dhParameters: e,
|
|
838
|
+
kinematicChainOffset: r,
|
|
839
|
+
...y
|
|
840
|
+
}
|
|
841
|
+
)
|
|
842
|
+
}
|
|
843
|
+
) }) }),
|
|
844
|
+
/* @__PURE__ */ a(at, {})
|
|
845
|
+
]
|
|
846
|
+
}
|
|
847
|
+
);
|
|
848
|
+
}
|
|
849
|
+
), je = V(
|
|
850
|
+
({ rapidlyChangingMotionState: t, ...n }) => {
|
|
851
|
+
const e = $(
|
|
852
|
+
t
|
|
853
|
+
);
|
|
854
|
+
return /* @__PURE__ */ a(
|
|
855
|
+
yt,
|
|
856
|
+
{
|
|
857
|
+
rapidlyChangingMotionState: e,
|
|
858
|
+
...n
|
|
859
|
+
}
|
|
860
|
+
);
|
|
861
|
+
}
|
|
862
|
+
), gt = Y(
|
|
863
|
+
function({
|
|
864
|
+
rapidlyChangingMotionState: n,
|
|
865
|
+
dhParameters: e,
|
|
866
|
+
chainOffsetPosition: o,
|
|
867
|
+
chainOffsetQuaternion: r,
|
|
868
|
+
onRotationChanged: c,
|
|
869
|
+
children: l
|
|
870
|
+
}, i) {
|
|
871
|
+
const m = b(null), p = b([]), h = b(
|
|
872
|
+
n.joint_position.filter(
|
|
873
|
+
(d) => d !== void 0
|
|
874
|
+
)
|
|
875
|
+
), { invalidate: s } = F(), y = b(n);
|
|
876
|
+
y.current = n;
|
|
877
|
+
function g(d) {
|
|
878
|
+
m.current = d, d && f();
|
|
879
|
+
}
|
|
880
|
+
function f() {
|
|
881
|
+
m.current && (p.current = lt(m.current), u(), s());
|
|
882
|
+
}
|
|
883
|
+
Z(i, () => ({ recollectJoints: f }));
|
|
884
|
+
function u() {
|
|
885
|
+
const d = h.current;
|
|
886
|
+
if (c)
|
|
887
|
+
c(p.current, d);
|
|
888
|
+
else
|
|
889
|
+
for (const [v, _] of p.current.entries()) {
|
|
890
|
+
const O = e[v];
|
|
891
|
+
if (!O) continue;
|
|
892
|
+
const E = O.theta || 0, Rt = O.reverse_rotation_direction ? -1 : 1;
|
|
893
|
+
_.rotation.y = Rt * (d[v] || 0) + E;
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
function w(d) {
|
|
897
|
+
h.current = d.joint_position.filter(
|
|
898
|
+
(v) => v !== void 0
|
|
899
|
+
), u(), s();
|
|
900
|
+
}
|
|
901
|
+
return ot(() => {
|
|
902
|
+
w(y.current);
|
|
903
|
+
}), A(() => {
|
|
904
|
+
w(n);
|
|
905
|
+
}, [n]), /* @__PURE__ */ a(
|
|
906
|
+
"group",
|
|
907
|
+
{
|
|
908
|
+
ref: g,
|
|
909
|
+
position: o,
|
|
910
|
+
quaternion: r,
|
|
911
|
+
children: l
|
|
912
|
+
}
|
|
913
|
+
);
|
|
914
|
+
}
|
|
915
|
+
), le = "line", ue = "mesh";
|
|
916
|
+
function pe({
|
|
917
|
+
rapidlyChangingMotionState: t,
|
|
918
|
+
dhParameters: n,
|
|
919
|
+
kinematicChainOffset: e,
|
|
920
|
+
...o
|
|
921
|
+
}) {
|
|
922
|
+
const r = new T(), c = b([]), l = b([]), i = ut(e);
|
|
923
|
+
Tt.useEffect(() => {
|
|
924
|
+
c.current = new Array(n.length).fill(null), l.current = new Array(n.length).fill(null);
|
|
925
|
+
}, [n.length]);
|
|
926
|
+
function m(s, y) {
|
|
927
|
+
const g = new M(), f = new L(), u = new M();
|
|
928
|
+
r.decompose(g, f, u);
|
|
929
|
+
const w = g.clone(), d = new T().makeRotationY(
|
|
930
|
+
s.theta + y * (s.reverse_rotation_direction ? -1 : 1)
|
|
931
|
+
).multiply(new T().makeTranslation(0, s.d / 1e3, 0)).multiply(new T().makeTranslation(s.a / 1e3, 0, 0)).multiply(new T().makeRotationX(s.alpha));
|
|
932
|
+
return r.multiply(d), r.decompose(g, f, u), { a: w, b: g };
|
|
933
|
+
}
|
|
934
|
+
function p(s, y, g, f) {
|
|
935
|
+
if (!n)
|
|
936
|
+
return;
|
|
937
|
+
const u = n[s];
|
|
938
|
+
if (!u)
|
|
939
|
+
return;
|
|
940
|
+
const { a: w, b: d } = m(u, f);
|
|
941
|
+
y.geometry.setPositions([w.toArray(), d.toArray()].flat()), g.position.set(d.x, d.y, d.z);
|
|
942
|
+
}
|
|
943
|
+
function h(s, y) {
|
|
944
|
+
r.identity();
|
|
945
|
+
for (let g = 0; g < Math.min(s.length, y.length); g++) {
|
|
946
|
+
const f = c.current[g], u = l.current[g];
|
|
947
|
+
f && u && p(g, f, u, y[g]);
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
return /* @__PURE__ */ a(
|
|
951
|
+
gt,
|
|
952
|
+
{
|
|
953
|
+
rapidlyChangingMotionState: t,
|
|
954
|
+
dhParameters: n,
|
|
955
|
+
onRotationChanged: h,
|
|
956
|
+
children: /* @__PURE__ */ a("group", { ...o, name: "Scene", children: /* @__PURE__ */ S(
|
|
957
|
+
"group",
|
|
958
|
+
{
|
|
959
|
+
position: i.position,
|
|
960
|
+
quaternion: i.quaternion,
|
|
961
|
+
children: [
|
|
962
|
+
/* @__PURE__ */ S("mesh", { children: [
|
|
963
|
+
/* @__PURE__ */ a("sphereGeometry", { args: [0.01, 32, 32] }),
|
|
964
|
+
/* @__PURE__ */ a("meshStandardMaterial", { color: "black", depthTest: !0 })
|
|
965
|
+
] }),
|
|
966
|
+
n == null ? void 0 : n.map((s, y) => {
|
|
967
|
+
const { a: g, b: f } = m(
|
|
968
|
+
s,
|
|
969
|
+
t.joint_position[y] ?? 0
|
|
970
|
+
), u = `dhrobot_J0${y}`;
|
|
971
|
+
return /* @__PURE__ */ S("group", { name: u, children: [
|
|
972
|
+
/* @__PURE__ */ a(
|
|
973
|
+
z,
|
|
974
|
+
{
|
|
975
|
+
ref: (w) => {
|
|
976
|
+
c.current[y] = w;
|
|
977
|
+
},
|
|
978
|
+
name: le,
|
|
979
|
+
points: [g, f],
|
|
980
|
+
color: "white",
|
|
981
|
+
lineWidth: 5
|
|
982
|
+
}
|
|
983
|
+
),
|
|
984
|
+
/* @__PURE__ */ S(
|
|
985
|
+
"mesh",
|
|
986
|
+
{
|
|
987
|
+
ref: (w) => {
|
|
988
|
+
l.current[y] = w;
|
|
989
|
+
},
|
|
990
|
+
name: ue,
|
|
991
|
+
position: f,
|
|
992
|
+
children: [
|
|
993
|
+
/* @__PURE__ */ a("sphereGeometry", { args: [0.01, 32, 32] }),
|
|
994
|
+
/* @__PURE__ */ a("meshStandardMaterial", { color: "black", depthTest: !0 })
|
|
995
|
+
]
|
|
996
|
+
},
|
|
997
|
+
`mesh_${y}`
|
|
998
|
+
)
|
|
999
|
+
] }, u);
|
|
1000
|
+
})
|
|
1001
|
+
]
|
|
1002
|
+
}
|
|
1003
|
+
) })
|
|
1004
|
+
}
|
|
1005
|
+
);
|
|
1006
|
+
}
|
|
1007
|
+
const wt = V(
|
|
1008
|
+
({
|
|
1009
|
+
rapidlyChangingMotionState: t,
|
|
1010
|
+
modelFromController: n,
|
|
1011
|
+
dhParameters: e,
|
|
1012
|
+
serialNumber: o,
|
|
1013
|
+
kinematicChainOffset: r,
|
|
1014
|
+
chainOffsetPosition: c,
|
|
1015
|
+
chainOffsetQuaternion: l,
|
|
1016
|
+
getModel: i = N,
|
|
1017
|
+
flangeRef: m,
|
|
1018
|
+
postModelRender: p,
|
|
1019
|
+
transparentColor: h,
|
|
1020
|
+
instanceUrl: s,
|
|
1021
|
+
...y
|
|
1022
|
+
}) => {
|
|
1023
|
+
const g = b(null), f = dt(h), { styleDrawnModel: u } = f, w = q(() => {
|
|
1024
|
+
var _;
|
|
1025
|
+
(_ = g.current) == null || _.recollectJoints(), u(), p == null || p();
|
|
1026
|
+
}, [p, u]), d = x(() => {
|
|
1027
|
+
const _ = i(n, s, o);
|
|
1028
|
+
if (!_)
|
|
1029
|
+
throw new Error(
|
|
1030
|
+
`No model found for robot "${n}". Ensure the model is available or provide a custom getModel function.`
|
|
1031
|
+
);
|
|
1032
|
+
return _;
|
|
1033
|
+
}, [n, s, o, i]), v = /* @__PURE__ */ a(
|
|
1034
|
+
pe,
|
|
1035
|
+
{
|
|
1036
|
+
rapidlyChangingMotionState: t,
|
|
1037
|
+
dhParameters: e,
|
|
1038
|
+
kinematicChainOffset: r,
|
|
1039
|
+
...y
|
|
1040
|
+
}
|
|
1041
|
+
);
|
|
1042
|
+
return /* @__PURE__ */ S(
|
|
1043
|
+
tt,
|
|
1044
|
+
{
|
|
1045
|
+
fallback: v,
|
|
1046
|
+
onError: (_) => {
|
|
1047
|
+
console.warn(_);
|
|
1048
|
+
},
|
|
1049
|
+
children: [
|
|
1050
|
+
/* @__PURE__ */ a(K, { fallback: v, children: /* @__PURE__ */ a("group", { ref: f.groupRef, children: /* @__PURE__ */ a(
|
|
1051
|
+
gt,
|
|
1052
|
+
{
|
|
1053
|
+
ref: g,
|
|
1054
|
+
rapidlyChangingMotionState: t,
|
|
1055
|
+
dhParameters: e,
|
|
1056
|
+
chainOffsetPosition: c,
|
|
1057
|
+
chainOffsetQuaternion: l,
|
|
1058
|
+
children: /* @__PURE__ */ a(
|
|
1059
|
+
mt,
|
|
1060
|
+
{
|
|
1061
|
+
modelURL: d,
|
|
1062
|
+
postModelRender: w,
|
|
1063
|
+
flangeRef: m,
|
|
1064
|
+
dhParameters: e,
|
|
1065
|
+
kinematicChainOffset: r,
|
|
1066
|
+
...y
|
|
1067
|
+
}
|
|
1068
|
+
)
|
|
1069
|
+
}
|
|
1070
|
+
) }) }),
|
|
1071
|
+
/* @__PURE__ */ a(at, {})
|
|
1072
|
+
]
|
|
1073
|
+
}
|
|
1074
|
+
);
|
|
1075
|
+
}
|
|
1076
|
+
), Ce = V(
|
|
1077
|
+
({ rapidlyChangingMotionState: t, ...n }) => {
|
|
1078
|
+
const e = $(
|
|
1079
|
+
t
|
|
1080
|
+
);
|
|
1081
|
+
return /* @__PURE__ */ a(
|
|
1082
|
+
wt,
|
|
1083
|
+
{
|
|
1084
|
+
rapidlyChangingMotionState: e,
|
|
1085
|
+
...n
|
|
1086
|
+
}
|
|
1087
|
+
);
|
|
1088
|
+
}
|
|
1089
|
+
), vt = V((t) => {
|
|
1090
|
+
const { inverseSolver: n, dhParameters: e, ...o } = t, [r, c] = C(
|
|
1091
|
+
I.RevoluteJoint
|
|
1092
|
+
);
|
|
1093
|
+
A(() => {
|
|
1094
|
+
e.length && c(e[0].type ?? I.RevoluteJoint);
|
|
1095
|
+
}, [e]);
|
|
1096
|
+
const l = x(() => n === null && r === I.RevoluteJoint, [n, r]), i = x(() => n === null && r === I.PrismaticJoint, [n, r]);
|
|
1097
|
+
return x(() => !!n, [n]) || l ? /* @__PURE__ */ a(wt, { dhParameters: e, ...o }) : i ? /* @__PURE__ */ a(yt, { dhParameters: e, ...o }) : null;
|
|
1098
|
+
}), fe = V((t) => {
|
|
1099
|
+
const n = $(
|
|
1100
|
+
t.rapidlyChangingMotionState
|
|
1101
|
+
);
|
|
1102
|
+
return /* @__PURE__ */ a(
|
|
1103
|
+
vt,
|
|
1104
|
+
{
|
|
1105
|
+
...t,
|
|
1106
|
+
rapidlyChangingMotionState: n
|
|
1107
|
+
}
|
|
1108
|
+
);
|
|
1109
|
+
}), he = [-4, 1, 4], me = {
|
|
1110
|
+
timestamp: "",
|
|
1111
|
+
sequence_number: 0,
|
|
1112
|
+
motion_group: "",
|
|
1113
|
+
controller: "",
|
|
1114
|
+
joint_limit_reached: { limit_reached: [] },
|
|
1115
|
+
standstill: !0,
|
|
1116
|
+
description_revision: 0
|
|
1117
|
+
};
|
|
1118
|
+
function de({
|
|
1119
|
+
robot: t,
|
|
1120
|
+
getModel: n,
|
|
1121
|
+
safetyZones: e,
|
|
1122
|
+
plannedJoints: o,
|
|
1123
|
+
jogAxes: r,
|
|
1124
|
+
robotVisible: c = !0,
|
|
1125
|
+
robotRef: l,
|
|
1126
|
+
onModelDrawn: i,
|
|
1127
|
+
lighting: m = !0,
|
|
1128
|
+
children: p
|
|
1129
|
+
}) {
|
|
1130
|
+
const h = St(), s = t.nova, y = q(
|
|
1131
|
+
(w, d, v) => N(w, s, v),
|
|
1132
|
+
[s]
|
|
1133
|
+
), g = n ?? y, f = x(
|
|
1134
|
+
() => o ? { ...me, joint_position: o } : null,
|
|
1135
|
+
[o]
|
|
1136
|
+
);
|
|
1137
|
+
if (!t.dhParameters) return null;
|
|
1138
|
+
const u = {
|
|
1139
|
+
// The model comes from loadModel
|
|
1140
|
+
instanceUrl: "",
|
|
1141
|
+
getModel: g,
|
|
1142
|
+
inverseSolver: t.inverseSolver,
|
|
1143
|
+
modelFromController: t.modelFromController ?? "",
|
|
1144
|
+
serialNumber: t.serialNumber,
|
|
1145
|
+
dhParameters: t.dhParameters,
|
|
1146
|
+
kinematicChainOffset: t.kinematicChainOffset
|
|
1147
|
+
};
|
|
1148
|
+
return /* @__PURE__ */ S(k, { children: [
|
|
1149
|
+
e && /* @__PURE__ */ a(
|
|
1150
|
+
$t,
|
|
1151
|
+
{
|
|
1152
|
+
safetyZones: e,
|
|
1153
|
+
dhParameters: t.dhParameters
|
|
1154
|
+
}
|
|
1155
|
+
),
|
|
1156
|
+
/* @__PURE__ */ a(
|
|
1157
|
+
"group",
|
|
1158
|
+
{
|
|
1159
|
+
ref: l,
|
|
1160
|
+
position: t.mountingPosition,
|
|
1161
|
+
quaternion: t.mountingQuaternion,
|
|
1162
|
+
children: /* @__PURE__ */ S("group", { rotation: st, children: [
|
|
1163
|
+
/* @__PURE__ */ a("group", { visible: c, children: /* @__PURE__ */ a(
|
|
1164
|
+
fe,
|
|
1165
|
+
{
|
|
1166
|
+
...u,
|
|
1167
|
+
rapidlyChangingMotionState: t.rapidlyChangingMotionState,
|
|
1168
|
+
postModelRender: i
|
|
1169
|
+
}
|
|
1170
|
+
) }),
|
|
1171
|
+
f && /* @__PURE__ */ a(
|
|
1172
|
+
vt,
|
|
1173
|
+
{
|
|
1174
|
+
...u,
|
|
1175
|
+
rapidlyChangingMotionState: f,
|
|
1176
|
+
transparentColor: h.palette.success.main
|
|
1177
|
+
}
|
|
1178
|
+
),
|
|
1179
|
+
m && /* @__PURE__ */ a(
|
|
1180
|
+
"directionalLight",
|
|
1181
|
+
{
|
|
1182
|
+
position: he,
|
|
1183
|
+
castShadow: !0,
|
|
1184
|
+
intensity: 1
|
|
1185
|
+
}
|
|
1186
|
+
)
|
|
1187
|
+
] })
|
|
1188
|
+
}
|
|
1189
|
+
),
|
|
1190
|
+
r && /* @__PURE__ */ a(Qt, { ...r }),
|
|
1191
|
+
m && /* @__PURE__ */ a(Ft, {}),
|
|
1192
|
+
p
|
|
1193
|
+
] });
|
|
1194
|
+
}
|
|
1195
|
+
function ye(t) {
|
|
1196
|
+
var r, c, l, i, m, p;
|
|
1197
|
+
const { description: n, state: e } = t, o = n.mounting;
|
|
1198
|
+
return {
|
|
1199
|
+
nova: t.nova,
|
|
1200
|
+
modelFromController: n.motionGroupModel,
|
|
1201
|
+
dhParameters: n.dhParameters,
|
|
1202
|
+
inverseSolver: n.inverseSolver,
|
|
1203
|
+
serialNumber: n.serialNumber,
|
|
1204
|
+
kinematicChainOffset: n.kinematicChainOffset,
|
|
1205
|
+
rapidlyChangingMotionState: e.rapidlyChangingMotionState,
|
|
1206
|
+
mountingPosition: [
|
|
1207
|
+
(((r = o == null ? void 0 : o.position) == null ? void 0 : r[0]) ?? 0) / 1e3,
|
|
1208
|
+
(((c = o == null ? void 0 : o.position) == null ? void 0 : c[1]) ?? 0) / 1e3,
|
|
1209
|
+
(((l = o == null ? void 0 : o.position) == null ? void 0 : l[2]) ?? 0) / 1e3
|
|
1210
|
+
],
|
|
1211
|
+
mountingQuaternion: J(
|
|
1212
|
+
[
|
|
1213
|
+
((i = o == null ? void 0 : o.orientation) == null ? void 0 : i[0]) ?? 0,
|
|
1214
|
+
((m = o == null ? void 0 : o.orientation) == null ? void 0 : m[1]) ?? 0,
|
|
1215
|
+
((p = o == null ? void 0 : o.orientation) == null ? void 0 : p[2]) ?? 0
|
|
1216
|
+
],
|
|
1217
|
+
"ROTATION_VECTOR"
|
|
1218
|
+
)
|
|
1219
|
+
};
|
|
1220
|
+
}
|
|
1221
|
+
function ge(t) {
|
|
1222
|
+
var l;
|
|
1223
|
+
const { description: n, jogging: e } = t, o = x(
|
|
1224
|
+
() => qt(() => {
|
|
1225
|
+
const i = t.trajectory.plannedTrajectory;
|
|
1226
|
+
return i ? t.state.isAt({
|
|
1227
|
+
type: "joint",
|
|
1228
|
+
motionGroupId: t.motionGroupId,
|
|
1229
|
+
joints: i.endJoints
|
|
1230
|
+
}) ? null : i.endJoints : null;
|
|
1231
|
+
}),
|
|
1232
|
+
[t]
|
|
1233
|
+
).get(), r = e.selectedOrientation === "tool", c = e.selectedTcpId;
|
|
1234
|
+
return {
|
|
1235
|
+
robot: ye(t),
|
|
1236
|
+
safetyZones: n.safetyZones,
|
|
1237
|
+
plannedJoints: o,
|
|
1238
|
+
jogAxes: {
|
|
1239
|
+
base: r ? Lt(
|
|
1240
|
+
e.selectedCoordSystemId,
|
|
1241
|
+
e.coordSystems
|
|
1242
|
+
) : e.jogCoordSystem,
|
|
1243
|
+
tcpOffset: c ? (l = n.tcpOffsetsById[c]) == null ? void 0 : l.pose : void 0,
|
|
1244
|
+
rapidlyChangingMotionState: t.state.rapidlyChangingMotionState,
|
|
1245
|
+
orientation: e.selectedOrientation,
|
|
1246
|
+
rotate: e.selectedCartesianMotionType === "rotate"
|
|
1247
|
+
}
|
|
1248
|
+
};
|
|
1249
|
+
}
|
|
1250
|
+
const qe = _t(function({
|
|
1251
|
+
session: n,
|
|
1252
|
+
robot: e,
|
|
1253
|
+
...o
|
|
1254
|
+
}) {
|
|
1255
|
+
const r = ge(bt(n));
|
|
1256
|
+
return /* @__PURE__ */ a(
|
|
1257
|
+
de,
|
|
1258
|
+
{
|
|
1259
|
+
...r,
|
|
1260
|
+
...o,
|
|
1261
|
+
robot: e ? { ...r.robot, ...e } : r.robot
|
|
1262
|
+
}
|
|
1263
|
+
);
|
|
1264
|
+
});
|
|
1265
|
+
export {
|
|
1266
|
+
re as D,
|
|
1267
|
+
Zt as F,
|
|
1268
|
+
P as J,
|
|
1269
|
+
fe as M,
|
|
1270
|
+
Ft as P,
|
|
1271
|
+
qe as R,
|
|
1272
|
+
$t as S,
|
|
1273
|
+
Qt as a,
|
|
1274
|
+
vt as b,
|
|
1275
|
+
de as c,
|
|
1276
|
+
je as d,
|
|
1277
|
+
yt as e,
|
|
1278
|
+
Ce as f,
|
|
1279
|
+
wt as g,
|
|
1280
|
+
N as h,
|
|
1281
|
+
D as j,
|
|
1282
|
+
ye as r,
|
|
1283
|
+
ge as u
|
|
1284
|
+
};
|