@wandelbots/wandelbots-js-react-components 1.17.3 → 1.17.5
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/components/jogging/JoggingActivationRequired.d.ts +9 -0
- package/dist/components/jogging/JoggingActivationRequired.d.ts.map +1 -0
- package/dist/components/jogging/JoggingCartesianTab.d.ts.map +1 -1
- package/dist/components/jogging/JoggingJointTab.d.ts.map +1 -1
- package/dist/components/jogging/JoggingPanel.d.ts.map +1 -1
- package/dist/components/robots/ABB_1200_07_7.d.ts +7 -2
- package/dist/components/robots/ABB_1200_07_7.d.ts.map +1 -1
- package/dist/components/robots/DHRobot.d.ts.map +1 -1
- package/dist/components/robots/FANUC_ARC_Mate_100iD.d.ts +7 -2
- package/dist/components/robots/FANUC_ARC_Mate_100iD.d.ts.map +1 -1
- package/dist/components/robots/FANUC_ARC_Mate_120iD.d.ts +7 -2
- package/dist/components/robots/FANUC_ARC_Mate_120iD.d.ts.map +1 -1
- package/dist/components/robots/FANUC_CRX10iA.d.ts +7 -2
- package/dist/components/robots/FANUC_CRX10iA.d.ts.map +1 -1
- package/dist/components/robots/FANUC_CRX20iAL.d.ts +7 -2
- package/dist/components/robots/FANUC_CRX20iAL.d.ts.map +1 -1
- package/dist/components/robots/FANUC_CRX25iA.d.ts +7 -2
- package/dist/components/robots/FANUC_CRX25iA.d.ts.map +1 -1
- package/dist/components/robots/FANUC_CRX25iAL.d.ts +7 -2
- package/dist/components/robots/FANUC_CRX25iAL.d.ts.map +1 -1
- package/dist/components/robots/KUKA_KR16_R2010_2.d.ts +7 -2
- package/dist/components/robots/KUKA_KR16_R2010_2.d.ts.map +1 -1
- package/dist/components/robots/KUKA_KR210_R2700.d.ts +7 -2
- package/dist/components/robots/KUKA_KR210_R2700.d.ts.map +1 -1
- package/dist/components/robots/KUKA_KR270_R2700.d.ts +7 -2
- package/dist/components/robots/KUKA_KR270_R2700.d.ts.map +1 -1
- package/dist/components/robots/Robot.d.ts +3 -3
- package/dist/components/robots/Robot.d.ts.map +1 -1
- package/dist/components/robots/RobotAnimator.d.ts +7 -4
- package/dist/components/robots/RobotAnimator.d.ts.map +1 -1
- package/dist/components/robots/SupportedRobot.d.ts +1 -5
- package/dist/components/robots/SupportedRobot.d.ts.map +1 -1
- package/dist/components/robots/UniversalRobots_UR10.d.ts +2 -2
- package/dist/components/robots/UniversalRobots_UR10.d.ts.map +1 -1
- package/dist/components/robots/UniversalRobots_UR10e.d.ts +2 -2
- package/dist/components/robots/UniversalRobots_UR10e.d.ts.map +1 -1
- package/dist/components/robots/UniversalRobots_UR3.d.ts +2 -2
- package/dist/components/robots/UniversalRobots_UR3.d.ts.map +1 -1
- package/dist/components/robots/UniversalRobots_UR3e.d.ts +2 -2
- package/dist/components/robots/UniversalRobots_UR3e.d.ts.map +1 -1
- package/dist/components/robots/UniversalRobots_UR5.d.ts +2 -2
- package/dist/components/robots/UniversalRobots_UR5.d.ts.map +1 -1
- package/dist/components/robots/UniversalRobots_UR5e.d.ts +2 -2
- package/dist/components/robots/UniversalRobots_UR5e.d.ts.map +1 -1
- package/dist/components/robots/Yaskawa_AR1440.d.ts +8 -2
- package/dist/components/robots/Yaskawa_AR1440.d.ts.map +1 -1
- package/dist/components/robots/Yaskawa_AR1730.d.ts +8 -2
- package/dist/components/robots/Yaskawa_AR1730.d.ts.map +1 -1
- package/dist/components/robots/Yaskawa_AR2010.d.ts +8 -2
- package/dist/components/robots/Yaskawa_AR2010.d.ts.map +1 -1
- package/dist/components/robots/Yaskawa_AR3120.d.ts +8 -2
- package/dist/components/robots/Yaskawa_AR3120.d.ts.map +1 -1
- package/dist/components/robots/Yaskawa_AR900.d.ts +7 -2
- package/dist/components/robots/Yaskawa_AR900.d.ts.map +1 -1
- package/dist/components/robots/Yaskawa_GP50.d.ts +7 -2
- package/dist/components/robots/Yaskawa_GP50.d.ts.map +1 -1
- package/dist/components/robots/types.d.ts +17 -0
- package/dist/components/robots/types.d.ts.map +1 -0
- package/dist/index.cjs +32 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9370 -9717
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/TransparentOverlay.tsx +2 -2
- package/src/components/jogging/JoggingActivationRequired.tsx +46 -0
- package/src/components/jogging/JoggingCartesianTab.tsx +84 -79
- package/src/components/jogging/JoggingJointTab.tsx +66 -61
- package/src/components/jogging/JoggingPanel.tsx +1 -32
- package/src/components/robots/ABB_1200_07_7.tsx +7 -22
- package/src/components/robots/DHRobot.tsx +34 -33
- package/src/components/robots/FANUC_ARC_Mate_100iD.tsx +7 -22
- package/src/components/robots/FANUC_ARC_Mate_120iD.tsx +7 -22
- package/src/components/robots/FANUC_CRX10iA.tsx +7 -22
- package/src/components/robots/FANUC_CRX20iAL.tsx +7 -22
- package/src/components/robots/FANUC_CRX25iA.tsx +7 -22
- package/src/components/robots/FANUC_CRX25iAL.tsx +7 -22
- package/src/components/robots/KUKA_KR16_R2010_2.tsx +19 -34
- package/src/components/robots/KUKA_KR210_R2700.tsx +7 -23
- package/src/components/robots/KUKA_KR270_R2700.tsx +7 -23
- package/src/components/robots/Robot.tsx +3 -3
- package/src/components/robots/RobotAnimator.tsx +32 -21
- package/src/components/robots/SupportedRobot.tsx +93 -103
- package/src/components/robots/UniversalRobots_UR10.tsx +3 -20
- package/src/components/robots/UniversalRobots_UR10e.tsx +2 -19
- package/src/components/robots/UniversalRobots_UR3.tsx +2 -19
- package/src/components/robots/UniversalRobots_UR3e.tsx +3 -20
- package/src/components/robots/UniversalRobots_UR5.tsx +3 -20
- package/src/components/robots/UniversalRobots_UR5e.tsx +3 -20
- package/src/components/robots/Yaskawa_AR1440.tsx +8 -24
- package/src/components/robots/Yaskawa_AR1730.tsx +8 -24
- package/src/components/robots/Yaskawa_AR2010.tsx +8 -24
- package/src/components/robots/Yaskawa_AR3120.tsx +8 -24
- package/src/components/robots/Yaskawa_AR900.tsx +7 -22
- package/src/components/robots/Yaskawa_GP50.tsx +7 -24
- package/src/components/robots/types.ts +19 -0
package/package.json
CHANGED
|
@@ -14,8 +14,8 @@ export const TransparentOverlay = (
|
|
|
14
14
|
alignItems="center"
|
|
15
15
|
justifyContent="center"
|
|
16
16
|
sx={{
|
|
17
|
-
backgroundColor: "rgba(0, 0, 0, 0.
|
|
18
|
-
backdropFilter: "blur(
|
|
17
|
+
backgroundColor: "rgba(0, 0, 0, 0.6)",
|
|
18
|
+
backdropFilter: "blur(1px)",
|
|
19
19
|
zIndex: 100,
|
|
20
20
|
}}
|
|
21
21
|
{...props}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Button, Stack } from "@mui/material"
|
|
2
|
+
import { observer } from "mobx-react-lite"
|
|
3
|
+
import type React from "react"
|
|
4
|
+
import { useTranslation } from "react-i18next"
|
|
5
|
+
import { LoadingCover } from "../LoadingCover"
|
|
6
|
+
import { TransparentOverlay } from "../TransparentOverlay"
|
|
7
|
+
import type { JoggingStore } from "./JoggingStore"
|
|
8
|
+
|
|
9
|
+
export const JoggingActivationRequired = observer(
|
|
10
|
+
({ store, children }: { store: JoggingStore; children: React.ReactNode }) => {
|
|
11
|
+
const { t } = useTranslation()
|
|
12
|
+
|
|
13
|
+
function renderOverlay() {
|
|
14
|
+
if (store.activationState === "inactive" && !store.activationError) {
|
|
15
|
+
return (
|
|
16
|
+
<TransparentOverlay>
|
|
17
|
+
<Button
|
|
18
|
+
color="primary"
|
|
19
|
+
variant="contained"
|
|
20
|
+
onClick={() => store.activate({ manual: true })}
|
|
21
|
+
disabled={store.isLocked}
|
|
22
|
+
>
|
|
23
|
+
{t("Jogging.Activate.bt")}
|
|
24
|
+
</Button>
|
|
25
|
+
</TransparentOverlay>
|
|
26
|
+
)
|
|
27
|
+
} else if (store.activationState === "loading" || store.activationError) {
|
|
28
|
+
return (
|
|
29
|
+
<TransparentOverlay>
|
|
30
|
+
<LoadingCover
|
|
31
|
+
message={t("Jogging.Activating.lb")}
|
|
32
|
+
error={store.activationError}
|
|
33
|
+
/>
|
|
34
|
+
</TransparentOverlay>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<Stack sx={{ position: "relative" }}>
|
|
41
|
+
{renderOverlay()}
|
|
42
|
+
{children}
|
|
43
|
+
</Stack>
|
|
44
|
+
)
|
|
45
|
+
},
|
|
46
|
+
)
|
|
@@ -12,6 +12,7 @@ import YAxisIcon from "../../icons/axis-y.svg"
|
|
|
12
12
|
import ZAxisIcon from "../../icons/axis-z.svg"
|
|
13
13
|
import RotationIcon from "../../icons/rotation.svg"
|
|
14
14
|
import { useReaction } from "../utils/hooks"
|
|
15
|
+
import { JoggingActivationRequired } from "./JoggingActivationRequired"
|
|
15
16
|
import { JoggingCartesianAxisControl } from "./JoggingCartesianAxisControl"
|
|
16
17
|
import { JoggingCartesianValues } from "./JoggingCartesianValues"
|
|
17
18
|
import { JoggingJointLimitDetector } from "./JoggingJointLimitDetector"
|
|
@@ -150,7 +151,13 @@ export const JoggingCartesianTab = observer(
|
|
|
150
151
|
{/* Jogging options */}
|
|
151
152
|
<JoggingOptions store={store} />
|
|
152
153
|
|
|
153
|
-
<Stack
|
|
154
|
+
<Stack
|
|
155
|
+
width="80%"
|
|
156
|
+
maxWidth="296px"
|
|
157
|
+
margin="auto"
|
|
158
|
+
marginTop="16px"
|
|
159
|
+
gap="12px"
|
|
160
|
+
>
|
|
154
161
|
{/* Translate or rotate toggle */}
|
|
155
162
|
<ToggleButtonGroup
|
|
156
163
|
value={store.selectedCartesianMotionType}
|
|
@@ -166,85 +173,83 @@ export const JoggingCartesianTab = observer(
|
|
|
166
173
|
</ToggleButton>
|
|
167
174
|
</ToggleButtonGroup>
|
|
168
175
|
|
|
169
|
-
{
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
))}
|
|
176
|
+
<JoggingActivationRequired store={store}>
|
|
177
|
+
{/* Cartesian translate jogging */}
|
|
178
|
+
<Stack gap="12px">
|
|
179
|
+
{store.selectedCartesianMotionType === "translate" &&
|
|
180
|
+
axisList.map((axis) => (
|
|
181
|
+
<JoggingCartesianAxisControl
|
|
182
|
+
key={axis.id}
|
|
183
|
+
color={axis.color}
|
|
184
|
+
disabled={store.isLocked}
|
|
185
|
+
label={
|
|
186
|
+
<>
|
|
187
|
+
{axis.icon}
|
|
188
|
+
<Typography
|
|
189
|
+
sx={{
|
|
190
|
+
fontSize: "24px",
|
|
191
|
+
color: "white",
|
|
192
|
+
}}
|
|
193
|
+
>
|
|
194
|
+
{axis.id.toUpperCase()}
|
|
195
|
+
</Typography>
|
|
196
|
+
</>
|
|
197
|
+
}
|
|
198
|
+
getDisplayedValue={() =>
|
|
199
|
+
formatMM(
|
|
200
|
+
store.jogger.motionStream.rapidlyChangingMotionState
|
|
201
|
+
.tcp_pose?.position[axis.id] || 0,
|
|
202
|
+
)
|
|
203
|
+
}
|
|
204
|
+
startJogging={(direction: "-" | "+") =>
|
|
205
|
+
startCartesianJogging({
|
|
206
|
+
axis: axis.id,
|
|
207
|
+
motionType: "translate",
|
|
208
|
+
direction,
|
|
209
|
+
})
|
|
210
|
+
}
|
|
211
|
+
stopJogging={stopJogging}
|
|
212
|
+
/>
|
|
213
|
+
))}
|
|
208
214
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
))}
|
|
215
|
+
{/* Cartesian rotate jogging */}
|
|
216
|
+
{store.selectedCartesianMotionType === "rotate" &&
|
|
217
|
+
axisList.map((axis) => (
|
|
218
|
+
<JoggingCartesianAxisControl
|
|
219
|
+
key={axis.id}
|
|
220
|
+
color={axis.color}
|
|
221
|
+
disabled={store.isLocked}
|
|
222
|
+
label={
|
|
223
|
+
<>
|
|
224
|
+
<RotationIcon />
|
|
225
|
+
<Typography
|
|
226
|
+
sx={{
|
|
227
|
+
fontSize: "24px",
|
|
228
|
+
color: "white",
|
|
229
|
+
}}
|
|
230
|
+
>
|
|
231
|
+
{axis.id.toUpperCase()}
|
|
232
|
+
</Typography>
|
|
233
|
+
</>
|
|
234
|
+
}
|
|
235
|
+
getDisplayedValue={() =>
|
|
236
|
+
formatDegrees(
|
|
237
|
+
store.jogger.motionStream.rapidlyChangingMotionState
|
|
238
|
+
.tcp_pose?.orientation?.[axis.id] || 0,
|
|
239
|
+
)
|
|
240
|
+
}
|
|
241
|
+
startJogging={(direction: "-" | "+") =>
|
|
242
|
+
startCartesianJogging({
|
|
243
|
+
axis: axis.id,
|
|
244
|
+
motionType: "rotate",
|
|
245
|
+
direction,
|
|
246
|
+
})
|
|
247
|
+
}
|
|
248
|
+
stopJogging={stopJogging}
|
|
249
|
+
/>
|
|
250
|
+
))}
|
|
251
|
+
</Stack>
|
|
252
|
+
</JoggingActivationRequired>
|
|
248
253
|
</Stack>
|
|
249
254
|
|
|
250
255
|
{/* Show message if joint limits reached */}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Stack, Typography } from "@mui/material"
|
|
2
|
-
import { observer } from "mobx-react-lite"
|
|
3
2
|
import { radiansToDegrees } from "@wandelbots/wandelbots-js"
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
3
|
+
import { observer } from "mobx-react-lite"
|
|
4
|
+
import { JoggingActivationRequired } from "./JoggingActivationRequired"
|
|
5
|
+
import { JoggingJointLimitDetector } from "./JoggingJointLimitDetector"
|
|
6
6
|
import { JoggingJointRotationControl } from "./JoggingJointRotationControl"
|
|
7
7
|
import { JoggingJointValues } from "./JoggingJointValues"
|
|
8
|
-
import {
|
|
8
|
+
import type { JoggingStore } from "./JoggingStore"
|
|
9
|
+
import { JoggingVelocitySlider } from "./JoggingVelocitySlider"
|
|
9
10
|
|
|
10
11
|
export const JoggingJointTab = observer(
|
|
11
12
|
({ store }: { store: JoggingStore }) => {
|
|
@@ -27,64 +28,68 @@ export const JoggingJointTab = observer(
|
|
|
27
28
|
return (
|
|
28
29
|
<Stack>
|
|
29
30
|
<JoggingJointValues store={store} />
|
|
30
|
-
<Stack>
|
|
31
|
-
{store.jogger.motionStream.joints.map((joint) => {
|
|
32
|
-
const jointLimits =
|
|
33
|
-
store.motionGroupSpec.mechanical_joint_limits?.[joint.index]
|
|
34
|
-
const lowerLimitDegs =
|
|
35
|
-
jointLimits?.lower_limit !== undefined
|
|
36
|
-
? radiansToDegrees(jointLimits.lower_limit)
|
|
37
|
-
: undefined
|
|
38
|
-
const upperLimitDegs =
|
|
39
|
-
jointLimits?.upper_limit !== undefined
|
|
40
|
-
? radiansToDegrees(jointLimits.upper_limit)
|
|
41
|
-
: undefined
|
|
42
31
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
32
|
+
<Stack marginTop="0.8rem" />
|
|
33
|
+
<JoggingActivationRequired store={store}>
|
|
34
|
+
<Stack gap="0.8rem">
|
|
35
|
+
{store.jogger.motionStream.joints.map((joint) => {
|
|
36
|
+
const jointLimits =
|
|
37
|
+
store.motionGroupSpec.mechanical_joint_limits?.[joint.index]
|
|
38
|
+
const lowerLimitDegs =
|
|
39
|
+
jointLimits?.lower_limit !== undefined
|
|
40
|
+
? radiansToDegrees(jointLimits.lower_limit)
|
|
41
|
+
: undefined
|
|
42
|
+
const upperLimitDegs =
|
|
43
|
+
jointLimits?.upper_limit !== undefined
|
|
44
|
+
? radiansToDegrees(jointLimits.upper_limit)
|
|
45
|
+
: undefined
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<Stack
|
|
49
|
+
direction="row"
|
|
50
|
+
alignItems="center"
|
|
51
|
+
gap={2}
|
|
52
|
+
key={`joint-${joint.index}`}
|
|
53
|
+
>
|
|
54
|
+
<Typography
|
|
55
|
+
sx={{
|
|
56
|
+
flexGrow: 1,
|
|
57
|
+
textAlign: "right",
|
|
58
|
+
}}
|
|
59
|
+
>{`J${joint.index + 1}`}</Typography>
|
|
60
|
+
<JoggingJointRotationControl
|
|
61
|
+
key={joint.index}
|
|
62
|
+
disabled={store.isLocked}
|
|
63
|
+
lowerLimitDegs={lowerLimitDegs}
|
|
64
|
+
upperLimitDegs={upperLimitDegs}
|
|
65
|
+
getValueDegs={() => {
|
|
66
|
+
const value =
|
|
67
|
+
store.jogger.motionStream.rapidlyChangingMotionState
|
|
68
|
+
.state.joint_position.joints[joint.index]
|
|
69
|
+
return value !== undefined
|
|
70
|
+
? radiansToDegrees(value)
|
|
71
|
+
: undefined
|
|
72
|
+
}}
|
|
73
|
+
startJogging={(direction: "-" | "+") =>
|
|
74
|
+
startJointJogging({
|
|
75
|
+
joint: joint.index,
|
|
76
|
+
direction,
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
stopJogging={stopJointJogging}
|
|
80
|
+
/>
|
|
81
|
+
{/* Just to balance out the right side */}
|
|
82
|
+
<Typography
|
|
83
|
+
sx={{
|
|
84
|
+
flexGrow: 1,
|
|
85
|
+
}}
|
|
86
|
+
/>
|
|
87
|
+
</Stack>
|
|
88
|
+
)
|
|
89
|
+
})}
|
|
90
|
+
</Stack>
|
|
91
|
+
</JoggingActivationRequired>
|
|
92
|
+
<JoggingJointLimitDetector store={store} />
|
|
88
93
|
<JoggingVelocitySlider store={store} />
|
|
89
94
|
</Stack>
|
|
90
95
|
)
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Paper, Stack, Tab, Tabs } from "@mui/material"
|
|
2
2
|
import { NovaClient } from "@wandelbots/wandelbots-js"
|
|
3
3
|
import { isString } from "lodash-es"
|
|
4
4
|
import { runInAction } from "mobx"
|
|
5
5
|
import { observer, useLocalObservable } from "mobx-react-lite"
|
|
6
6
|
import { useEffect } from "react"
|
|
7
|
-
import { useTranslation } from "react-i18next"
|
|
8
7
|
import { externalizeComponent } from "../../externalizeComponent"
|
|
9
8
|
import { LoadingCover } from "../LoadingCover"
|
|
10
|
-
import { TransparentOverlay } from "../TransparentOverlay"
|
|
11
9
|
import { useReaction } from "../utils/hooks"
|
|
12
10
|
import { JoggingCartesianTab } from "./JoggingCartesianTab"
|
|
13
11
|
import { JoggingJointTab } from "./JoggingJointTab"
|
|
@@ -117,8 +115,6 @@ const JoggingPanelInner = observer(
|
|
|
117
115
|
store: JoggingStore
|
|
118
116
|
children?: React.ReactNode
|
|
119
117
|
}) => {
|
|
120
|
-
const { t } = useTranslation()
|
|
121
|
-
|
|
122
118
|
// Jogger is only active as long as the tab is focused
|
|
123
119
|
useEffect(() => {
|
|
124
120
|
function deactivate() {
|
|
@@ -151,32 +147,6 @@ const JoggingPanelInner = observer(
|
|
|
151
147
|
},
|
|
152
148
|
)
|
|
153
149
|
|
|
154
|
-
function renderOverlay() {
|
|
155
|
-
if (store.activationState === "inactive" && !store.activationError) {
|
|
156
|
-
return (
|
|
157
|
-
<TransparentOverlay>
|
|
158
|
-
<Button
|
|
159
|
-
color="primary"
|
|
160
|
-
variant="contained"
|
|
161
|
-
onClick={() => store.activate({ manual: true })}
|
|
162
|
-
disabled={store.isLocked}
|
|
163
|
-
>
|
|
164
|
-
{t("Jogging.Activate.bt")}
|
|
165
|
-
</Button>
|
|
166
|
-
</TransparentOverlay>
|
|
167
|
-
)
|
|
168
|
-
} else if (store.activationState === "loading" || store.activationError) {
|
|
169
|
-
return (
|
|
170
|
-
<TransparentOverlay>
|
|
171
|
-
<LoadingCover
|
|
172
|
-
message={t("Jogging.Activating.lb")}
|
|
173
|
-
error={store.activationError}
|
|
174
|
-
/>
|
|
175
|
-
</TransparentOverlay>
|
|
176
|
-
)
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
150
|
function renderTabContent() {
|
|
181
151
|
if (store.currentTab.id === "cartesian") {
|
|
182
152
|
return (
|
|
@@ -211,7 +181,6 @@ const JoggingPanelInner = observer(
|
|
|
211
181
|
|
|
212
182
|
{/* Current tab content */}
|
|
213
183
|
<Stack flexGrow={1} position="relative">
|
|
214
|
-
{renderOverlay()}
|
|
215
184
|
{renderTabContent()}
|
|
216
185
|
</Stack>
|
|
217
186
|
</Stack>
|
|
@@ -1,33 +1,18 @@
|
|
|
1
|
-
import { useGLTF } from "@react-three/drei"
|
|
2
|
-
import type * as THREE from "three"
|
|
3
|
-
import type { RobotProps } from "./SupportedRobot"
|
|
4
1
|
import { animated } from "@react-spring/three"
|
|
5
|
-
import
|
|
2
|
+
import { useGLTF } from "@react-three/drei"
|
|
3
|
+
import type { RobotModelProps } from "./types"
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}:
|
|
5
|
+
ABB_1200_07_7.config = {
|
|
6
|
+
rotationOffsets: [0, -Math.PI / 2, 0, 0, 0, 0],
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function ABB_1200_07_7({ modelURL, ...props }: RobotModelProps) {
|
|
12
10
|
const gltf = useGLTF(modelURL) as any
|
|
13
11
|
const nodes = gltf.nodes
|
|
14
12
|
const materials = gltf.materials
|
|
15
|
-
const rotationOffsets = [0, -Math.PI / 2, 0, 0, 0, 0]
|
|
16
|
-
|
|
17
|
-
function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
|
|
18
|
-
jointObjects.forEach(
|
|
19
|
-
(object, index) =>
|
|
20
|
-
(object.rotation.y = jointValues[index]! + rotationOffsets[index]!),
|
|
21
|
-
)
|
|
22
|
-
}
|
|
23
13
|
|
|
24
14
|
return (
|
|
25
15
|
<>
|
|
26
|
-
<RobotAnimator
|
|
27
|
-
rapidlyChangingMotionState={rapidlyChangingMotionState}
|
|
28
|
-
robotRootObjectName="Scene"
|
|
29
|
-
onRotationChanged={setRotation}
|
|
30
|
-
/>
|
|
31
16
|
<group {...props} dispose={null}>
|
|
32
17
|
<group name="Scene">
|
|
33
18
|
<group name="IRB1200_7_70_IRC5" rotation={[Math.PI / 2, 0, 0]}>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Vector3, Matrix4, Quaternion } from "three"
|
|
2
1
|
import { Line } from "@react-three/drei"
|
|
3
|
-
import type { LineGeometry } from "three/examples/jsm/lines/LineGeometry.js"
|
|
4
2
|
import type { DHParameter } from "@wandelbots/wandelbots-api-client"
|
|
5
|
-
import RobotAnimator from "./RobotAnimator"
|
|
6
3
|
import type * as THREE from "three"
|
|
4
|
+
import { Matrix4, Quaternion, Vector3 } from "three"
|
|
5
|
+
import type { LineGeometry } from "three/examples/jsm/lines/LineGeometry.js"
|
|
7
6
|
import {
|
|
8
7
|
getAllJointsByName,
|
|
9
8
|
type RobotSceneJoint,
|
|
10
9
|
} from "../utils/robotTreeQuery"
|
|
10
|
+
import RobotAnimator from "./RobotAnimator"
|
|
11
11
|
import type { DHRobotProps } from "./SupportedRobot"
|
|
12
12
|
|
|
13
13
|
const CHILD_LINE = "line"
|
|
@@ -85,7 +85,7 @@ export function DHRobot({
|
|
|
85
85
|
})
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
function
|
|
88
|
+
function jointCollector(rootObject: THREE.Object3D): RobotSceneJoint[] {
|
|
89
89
|
return getAllJointsByName(rootObject, "^group_[0-9]+$")
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -93,36 +93,37 @@ export function DHRobot({
|
|
|
93
93
|
<>
|
|
94
94
|
<RobotAnimator
|
|
95
95
|
rapidlyChangingMotionState={rapidlyChangingMotionState}
|
|
96
|
-
|
|
96
|
+
jointCollector={jointCollector}
|
|
97
97
|
onRotationChanged={setRotation}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
98
|
+
>
|
|
99
|
+
<group {...props} name="Scene">
|
|
100
|
+
<mesh>
|
|
101
|
+
<sphereGeometry args={[0.01, 32, 32]} />
|
|
102
|
+
<meshStandardMaterial color={"black"} depthTest={true} />
|
|
103
|
+
</mesh>
|
|
104
|
+
{dhParameters!.map((param, index) => {
|
|
105
|
+
const { a, b } = getLinePoints(
|
|
106
|
+
param,
|
|
107
|
+
rapidlyChangingMotionState.state.joint_position.joints[index] ??
|
|
108
|
+
0,
|
|
109
|
+
)
|
|
110
|
+
return (
|
|
111
|
+
<group name={`group_${index}`} key={"group_" + index}>
|
|
112
|
+
<Line
|
|
113
|
+
name={CHILD_LINE}
|
|
114
|
+
points={[a, b]}
|
|
115
|
+
color={"white"}
|
|
116
|
+
lineWidth={5}
|
|
117
|
+
/>
|
|
118
|
+
<mesh name={CHILD_MESH} key={"mesh_" + index} position={b}>
|
|
119
|
+
<sphereGeometry args={[0.01, 32, 32]} />
|
|
120
|
+
<meshStandardMaterial color={"black"} depthTest={true} />
|
|
121
|
+
</mesh>
|
|
122
|
+
</group>
|
|
123
|
+
)
|
|
124
|
+
})}
|
|
125
|
+
</group>
|
|
126
|
+
</RobotAnimator>
|
|
126
127
|
</>
|
|
127
128
|
)
|
|
128
129
|
}
|
|
@@ -1,33 +1,18 @@
|
|
|
1
|
-
import { useGLTF } from "@react-three/drei"
|
|
2
|
-
import type * as THREE from "three"
|
|
3
|
-
import type { RobotProps } from "./SupportedRobot"
|
|
4
|
-
import RobotAnimator from "./RobotAnimator"
|
|
5
1
|
import { animated } from "@react-spring/three"
|
|
2
|
+
import { useGLTF } from "@react-three/drei"
|
|
3
|
+
import type { RobotModelProps } from "./types"
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}:
|
|
5
|
+
FANUC_ARC_Mate_100iD.config = {
|
|
6
|
+
rotationOffsets: [0, Math.PI / 2, 0, 0, 0, 0],
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function FANUC_ARC_Mate_100iD({ modelURL, ...props }: RobotModelProps) {
|
|
12
10
|
const gltf = useGLTF(modelURL) as any
|
|
13
11
|
const nodes = gltf.nodes
|
|
14
12
|
const materials = gltf.materials
|
|
15
|
-
const rotationOffsets = [0, Math.PI / 2, 0, 0, 0, 0]
|
|
16
|
-
|
|
17
|
-
function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
|
|
18
|
-
jointObjects.forEach(
|
|
19
|
-
(object, index) =>
|
|
20
|
-
(object.rotation.y = jointValues[index]! + rotationOffsets[index]!),
|
|
21
|
-
)
|
|
22
|
-
}
|
|
23
13
|
|
|
24
14
|
return (
|
|
25
15
|
<>
|
|
26
|
-
<RobotAnimator
|
|
27
|
-
rapidlyChangingMotionState={rapidlyChangingMotionState}
|
|
28
|
-
robotRootObjectName="Scene"
|
|
29
|
-
onRotationChanged={setRotation}
|
|
30
|
-
/>
|
|
31
16
|
<group {...props} dispose={null}>
|
|
32
17
|
<group name="Scene">
|
|
33
18
|
<group name="M10iD" rotation={[Math.PI / 2, 0, 0]}>
|