@wandelbots/wandelbots-js-react-components 1.7.1 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -16
- package/dist/components/3d-viewport/SafetyZonesRenderer.d.ts +1 -1
- package/dist/components/3d-viewport/SafetyZonesRenderer.d.ts.map +1 -1
- package/dist/components/CopyableText.d.ts +5 -0
- package/dist/components/CopyableText.d.ts.map +1 -0
- package/dist/components/LoadingButton.d.ts +1 -1
- package/dist/components/LoadingButton.stories.d.ts +1 -1
- package/dist/components/LoadingButton.stories.d.ts.map +1 -1
- package/dist/components/ThemeSelect.d.ts.map +1 -1
- package/dist/components/VelocitySlider.d.ts.map +1 -1
- package/dist/components/VelocitySlider.stories.d.ts +2 -2
- package/dist/components/VelocitySlider.stories.d.ts.map +1 -1
- package/dist/components/jogging/JoggingCartesianAxisControl.stories.d.ts +1 -1
- package/dist/components/jogging/JoggingCartesianAxisControl.stories.d.ts.map +1 -1
- package/dist/components/jogging/JoggingCartesianTab.d.ts.map +1 -1
- package/dist/components/jogging/JoggingCartesianValues.d.ts +1 -1
- package/dist/components/jogging/JoggingCartesianValues.d.ts.map +1 -1
- package/dist/components/jogging/JoggingJointLimitDetector.d.ts +2 -2
- package/dist/components/jogging/JoggingJointLimitDetector.d.ts.map +1 -1
- package/dist/components/jogging/JoggingJointRotationControl.d.ts.map +1 -1
- package/dist/components/jogging/JoggingJointRotationControl.stories.d.ts +2 -2
- package/dist/components/jogging/JoggingJointRotationControl.stories.d.ts.map +1 -1
- package/dist/components/jogging/JoggingJointValues.d.ts +1 -1
- package/dist/components/jogging/JoggingJointValues.d.ts.map +1 -1
- package/dist/components/jogging/JoggingOptions.d.ts.map +1 -1
- package/dist/components/jogging/JoggingPanel.d.ts +8 -1
- package/dist/components/jogging/JoggingPanel.d.ts.map +1 -1
- package/dist/components/jogging/JoggingPanel.stories.d.ts +2 -2
- package/dist/components/jogging/JoggingPanel.stories.d.ts.map +1 -1
- package/dist/components/jogging/JoggingStore.d.ts +14 -1
- package/dist/components/jogging/JoggingStore.d.ts.map +1 -1
- package/dist/components/jogging/JoggingVelocitySlider.d.ts.map +1 -1
- package/dist/components/robots/FANUC_CRX20iAL.d.ts +3 -0
- package/dist/components/robots/FANUC_CRX20iAL.d.ts.map +1 -0
- package/dist/components/robots/SupportedRobot.d.ts.map +1 -1
- package/dist/components/wandelscript-editor/WandelscriptEditor.d.ts +2 -2
- package/dist/components/wandelscript-editor/WandelscriptEditor.d.ts.map +1 -1
- package/dist/components/wandelscript-editor/WandelscriptEditor.stories.d.ts +2 -2
- package/dist/components/wandelscript-editor/WandelscriptEditor.stories.d.ts.map +1 -1
- package/dist/externalizeComponent.d.ts +7 -0
- package/dist/externalizeComponent.d.ts.map +1 -0
- package/dist/index.cjs +29 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +49 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11672 -12089
- package/dist/index.js.map +1 -1
- package/dist/themes/color.d.ts +1 -1
- package/dist/themes/color.d.ts.map +1 -1
- package/dist/themes/novaTheme.stories.d.ts +5 -0
- package/dist/themes/novaTheme.stories.d.ts.map +1 -0
- package/dist/themes/theming.d.ts +49 -0
- package/dist/themes/theming.d.ts.map +1 -0
- package/package.json +20 -13
- package/src/components/3d-viewport/SafetyZonesRenderer.tsx +2 -2
- package/src/components/CopyableText.tsx +30 -0
- package/src/components/LoadingButton.stories.tsx +19 -26
- package/src/components/ThemeSelect.tsx +3 -4
- package/src/components/VelocitySlider.stories.tsx +10 -15
- package/src/components/VelocitySlider.tsx +7 -2
- package/src/components/jogging/JoggingCartesianAxisControl.stories.tsx +21 -21
- package/src/components/jogging/JoggingCartesianAxisControl.tsx +1 -1
- package/src/components/jogging/JoggingCartesianTab.tsx +37 -44
- package/src/components/jogging/JoggingCartesianValues.tsx +37 -33
- package/src/components/jogging/JoggingJointLimitDetector.tsx +10 -7
- package/src/components/jogging/JoggingJointRotationControl.stories.tsx +31 -19
- package/src/components/jogging/JoggingJointRotationControl.tsx +44 -30
- package/src/components/jogging/JoggingJointValues.tsx +35 -33
- package/src/components/jogging/JoggingOptions.tsx +130 -80
- package/src/components/jogging/JoggingPanel.stories.tsx +20 -17
- package/src/components/jogging/JoggingPanel.tsx +29 -31
- package/src/components/jogging/JoggingStore.tsx +69 -18
- package/src/components/jogging/JoggingVelocitySlider.tsx +24 -22
- package/src/components/robots/FANUC_CRX20iAL.tsx +176 -0
- package/src/components/robots/SupportedRobot.tsx +4 -0
- package/src/components/wandelscript-editor/WandelscriptEditor.stories.tsx +7 -7
- package/src/components/wandelscript-editor/WandelscriptEditor.tsx +48 -23
- package/src/externalizeComponent.tsx +37 -0
- package/src/i18n/locales/de/translations.json +2 -1
- package/src/i18n/locales/en/translations.json +2 -1
- package/src/icons/orientation-coord-system.svg +3 -0
- package/src/icons/orientation-tool.svg +3 -0
- package/src/index.ts +39 -9
- package/src/themes/color.tsx +29 -19
- package/src/themes/novaTheme.stories.tsx +77 -0
- package/src/themes/themeTypes.d.ts +11 -0
- package/src/themes/theming.ts +174 -0
- package/dist/themes/theme.d.ts +0 -144
- package/dist/themes/theme.d.ts.map +0 -1
- package/dist/themes/wbTheme.d.ts +0 -73
- package/dist/themes/wbTheme.d.ts.map +0 -1
- package/dist/themes/wbTheme.stories.d.ts +0 -7
- package/dist/themes/wbTheme.stories.d.ts.map +0 -1
- package/src/themes/theme.ts +0 -150
- package/src/themes/wbTheme.stories.tsx +0 -64
- package/src/themes/wbTheme.ts +0 -186
|
@@ -1,26 +1,29 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react"
|
|
2
|
-
import { JoggingPanel } from "
|
|
3
|
-
import { useArgs } from "@storybook/preview-api"
|
|
4
|
-
import { NovaClient } from "@wandelbots/wandelbots-js"
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { JoggingPanel } from "../../index"
|
|
3
|
+
import { useArgs } from "@storybook/preview-api"
|
|
4
|
+
import { NovaClient } from "@wandelbots/wandelbots-js"
|
|
5
5
|
|
|
6
6
|
const meta: Meta<typeof JoggingPanel> = {
|
|
7
7
|
component: JoggingPanel,
|
|
8
8
|
|
|
9
9
|
args: {
|
|
10
|
-
motionGroupId: "0@mock-ur5e"
|
|
10
|
+
motionGroupId: "0@mock-ur5e",
|
|
11
11
|
},
|
|
12
12
|
render: function Component(args) {
|
|
13
|
-
const [, setArgs] = useArgs()
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
const [, setArgs] = useArgs()
|
|
14
|
+
return (
|
|
15
|
+
<JoggingPanel
|
|
16
|
+
{...args}
|
|
17
|
+
nova={
|
|
18
|
+
new NovaClient({
|
|
19
|
+
instanceUrl: "https://mock",
|
|
20
|
+
mock: true,
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
/>
|
|
24
|
+
)
|
|
21
25
|
},
|
|
22
|
-
}
|
|
23
|
-
export default meta
|
|
26
|
+
}
|
|
27
|
+
export default meta
|
|
24
28
|
|
|
25
|
-
export const Default: StoryObj<typeof JoggingPanel> = {
|
|
26
|
-
};
|
|
29
|
+
export const Default: StoryObj<typeof JoggingPanel> = {}
|
|
@@ -6,11 +6,17 @@ import { JoggingJointTab } from "./JoggingJointTab"
|
|
|
6
6
|
import { JoggingStore } from "./JoggingStore"
|
|
7
7
|
import { LoadingCover } from "../LoadingCover"
|
|
8
8
|
import { runInAction } from "mobx"
|
|
9
|
-
import { NovaClient } from "@wandelbots/wandelbots-js"
|
|
9
|
+
import type { NovaClient } from "@wandelbots/wandelbots-js"
|
|
10
10
|
|
|
11
11
|
export type JoggingPanelProps = {
|
|
12
|
+
/** Connection to a Nova instance to use for jogging */
|
|
12
13
|
nova: NovaClient
|
|
14
|
+
/** Id of the motion group to move e.g. 0@ur5e **/
|
|
13
15
|
motionGroupId: string
|
|
16
|
+
/** Callback with the jogging panel's state store for further customization/config */
|
|
17
|
+
onSetup?: (store: JoggingStore) => void
|
|
18
|
+
/** Any children will go at the bottom of the panel under the default components */
|
|
19
|
+
children?: React.ReactNode
|
|
14
20
|
}
|
|
15
21
|
|
|
16
22
|
export const JoggingPanel = observer((props: JoggingPanelProps) => {
|
|
@@ -28,6 +34,9 @@ export const JoggingPanel = observer((props: JoggingPanelProps) => {
|
|
|
28
34
|
runInAction(() => {
|
|
29
35
|
state.joggingStore = joggingStore
|
|
30
36
|
})
|
|
37
|
+
if (props.onSetup) {
|
|
38
|
+
props.onSetup(joggingStore)
|
|
39
|
+
}
|
|
31
40
|
} catch (err) {
|
|
32
41
|
state.loadingError = err
|
|
33
42
|
}
|
|
@@ -47,7 +56,7 @@ export const JoggingPanel = observer((props: JoggingPanelProps) => {
|
|
|
47
56
|
const {
|
|
48
57
|
currentTab,
|
|
49
58
|
selectedTcpId,
|
|
50
|
-
|
|
59
|
+
activeCoordSystemId,
|
|
51
60
|
selectedDiscreteIncrement,
|
|
52
61
|
} = state.joggingStore
|
|
53
62
|
|
|
@@ -55,40 +64,27 @@ export const JoggingPanel = observer((props: JoggingPanelProps) => {
|
|
|
55
64
|
|
|
56
65
|
const cartesianJoggingOpts = {
|
|
57
66
|
tcpId: selectedTcpId,
|
|
58
|
-
coordSystemId:
|
|
67
|
+
coordSystemId: activeCoordSystemId,
|
|
59
68
|
}
|
|
60
69
|
|
|
61
70
|
if (selectedDiscreteIncrement && currentTab.id === "cartesian") {
|
|
62
|
-
state.joggingStore.jogger.setJoggingMode(
|
|
71
|
+
state.joggingStore.jogger.setJoggingMode(
|
|
72
|
+
"increment",
|
|
73
|
+
cartesianJoggingOpts,
|
|
74
|
+
)
|
|
63
75
|
} else {
|
|
64
|
-
state.joggingStore.jogger.setJoggingMode(
|
|
76
|
+
state.joggingStore.jogger.setJoggingMode(
|
|
77
|
+
currentTab.id,
|
|
78
|
+
cartesianJoggingOpts,
|
|
79
|
+
)
|
|
65
80
|
}
|
|
66
81
|
}, [
|
|
67
82
|
state.joggingStore?.currentTab,
|
|
68
83
|
state.joggingStore?.selectedTcpId,
|
|
69
|
-
state.joggingStore?.
|
|
84
|
+
state.joggingStore?.activeCoordSystemId,
|
|
70
85
|
state.joggingStore?.selectedDiscreteIncrement,
|
|
71
86
|
])
|
|
72
87
|
|
|
73
|
-
useEffect(() => {
|
|
74
|
-
|
|
75
|
-
// Set the robot to default control mode (JoZi says is important for physical robot jogging)
|
|
76
|
-
async function init() {
|
|
77
|
-
if (!state.joggingStore) return
|
|
78
|
-
|
|
79
|
-
try {
|
|
80
|
-
await nova.api.controller.setDefaultMode(
|
|
81
|
-
state.joggingStore.jogger.motionStream.controllerId,
|
|
82
|
-
"MODE_CONTROL",
|
|
83
|
-
)
|
|
84
|
-
} catch (err) {
|
|
85
|
-
console.error(err)
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
init()
|
|
90
|
-
}, [state.joggingStore?.jogger.motionStream.controllerId])
|
|
91
|
-
|
|
92
88
|
if (!state.joggingStore) {
|
|
93
89
|
return (
|
|
94
90
|
<JoggingPanelOuter>
|
|
@@ -119,9 +115,8 @@ export const JoggingPanel = observer((props: JoggingPanelProps) => {
|
|
|
119
115
|
{store.currentTab.id === "cartesian" && (
|
|
120
116
|
<JoggingCartesianTab store={store} />
|
|
121
117
|
)}
|
|
122
|
-
{store.currentTab.id === "joint" &&
|
|
123
|
-
|
|
124
|
-
)}
|
|
118
|
+
{store.currentTab.id === "joint" && <JoggingJointTab store={store} />}
|
|
119
|
+
{props.children}
|
|
125
120
|
</Stack>
|
|
126
121
|
</Stack>
|
|
127
122
|
</JoggingPanelOuter>
|
|
@@ -136,11 +131,14 @@ function JoggingPanelOuter({ children }: { children: React.ReactNode }) {
|
|
|
136
131
|
minWidth: "350px",
|
|
137
132
|
overflowY: "auto",
|
|
138
133
|
position: "relative",
|
|
134
|
+
height: "100%",
|
|
139
135
|
}}
|
|
140
136
|
>
|
|
141
|
-
<Paper
|
|
142
|
-
|
|
143
|
-
|
|
137
|
+
<Paper
|
|
138
|
+
sx={{
|
|
139
|
+
height: "100%",
|
|
140
|
+
}}
|
|
141
|
+
>
|
|
144
142
|
{children}
|
|
145
143
|
</Paper>
|
|
146
144
|
</Stack>
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { keyBy } from "lodash-es"
|
|
1
|
+
import { keyBy, uniqueId } from "lodash-es"
|
|
2
2
|
import { autorun, makeAutoObservable, type IReactionDisposer } from "mobx"
|
|
3
|
-
import type {
|
|
3
|
+
import type {
|
|
4
|
+
CoordinateSystem,
|
|
5
|
+
JoggerConnection,
|
|
6
|
+
MotionGroupSpecification,
|
|
7
|
+
RobotTcp,
|
|
8
|
+
} from "@wandelbots/wandelbots-js"
|
|
4
9
|
import { tryParseJson } from "@wandelbots/wandelbots-js"
|
|
5
10
|
|
|
6
11
|
const discreteIncrementOptions = [
|
|
@@ -22,8 +27,8 @@ export type IncrementOptionId = IncrementOption["id"]
|
|
|
22
27
|
export class JoggingStore {
|
|
23
28
|
selectedTabId: "cartesian" | "joint" | "debug" = "cartesian"
|
|
24
29
|
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
/** Locks to prevent UI interactions during certain operations */
|
|
31
|
+
locks = new Set<string>()
|
|
27
32
|
|
|
28
33
|
/**
|
|
29
34
|
* Id of selected coordinate system from among those defined on the API side
|
|
@@ -33,6 +38,13 @@ export class JoggingStore {
|
|
|
33
38
|
/** Id of selected tool center point from among the options available on the robot */
|
|
34
39
|
selectedTcpId: string = ""
|
|
35
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Whether the user is jogging in the coordinate system or tool orientation.
|
|
43
|
+
* When in tool orientation, the robot moves in a direction relative to the
|
|
44
|
+
* attached tool rotation.
|
|
45
|
+
*/
|
|
46
|
+
selectedOrientation: "coordsys" | "tool" = "coordsys"
|
|
47
|
+
|
|
36
48
|
/**
|
|
37
49
|
* Id of selected increment amount for jogging. Options are defined by robot pad.
|
|
38
50
|
* When non-continuous, jogging moves the robot by a fixed number of mm or degrees
|
|
@@ -74,20 +86,28 @@ export class JoggingStore {
|
|
|
74
86
|
const { nova } = jogger
|
|
75
87
|
|
|
76
88
|
// Find out what TCPs this motion group has (we need it for jogging)
|
|
77
|
-
const [motionGroupSpec, { coordinatesystems }, { tcps }] =
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
const [motionGroupSpec, { coordinatesystems }, { tcps }] =
|
|
90
|
+
await Promise.all([
|
|
91
|
+
nova.api.motionGroupInfos.getMotionGroupSpecification(
|
|
92
|
+
jogger.motionGroupId,
|
|
93
|
+
),
|
|
94
|
+
|
|
95
|
+
// Fetch coord systems so user can select between them
|
|
96
|
+
nova.api.coordinateSystems.listCoordinateSystems("ROTATION_VECTOR"),
|
|
97
|
+
|
|
98
|
+
// Same for TCPs
|
|
99
|
+
nova.api.motionGroupInfos.listTcps(
|
|
100
|
+
jogger.motionGroupId,
|
|
101
|
+
"ROTATION_VECTOR",
|
|
102
|
+
),
|
|
103
|
+
])
|
|
104
|
+
|
|
105
|
+
return new JoggingStore(
|
|
106
|
+
jogger,
|
|
107
|
+
motionGroupSpec,
|
|
108
|
+
coordinatesystems || [],
|
|
109
|
+
tcps || [],
|
|
110
|
+
)
|
|
91
111
|
}
|
|
92
112
|
|
|
93
113
|
constructor(
|
|
@@ -147,6 +167,10 @@ export class JoggingStore {
|
|
|
147
167
|
if (["translate", "rotate"].includes(save.selectedCartesianMotionType)) {
|
|
148
168
|
this.selectedCartesianMotionType = save.selectedCartesianMotionType
|
|
149
169
|
}
|
|
170
|
+
|
|
171
|
+
if (["coordsys", "tool"].includes(save.selectedOrientation)) {
|
|
172
|
+
this.selectedOrientation = save.selectedOrientation
|
|
173
|
+
}
|
|
150
174
|
}
|
|
151
175
|
|
|
152
176
|
saveToLocalStorage() {
|
|
@@ -156,11 +180,16 @@ export class JoggingStore {
|
|
|
156
180
|
)
|
|
157
181
|
}
|
|
158
182
|
|
|
183
|
+
get isLocked() {
|
|
184
|
+
return this.locks.size > 0
|
|
185
|
+
}
|
|
186
|
+
|
|
159
187
|
get localStorageSave() {
|
|
160
188
|
return {
|
|
161
189
|
selectedTabId: this.selectedTabId,
|
|
162
190
|
selectedCoordSystemId: this.selectedCoordSystemId,
|
|
163
191
|
selectedTcpId: this.selectedTcpId,
|
|
192
|
+
selectedOrientation: this.selectedOrientation,
|
|
164
193
|
selectedIncrementId: this.selectedIncrementId,
|
|
165
194
|
selectedCartesianMotionType: this.selectedCartesianMotionType,
|
|
166
195
|
}
|
|
@@ -211,6 +240,12 @@ export class JoggingStore {
|
|
|
211
240
|
return this.coordSystemsById[this.selectedCoordSystemId]
|
|
212
241
|
}
|
|
213
242
|
|
|
243
|
+
get activeCoordSystemId() {
|
|
244
|
+
return this.selectedOrientation === "tool"
|
|
245
|
+
? "tool"
|
|
246
|
+
: this.selectedCoordSystemId
|
|
247
|
+
}
|
|
248
|
+
|
|
214
249
|
get tcpsById() {
|
|
215
250
|
return keyBy(this.tcps, (tcp) => tcp.id)
|
|
216
251
|
}
|
|
@@ -272,6 +307,10 @@ export class JoggingStore {
|
|
|
272
307
|
this.selectedTcpId = id
|
|
273
308
|
}
|
|
274
309
|
|
|
310
|
+
setSelectedOrientation(orientation: "coordsys" | "tool") {
|
|
311
|
+
this.selectedOrientation = orientation
|
|
312
|
+
}
|
|
313
|
+
|
|
275
314
|
setSelectedIncrementId(id: IncrementOptionId) {
|
|
276
315
|
this.selectedIncrementId = id
|
|
277
316
|
}
|
|
@@ -291,4 +330,16 @@ export class JoggingStore {
|
|
|
291
330
|
setSelectedCartesianMotionType(type: "translate" | "rotate") {
|
|
292
331
|
this.selectedCartesianMotionType = type
|
|
293
332
|
}
|
|
333
|
+
|
|
334
|
+
/** Lock the UI until the given async callback resolves */
|
|
335
|
+
async withMotionLock(fn: () => Promise<void>) {
|
|
336
|
+
const lockId = uniqueId()
|
|
337
|
+
this.locks.add(lockId)
|
|
338
|
+
|
|
339
|
+
try {
|
|
340
|
+
return await fn()
|
|
341
|
+
} finally {
|
|
342
|
+
this.locks.delete(lockId)
|
|
343
|
+
}
|
|
344
|
+
}
|
|
294
345
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Stack,
|
|
1
|
+
import { Stack, Typography } from "@mui/material"
|
|
2
2
|
import { observer, useLocalObservable } from "mobx-react-lite"
|
|
3
3
|
import type { JoggingStore } from "./JoggingStore"
|
|
4
4
|
import { VelocitySlider } from "../VelocitySlider"
|
|
@@ -21,35 +21,37 @@ export const JoggingVelocitySlider = observer(
|
|
|
21
21
|
}))
|
|
22
22
|
|
|
23
23
|
return (
|
|
24
|
-
<Stack
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
<Stack
|
|
25
|
+
sx={{
|
|
26
|
+
margin: "0px 20px",
|
|
27
|
+
marginTop: "24px",
|
|
28
|
+
marginBottom: "24px",
|
|
29
|
+
}}
|
|
30
|
+
>
|
|
31
|
+
<Stack sx={{ width: "380px", maxWidth: "90%", margin: "auto" }}>
|
|
32
|
+
<Stack
|
|
33
|
+
sx={{
|
|
34
|
+
justifyContent: "center",
|
|
35
|
+
}}
|
|
36
|
+
>
|
|
34
37
|
<Typography
|
|
35
38
|
sx={{
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
fontSize: "12px",
|
|
40
|
+
opacity: 0.6,
|
|
38
41
|
}}
|
|
39
42
|
>
|
|
40
43
|
{t("Jogging.Velocity.lb")}
|
|
41
44
|
</Typography>
|
|
42
|
-
<VelocitySlider
|
|
43
|
-
velocity={store.velocityInCurrentUnits}
|
|
44
|
-
min={store.minVelocityInCurrentUnits}
|
|
45
|
-
max={store.maxVelocityInCurrentUnits}
|
|
46
|
-
onVelocityChange={store.setVelocityFromSlider}
|
|
47
|
-
disabled={store.isLocked}
|
|
48
|
-
valueLabelFormat={state.valueLabelFormat}
|
|
49
|
-
/>
|
|
50
45
|
</Stack>
|
|
46
|
+
<VelocitySlider
|
|
47
|
+
velocity={store.velocityInCurrentUnits}
|
|
48
|
+
min={store.minVelocityInCurrentUnits}
|
|
49
|
+
max={store.maxVelocityInCurrentUnits}
|
|
50
|
+
onVelocityChange={store.setVelocityFromSlider}
|
|
51
|
+
disabled={store.isLocked}
|
|
52
|
+
valueLabelFormat={state.valueLabelFormat}
|
|
53
|
+
/>
|
|
51
54
|
</Stack>
|
|
52
|
-
<Divider />
|
|
53
55
|
</Stack>
|
|
54
56
|
)
|
|
55
57
|
},
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { useGLTF } from "@react-three/drei"
|
|
2
|
+
import type * as THREE from "three"
|
|
3
|
+
import type { RobotProps } from "./SupportedRobot"
|
|
4
|
+
import { animated } from "@react-spring/three"
|
|
5
|
+
import RobotAnimator from "./RobotAnimator"
|
|
6
|
+
|
|
7
|
+
export function FANUC_CRX20iAL({
|
|
8
|
+
modelURL,
|
|
9
|
+
rapidlyChangingMotionState,
|
|
10
|
+
...props
|
|
11
|
+
}: RobotProps) {
|
|
12
|
+
const gltf = useGLTF(modelURL) as any
|
|
13
|
+
const nodes = gltf.nodes
|
|
14
|
+
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
|
+
|
|
24
|
+
return (
|
|
25
|
+
<>
|
|
26
|
+
<RobotAnimator
|
|
27
|
+
rapidlyChangingMotionState={rapidlyChangingMotionState}
|
|
28
|
+
robotRootObjectName="Scene"
|
|
29
|
+
onRotationChanged={setRotation}
|
|
30
|
+
/>
|
|
31
|
+
<group {...props} dispose={null}>
|
|
32
|
+
<group name="Scene">
|
|
33
|
+
<mesh
|
|
34
|
+
name="link_0"
|
|
35
|
+
castShadow
|
|
36
|
+
receiveShadow
|
|
37
|
+
geometry={nodes.link_0.geometry}
|
|
38
|
+
material={materials.fanuc_metal_black}
|
|
39
|
+
/>
|
|
40
|
+
<animated.group name="FANUC_CRX20iAL_J00" position={[0, -0.245, 0]}>
|
|
41
|
+
<animated.group
|
|
42
|
+
name="FANUC_CRX20iAL_J01"
|
|
43
|
+
position={[0, 0.245, 0]}
|
|
44
|
+
rotation={[Math.PI / 2, Math.PI / 2, 0]}
|
|
45
|
+
>
|
|
46
|
+
<animated.group name="FANUC_CRX20iAL_J02" position={[0.71, 0, 0]}>
|
|
47
|
+
<animated.group
|
|
48
|
+
name="FANUC_CRX20iAL_J03"
|
|
49
|
+
rotation={[-Math.PI / 2, 0, 0]}
|
|
50
|
+
>
|
|
51
|
+
<animated.group
|
|
52
|
+
name="FANUC_CRX20iAL_J04"
|
|
53
|
+
position={[0, -0.54, 0]}
|
|
54
|
+
rotation={[Math.PI / 2, 0, 0]}
|
|
55
|
+
>
|
|
56
|
+
<animated.group
|
|
57
|
+
name="FANUC_CRX20iAL_J05"
|
|
58
|
+
position={[0, 0.15, 0]}
|
|
59
|
+
rotation={[-Math.PI / 2, 0, 0]}
|
|
60
|
+
>
|
|
61
|
+
<animated.group
|
|
62
|
+
name="FANUC_CRX20iAL_FLG"
|
|
63
|
+
position={[0, -0.16, 0]}
|
|
64
|
+
rotation={[-Math.PI, 0, 0]}
|
|
65
|
+
/>
|
|
66
|
+
<mesh
|
|
67
|
+
name="link_6"
|
|
68
|
+
castShadow
|
|
69
|
+
receiveShadow
|
|
70
|
+
geometry={nodes.link_6.geometry}
|
|
71
|
+
material={materials.fanuc_metal_black}
|
|
72
|
+
position={[-0.71, 0.54, -0.15]}
|
|
73
|
+
rotation={[0, 0, -Math.PI / 2]}
|
|
74
|
+
/>
|
|
75
|
+
</animated.group>
|
|
76
|
+
<animated.group
|
|
77
|
+
name="link_5"
|
|
78
|
+
position={[-0.71, 0, -0.54]}
|
|
79
|
+
rotation={[-Math.PI / 2, 0, -Math.PI / 2]}
|
|
80
|
+
>
|
|
81
|
+
<mesh
|
|
82
|
+
name="shape053"
|
|
83
|
+
castShadow
|
|
84
|
+
receiveShadow
|
|
85
|
+
geometry={nodes.shape053.geometry}
|
|
86
|
+
material={materials.fanuc_white}
|
|
87
|
+
/>
|
|
88
|
+
<mesh
|
|
89
|
+
name="shape053_1"
|
|
90
|
+
castShadow
|
|
91
|
+
receiveShadow
|
|
92
|
+
geometry={nodes.shape053_1.geometry}
|
|
93
|
+
material={materials.fanuc_green}
|
|
94
|
+
/>
|
|
95
|
+
</animated.group>
|
|
96
|
+
</animated.group>
|
|
97
|
+
<animated.group
|
|
98
|
+
name="link_4"
|
|
99
|
+
position={[-0.71, 0, 0]}
|
|
100
|
+
rotation={[0, 0, -Math.PI / 2]}
|
|
101
|
+
>
|
|
102
|
+
<mesh
|
|
103
|
+
name="shape054"
|
|
104
|
+
castShadow
|
|
105
|
+
receiveShadow
|
|
106
|
+
geometry={nodes.shape054.geometry}
|
|
107
|
+
material={materials.fanuc_white}
|
|
108
|
+
/>
|
|
109
|
+
<mesh
|
|
110
|
+
name="shape054_1"
|
|
111
|
+
castShadow
|
|
112
|
+
receiveShadow
|
|
113
|
+
geometry={nodes.shape054_1.geometry}
|
|
114
|
+
material={materials.fanuc_red}
|
|
115
|
+
/>
|
|
116
|
+
<mesh
|
|
117
|
+
name="shape054_2"
|
|
118
|
+
castShadow
|
|
119
|
+
receiveShadow
|
|
120
|
+
geometry={nodes.shape054_2.geometry}
|
|
121
|
+
material={materials.fanuc_metal_black}
|
|
122
|
+
/>
|
|
123
|
+
</animated.group>
|
|
124
|
+
</animated.group>
|
|
125
|
+
<animated.group
|
|
126
|
+
name="link_3"
|
|
127
|
+
position={[-0.71, 0, 0]}
|
|
128
|
+
rotation={[-Math.PI / 2, 0, -Math.PI / 2]}
|
|
129
|
+
>
|
|
130
|
+
<mesh
|
|
131
|
+
name="shape009"
|
|
132
|
+
castShadow
|
|
133
|
+
receiveShadow
|
|
134
|
+
geometry={nodes.shape009.geometry}
|
|
135
|
+
material={materials.fanuc_green}
|
|
136
|
+
/>
|
|
137
|
+
<mesh
|
|
138
|
+
name="shape009_1"
|
|
139
|
+
castShadow
|
|
140
|
+
receiveShadow
|
|
141
|
+
geometry={nodes.shape009_1.geometry}
|
|
142
|
+
material={materials.fanuc_white}
|
|
143
|
+
/>
|
|
144
|
+
</animated.group>
|
|
145
|
+
</animated.group>
|
|
146
|
+
<mesh
|
|
147
|
+
name="link_2"
|
|
148
|
+
castShadow
|
|
149
|
+
receiveShadow
|
|
150
|
+
geometry={nodes.link_2.geometry}
|
|
151
|
+
material={materials.fanuc_white}
|
|
152
|
+
rotation={[-Math.PI / 2, 0, -Math.PI / 2]}
|
|
153
|
+
/>
|
|
154
|
+
</animated.group>
|
|
155
|
+
<group name="link_1" position={[0, 0.245, 0]}>
|
|
156
|
+
<mesh
|
|
157
|
+
name="shape005"
|
|
158
|
+
castShadow
|
|
159
|
+
receiveShadow
|
|
160
|
+
geometry={nodes.shape005.geometry}
|
|
161
|
+
material={materials.fanuc_white}
|
|
162
|
+
/>
|
|
163
|
+
<mesh
|
|
164
|
+
name="shape005_1"
|
|
165
|
+
castShadow
|
|
166
|
+
receiveShadow
|
|
167
|
+
geometry={nodes.shape005_1.geometry}
|
|
168
|
+
material={materials.fanuc_green}
|
|
169
|
+
/>
|
|
170
|
+
</group>
|
|
171
|
+
</animated.group>
|
|
172
|
+
</group>
|
|
173
|
+
</group>
|
|
174
|
+
</>
|
|
175
|
+
)
|
|
176
|
+
}
|
|
@@ -12,6 +12,7 @@ import { Yaskawa_AR1730 } from "./Yaskawa_AR1730"
|
|
|
12
12
|
import { Yaskawa_AR2010 } from "./Yaskawa_AR2010"
|
|
13
13
|
import { Yaskawa_AR3120 } from "./Yaskawa_AR3120"
|
|
14
14
|
import { FANUC_CRX10iA } from "./FANUC_CRX10iA"
|
|
15
|
+
import { FANUC_CRX20iAL } from "./FANUC_CRX20iAL"
|
|
15
16
|
import { FANUC_CRX25iA } from "./FANUC_CRX25iA"
|
|
16
17
|
import { FANUC_CRX25iAL } from "./FANUC_CRX25iAL"
|
|
17
18
|
import { KUKA_KR210_R2700 } from "./KUKA_KR210_R2700"
|
|
@@ -204,6 +205,9 @@ export function SupportedRobot({
|
|
|
204
205
|
case "FANUC_CRX10iA":
|
|
205
206
|
Robot = FANUC_CRX10iA
|
|
206
207
|
break
|
|
208
|
+
case "FANUC_CRX20iAL":
|
|
209
|
+
Robot = FANUC_CRX20iAL
|
|
210
|
+
break
|
|
207
211
|
case "FANUC_CRX25iA":
|
|
208
212
|
Robot = FANUC_CRX25iA
|
|
209
213
|
break
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react"
|
|
2
|
-
import { WandelscriptEditor } from "
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WandelscriptEditor } from "../../index"
|
|
3
3
|
|
|
4
4
|
const meta: Meta<typeof WandelscriptEditor> = {
|
|
5
5
|
component: WandelscriptEditor,
|
|
6
|
-
}
|
|
7
|
-
export default meta
|
|
6
|
+
}
|
|
7
|
+
export default meta
|
|
8
8
|
|
|
9
9
|
const defaultCode = `start = [832, -452, 289] # The start position of the edge
|
|
10
10
|
end = [817, 168, 288] # The end position of the edge
|
|
@@ -29,7 +29,7 @@ for i = 0..<int(n / 2) - 1:
|
|
|
29
29
|
move via arc(a) to b
|
|
30
30
|
if i == 10:
|
|
31
31
|
test_pose = planned_pose()
|
|
32
|
-
|
|
32
|
+
`
|
|
33
33
|
|
|
34
34
|
export const Editor: StoryObj<typeof WandelscriptEditor> = {
|
|
35
35
|
args: {
|
|
@@ -40,6 +40,6 @@ export const Editor: StoryObj<typeof WandelscriptEditor> = {
|
|
|
40
40
|
<div style={{ height: "400px" }}>
|
|
41
41
|
<WandelscriptEditor {...props} />
|
|
42
42
|
</div>
|
|
43
|
-
)
|
|
43
|
+
)
|
|
44
44
|
},
|
|
45
|
-
}
|
|
45
|
+
}
|