@wandelbots/wandelbots-js-react-components 1.29.2 → 1.30.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/dist/index.cjs +29 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4845 -4736
- package/dist/index.js.map +1 -1
- package/dist/src/components/CopyableText.d.ts.map +1 -1
- package/dist/src/components/LoadingCover.d.ts.map +1 -1
- package/dist/src/components/VelocitySlider.d.ts +8 -1
- package/dist/src/components/VelocitySlider.d.ts.map +1 -1
- package/dist/src/components/experimental/utils/AdornedSelect.d.ts +8 -0
- package/dist/src/components/experimental/utils/AdornedSelect.d.ts.map +1 -0
- package/dist/src/components/jogging/JoggingCartesianAxisControl.d.ts +3 -2
- package/dist/src/components/jogging/JoggingCartesianAxisControl.d.ts.map +1 -1
- package/dist/src/components/jogging/JoggingCartesianTab.d.ts.map +1 -1
- package/dist/src/components/jogging/JoggingJointLimitDetector.d.ts +1 -1
- package/dist/src/components/jogging/JoggingJointLimitDetector.d.ts.map +1 -1
- package/dist/src/components/jogging/JoggingJointRotationControl.d.ts.map +1 -1
- package/dist/src/components/jogging/JoggingJointTab.d.ts.map +1 -1
- package/dist/src/components/jogging/JoggingOptions.d.ts +1 -1
- package/dist/src/components/jogging/JoggingOptions.d.ts.map +1 -1
- package/dist/src/components/jogging/JoggingPanel.d.ts +3 -0
- package/dist/src/components/jogging/JoggingPanel.d.ts.map +1 -1
- package/dist/src/components/jogging/JoggingStore.d.ts +5 -3
- package/dist/src/components/jogging/JoggingStore.d.ts.map +1 -1
- package/dist/src/components/jogging/JoggingToggleButtonGroup.d.ts +2 -0
- package/dist/src/components/jogging/JoggingToggleButtonGroup.d.ts.map +1 -0
- package/dist/src/components/jogging/JoggingVelocitySlider.d.ts.map +1 -1
- package/dist/src/components/jogging/PoseCartesianValues.d.ts +7 -0
- package/dist/src/components/jogging/PoseCartesianValues.d.ts.map +1 -0
- package/dist/src/components/jogging/PoseJointValues.d.ts +7 -0
- package/dist/src/components/jogging/PoseJointValues.d.ts.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/themes/createDarkTheme.d.ts.map +1 -1
- package/dist/src/themes/themeTypes.d.ts +6 -1
- package/dist/src/themes/themeTypes.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/CopyableText.tsx +69 -12
- package/src/components/LoadingCover.tsx +4 -2
- package/src/components/VelocitySlider.tsx +47 -18
- package/src/components/experimental/utils/AdornedSelect.tsx +42 -0
- package/src/components/jogging/JoggingCartesianAxisControl.tsx +84 -51
- package/src/components/jogging/JoggingCartesianTab.tsx +97 -107
- package/src/components/jogging/JoggingJointLimitDetector.tsx +4 -1
- package/src/components/jogging/JoggingJointRotationControl.tsx +41 -22
- package/src/components/jogging/JoggingJointTab.tsx +34 -43
- package/src/components/jogging/JoggingOptions.tsx +110 -136
- package/src/components/jogging/JoggingPanel.tsx +17 -9
- package/src/components/jogging/JoggingStore.ts +5 -2
- package/src/components/jogging/JoggingToggleButtonGroup.tsx +25 -0
- package/src/components/jogging/JoggingVelocitySlider.tsx +18 -20
- package/src/components/jogging/PoseCartesianValues.tsx +43 -0
- package/src/components/jogging/PoseJointValues.tsx +40 -0
- package/src/i18n/locales/de/translations.json +3 -1
- package/src/i18n/locales/en/translations.json +3 -1
- package/src/icons/jog-minus.svg +5 -0
- package/src/icons/jog-plus.svg +9 -0
- package/src/index.ts +2 -0
- package/src/themes/createDarkTheme.ts +19 -4
- package/src/themes/themeTypes.ts +6 -1
- package/dist/src/components/jogging/JoggingCartesianValues.d.ts +0 -7
- package/dist/src/components/jogging/JoggingCartesianValues.d.ts.map +0 -1
- package/dist/src/components/jogging/JoggingJointValues.d.ts +0 -7
- package/dist/src/components/jogging/JoggingJointValues.d.ts.map +0 -1
- package/src/components/jogging/JoggingCartesianValues.tsx +0 -50
- package/src/components/jogging/JoggingJointValues.tsx +0 -45
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Divider, Stack } from "@mui/material"
|
|
2
2
|
import { radiansToDegrees } from "@wandelbots/wandelbots-js"
|
|
3
3
|
import { observer } from "mobx-react-lite"
|
|
4
4
|
import type { ReactNode } from "react"
|
|
5
5
|
import { JoggingActivationRequired } from "./JoggingActivationRequired"
|
|
6
6
|
import { JoggingJointLimitDetector } from "./JoggingJointLimitDetector"
|
|
7
7
|
import { JoggingJointRotationControl } from "./JoggingJointRotationControl"
|
|
8
|
-
import { JoggingJointValues } from "./JoggingJointValues"
|
|
9
8
|
import type { JoggingStore } from "./JoggingStore"
|
|
10
9
|
import { JoggingVelocitySlider } from "./JoggingVelocitySlider"
|
|
11
10
|
|
|
@@ -27,37 +26,33 @@ export const JoggingJointTab = observer(
|
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
return (
|
|
30
|
-
<Stack flexGrow={1}
|
|
31
|
-
<
|
|
32
|
-
<
|
|
33
|
-
<Stack gap="0.8rem">
|
|
34
|
-
{store.jogger.motionStream.joints.map((joint) => {
|
|
35
|
-
const jointLimits =
|
|
36
|
-
store.motionGroupSpec.mechanical_joint_limits?.[joint.index]
|
|
37
|
-
const lowerLimitDegs =
|
|
38
|
-
jointLimits?.lower_limit !== undefined
|
|
39
|
-
? radiansToDegrees(jointLimits.lower_limit)
|
|
40
|
-
: undefined
|
|
41
|
-
const upperLimitDegs =
|
|
42
|
-
jointLimits?.upper_limit !== undefined
|
|
43
|
-
? radiansToDegrees(jointLimits.upper_limit)
|
|
44
|
-
: undefined
|
|
29
|
+
<Stack flexGrow={1} gap={2} sx={{ padding: "18px 24px" }}>
|
|
30
|
+
<JoggingVelocitySlider store={store} />
|
|
31
|
+
<Divider />
|
|
45
32
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
33
|
+
<Stack
|
|
34
|
+
justifyContent="center"
|
|
35
|
+
alignItems="stretch"
|
|
36
|
+
sx={{ flexGrow: "1" }}
|
|
37
|
+
id="JointControls"
|
|
38
|
+
>
|
|
39
|
+
<JoggingActivationRequired store={store}>
|
|
40
|
+
<Stack alignItems="center" gap="24px" sx={{ flexGrow: 1 }}>
|
|
41
|
+
{store.jogger.motionStream.joints.map((joint) => {
|
|
42
|
+
const jointLimits =
|
|
43
|
+
store.motionGroupSpec.mechanical_joint_limits?.[joint.index]
|
|
44
|
+
const lowerLimitDegs =
|
|
45
|
+
jointLimits?.lower_limit !== undefined
|
|
46
|
+
? radiansToDegrees(jointLimits.lower_limit)
|
|
47
|
+
: undefined
|
|
48
|
+
const upperLimitDegs =
|
|
49
|
+
jointLimits?.upper_limit !== undefined
|
|
50
|
+
? radiansToDegrees(jointLimits.upper_limit)
|
|
51
|
+
: undefined
|
|
52
|
+
|
|
53
|
+
return (
|
|
59
54
|
<JoggingJointRotationControl
|
|
60
|
-
key={joint.index}
|
|
55
|
+
key={`joint-${joint.index}`}
|
|
61
56
|
disabled={store.isLocked}
|
|
62
57
|
lowerLimitDegs={lowerLimitDegs}
|
|
63
58
|
upperLimitDegs={upperLimitDegs}
|
|
@@ -77,19 +72,15 @@ export const JoggingJointTab = observer(
|
|
|
77
72
|
}
|
|
78
73
|
stopJogging={stopJointJogging}
|
|
79
74
|
/>
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
/>
|
|
86
|
-
</Stack>
|
|
87
|
-
)
|
|
88
|
-
})}
|
|
89
|
-
</Stack>
|
|
90
|
-
</JoggingActivationRequired>
|
|
75
|
+
)
|
|
76
|
+
})}
|
|
77
|
+
</Stack>
|
|
78
|
+
</JoggingActivationRequired>
|
|
79
|
+
</Stack>
|
|
91
80
|
<JoggingJointLimitDetector store={store} />
|
|
92
|
-
|
|
81
|
+
|
|
82
|
+
{children && <Divider />}
|
|
83
|
+
|
|
93
84
|
{/* Custom content */}
|
|
94
85
|
{children}
|
|
95
86
|
</Stack>
|
|
@@ -1,155 +1,129 @@
|
|
|
1
|
-
import {
|
|
2
|
-
InputLabel,
|
|
3
|
-
MenuItem,
|
|
4
|
-
Select,
|
|
5
|
-
Stack,
|
|
6
|
-
ToggleButton,
|
|
7
|
-
ToggleButtonGroup,
|
|
8
|
-
} from "@mui/material"
|
|
1
|
+
import { Box, MenuItem } from "@mui/material"
|
|
9
2
|
import { observer } from "mobx-react-lite"
|
|
10
3
|
import { useTranslation } from "react-i18next"
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
4
|
+
import AdornedSelect from "../experimental/utils/AdornedSelect"
|
|
5
|
+
import {
|
|
6
|
+
ORIENTATION_IDS,
|
|
7
|
+
type IncrementOptionId,
|
|
8
|
+
type JoggingStore,
|
|
9
|
+
type OrientationId,
|
|
10
|
+
} from "./JoggingStore"
|
|
14
11
|
|
|
15
12
|
export const JoggingOptions = observer(({ store }: { store: JoggingStore }) => {
|
|
16
13
|
const { t } = useTranslation()
|
|
17
14
|
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
function translateOrientation(orientation: OrientationId): string {
|
|
16
|
+
switch (orientation) {
|
|
17
|
+
case "coordsys":
|
|
18
|
+
return t("Jogging.Orientation.coordsys")
|
|
19
|
+
case "tool":
|
|
20
|
+
return t("Jogging.Orientation.tool")
|
|
21
|
+
default:
|
|
22
|
+
return orientation
|
|
23
|
+
}
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
return (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
<Box
|
|
28
|
+
sx={{
|
|
29
|
+
display: "grid",
|
|
30
|
+
gap: "16px",
|
|
31
|
+
gridTemplateColumns: "1fr 1fr",
|
|
32
|
+
gridTemplateRows: "min-height min-height",
|
|
33
|
+
"& label": {
|
|
34
|
+
opacity: 0.7,
|
|
35
|
+
fontSize: "12px",
|
|
36
|
+
marginBottom: "4px",
|
|
37
|
+
},
|
|
38
|
+
}}
|
|
39
|
+
>
|
|
40
|
+
{/* Coordinate system */}
|
|
41
|
+
<AdornedSelect
|
|
42
|
+
labelId="jogging-coord-select"
|
|
43
|
+
labelValue={"Coordinate Sys."}
|
|
44
|
+
value={store.selectedCoordSystemId}
|
|
45
|
+
size="small"
|
|
46
|
+
variant="filled"
|
|
47
|
+
displayEmpty={true}
|
|
48
|
+
onChange={(event) => {
|
|
49
|
+
store.setSelectedCoordSystemId(event.target.value as string)
|
|
39
50
|
}}
|
|
51
|
+
disabled={store.isLocked}
|
|
40
52
|
>
|
|
41
|
-
{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
onChange={(event) => {
|
|
51
|
-
store.setSelectedCoordSystemId(event.target.value as string)
|
|
52
|
-
}}
|
|
53
|
-
disabled={store.isLocked}
|
|
54
|
-
>
|
|
55
|
-
{store.coordSystems.map((cs) => (
|
|
56
|
-
<MenuItem key={cs.coordinate_system} value={cs.coordinate_system}>
|
|
57
|
-
{/* Distinguish coordinate systems with the same name */}
|
|
58
|
-
{cs.name && store.coordSystemCountByName[cs.name] > 1
|
|
59
|
-
? `${cs.name} / ${cs.coordinate_system}`
|
|
60
|
-
: cs.name || cs.coordinate_system}
|
|
61
|
-
</MenuItem>
|
|
62
|
-
))}
|
|
63
|
-
</Select>
|
|
64
|
-
</Stack>
|
|
53
|
+
{store.coordSystems.map((cs) => (
|
|
54
|
+
<MenuItem key={cs.coordinate_system} value={cs.coordinate_system}>
|
|
55
|
+
{/* Distinguish coordinate systems with the same name */}
|
|
56
|
+
{cs.name && store.coordSystemCountByName[cs.name] > 1
|
|
57
|
+
? `${cs.name} / ${cs.coordinate_system}`
|
|
58
|
+
: cs.name || cs.coordinate_system}
|
|
59
|
+
</MenuItem>
|
|
60
|
+
))}
|
|
61
|
+
</AdornedSelect>
|
|
65
62
|
|
|
66
|
-
|
|
67
|
-
<Stack width="50%">
|
|
68
|
-
<InputLabel id="jogging-tcp-select">TCP</InputLabel>
|
|
69
|
-
<Select
|
|
70
|
-
labelId="jogging-tcp-select"
|
|
71
|
-
value={store.selectedTcpId}
|
|
72
|
-
size="small"
|
|
73
|
-
variant="filled"
|
|
74
|
-
onChange={(event) => {
|
|
75
|
-
store.setSelectedTcpId(event.target.value as string)
|
|
76
|
-
}}
|
|
77
|
-
disabled={store.isLocked}
|
|
78
|
-
>
|
|
79
|
-
{store.tcps.map((tcp) => (
|
|
80
|
-
<MenuItem key={tcp.id} value={tcp.id}>
|
|
81
|
-
{tcp.id}
|
|
82
|
-
</MenuItem>
|
|
83
|
-
))}
|
|
84
|
-
</Select>
|
|
85
|
-
</Stack>
|
|
86
|
-
</Stack>
|
|
63
|
+
{/* TCP selection */}
|
|
87
64
|
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
fontSize: "12px",
|
|
97
|
-
marginBottom: "4px",
|
|
98
|
-
},
|
|
65
|
+
<AdornedSelect
|
|
66
|
+
labelId="jogging-tcp-select"
|
|
67
|
+
labelValue="TCP"
|
|
68
|
+
value={store.selectedTcpId}
|
|
69
|
+
size="small"
|
|
70
|
+
variant="filled"
|
|
71
|
+
onChange={(event) => {
|
|
72
|
+
store.setSelectedTcpId(event.target.value as string)
|
|
99
73
|
}}
|
|
74
|
+
disabled={store.isLocked}
|
|
100
75
|
>
|
|
101
|
-
{
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
value={store.selectedOrientation}
|
|
108
|
-
onChange={onOrientationChange}
|
|
109
|
-
exclusive
|
|
110
|
-
aria-labelledby="orientation-select"
|
|
111
|
-
disabled={store.isLocked}
|
|
112
|
-
>
|
|
113
|
-
<ToggleButton value="coordsys" sx={{ flexGrow: 1 }}>
|
|
114
|
-
<OrientationCoordSysIcon />
|
|
115
|
-
</ToggleButton>
|
|
116
|
-
<ToggleButton value="tool" sx={{ flexGrow: 1 }}>
|
|
117
|
-
<OrientationToolIcon />
|
|
118
|
-
</ToggleButton>
|
|
119
|
-
</ToggleButtonGroup>
|
|
120
|
-
</Stack>
|
|
76
|
+
{store.tcps.map((tcp) => (
|
|
77
|
+
<MenuItem key={tcp.id} value={tcp.id}>
|
|
78
|
+
{tcp.id}
|
|
79
|
+
</MenuItem>
|
|
80
|
+
))}
|
|
81
|
+
</AdornedSelect>
|
|
121
82
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
>
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
83
|
+
{/* Orientation */}
|
|
84
|
+
<AdornedSelect
|
|
85
|
+
labelValue={t("Jogging.Cartesian.Orientation.lb")}
|
|
86
|
+
id="orientation-select"
|
|
87
|
+
labelId="orientation-select"
|
|
88
|
+
value={store.selectedOrientation}
|
|
89
|
+
onChange={(event) => {
|
|
90
|
+
store.setSelectedOrientation(event.target.value as OrientationId)
|
|
91
|
+
}}
|
|
92
|
+
disabled={store.isLocked}
|
|
93
|
+
>
|
|
94
|
+
{ORIENTATION_IDS.map((orientationId) => (
|
|
95
|
+
<MenuItem key={orientationId} value={orientationId}>
|
|
96
|
+
{translateOrientation(orientationId)}
|
|
97
|
+
</MenuItem>
|
|
98
|
+
))}
|
|
99
|
+
</AdornedSelect>
|
|
100
|
+
|
|
101
|
+
{/* Increment selection */}
|
|
102
|
+
<AdornedSelect
|
|
103
|
+
labelValue={"Increment"}
|
|
104
|
+
labelId="jogging-increment-select"
|
|
105
|
+
size="small"
|
|
106
|
+
variant="filled"
|
|
107
|
+
value={store.activeDiscreteIncrement?.id || "continuous"}
|
|
108
|
+
onChange={(event) => {
|
|
109
|
+
store.setSelectedIncrementId(event.target.value as IncrementOptionId)
|
|
110
|
+
}}
|
|
111
|
+
disabled={store.isLocked}
|
|
112
|
+
>
|
|
113
|
+
<MenuItem key="continuous" value="continuous">
|
|
114
|
+
{t("Jogging.Increment.Continuous.dd")}
|
|
115
|
+
</MenuItem>
|
|
140
116
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
</Stack>
|
|
153
|
-
</>
|
|
117
|
+
{store.selectedOrientation === "tool"
|
|
118
|
+
? null
|
|
119
|
+
: store.discreteIncrementOptions.map((inc) => (
|
|
120
|
+
<MenuItem key={inc.id} value={inc.id}>
|
|
121
|
+
{store.currentMotionType === "translate"
|
|
122
|
+
? `${inc.mm}mm`
|
|
123
|
+
: `${inc.degrees}°`}
|
|
124
|
+
</MenuItem>
|
|
125
|
+
))}
|
|
126
|
+
</AdornedSelect>
|
|
127
|
+
</Box>
|
|
154
128
|
)
|
|
155
129
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Stack, Tab, Tabs } from "@mui/material"
|
|
1
|
+
import { Stack, Tab, Tabs, type SxProps } from "@mui/material"
|
|
2
2
|
import { NovaClient } from "@wandelbots/wandelbots-js"
|
|
3
3
|
import { isString } from "lodash-es"
|
|
4
4
|
import { runInAction } from "mobx"
|
|
@@ -11,6 +11,8 @@ import { JoggingCartesianTab } from "./JoggingCartesianTab"
|
|
|
11
11
|
import { JoggingJointTab } from "./JoggingJointTab"
|
|
12
12
|
import { JoggingStore } from "./JoggingStore"
|
|
13
13
|
|
|
14
|
+
export type JoggingPanelTabId = "cartesian" | "joint"
|
|
15
|
+
|
|
14
16
|
export type JoggingPanelProps = {
|
|
15
17
|
/** Either an existing NovaClient or the base url of a deployed Nova instance */
|
|
16
18
|
nova: NovaClient | string
|
|
@@ -22,6 +24,7 @@ export type JoggingPanelProps = {
|
|
|
22
24
|
children?: React.ReactNode
|
|
23
25
|
/** Set this to true to disable jogging UI temporarily e.g. when a program is executing */
|
|
24
26
|
locked?: boolean
|
|
27
|
+
sx?: SxProps
|
|
25
28
|
}
|
|
26
29
|
|
|
27
30
|
/**
|
|
@@ -80,16 +83,16 @@ export const JoggingPanel = externalizeComponent(
|
|
|
80
83
|
<Stack
|
|
81
84
|
sx={{
|
|
82
85
|
maxWidth: "460px",
|
|
83
|
-
minWidth: "
|
|
84
|
-
overflowY: "auto",
|
|
86
|
+
minWidth: "320px",
|
|
85
87
|
position: "relative",
|
|
86
|
-
|
|
88
|
+
...props.sx,
|
|
87
89
|
}}
|
|
88
90
|
>
|
|
89
91
|
{state.joggingStore ? (
|
|
90
|
-
<JoggingPanelInner
|
|
91
|
-
{
|
|
92
|
-
|
|
92
|
+
<JoggingPanelInner
|
|
93
|
+
store={state.joggingStore}
|
|
94
|
+
children={props.children}
|
|
95
|
+
></JoggingPanelInner>
|
|
93
96
|
) : (
|
|
94
97
|
<LoadingCover message="Loading jogging" error={state.loadingError} />
|
|
95
98
|
)}
|
|
@@ -105,6 +108,7 @@ const JoggingPanelInner = observer(
|
|
|
105
108
|
}: {
|
|
106
109
|
store: JoggingStore
|
|
107
110
|
children?: React.ReactNode
|
|
111
|
+
childrenJoint?: React.ReactNode
|
|
108
112
|
}) => {
|
|
109
113
|
// Jogger is only active as long as the tab is focused
|
|
110
114
|
useEffect(() => {
|
|
@@ -155,7 +159,7 @@ const JoggingPanelInner = observer(
|
|
|
155
159
|
}
|
|
156
160
|
|
|
157
161
|
return (
|
|
158
|
-
<Stack flexGrow={1}
|
|
162
|
+
<Stack flexGrow={1} sx={{ overflow: "hidden" }}>
|
|
159
163
|
{/* Tab selection */}
|
|
160
164
|
<Tabs
|
|
161
165
|
value={store.tabIndex}
|
|
@@ -173,7 +177,11 @@ const JoggingPanelInner = observer(
|
|
|
173
177
|
</Tabs>
|
|
174
178
|
|
|
175
179
|
{/* Current tab content */}
|
|
176
|
-
<Stack
|
|
180
|
+
<Stack
|
|
181
|
+
flexGrow={1}
|
|
182
|
+
position="relative"
|
|
183
|
+
sx={{ overflowY: "auto", overflowX: "hidden" }}
|
|
184
|
+
>
|
|
177
185
|
{renderTabContent()}
|
|
178
186
|
</Stack>
|
|
179
187
|
</Stack>
|
|
@@ -31,6 +31,9 @@ export type DiscreteIncrementOption = (typeof discreteIncrementOptions)[number]
|
|
|
31
31
|
export type IncrementOption = (typeof incrementOptions)[number]
|
|
32
32
|
export type IncrementOptionId = IncrementOption["id"]
|
|
33
33
|
|
|
34
|
+
export const ORIENTATION_IDS = ["coordsys", "tool"]
|
|
35
|
+
export type OrientationId = (typeof ORIENTATION_IDS)[number]
|
|
36
|
+
|
|
34
37
|
export class JoggingStore {
|
|
35
38
|
selectedTabId: "cartesian" | "joint" | "debug" = "cartesian"
|
|
36
39
|
|
|
@@ -69,7 +72,7 @@ export class JoggingStore {
|
|
|
69
72
|
* When in tool orientation, the robot moves in a direction relative to the
|
|
70
73
|
* attached tool rotation.
|
|
71
74
|
*/
|
|
72
|
-
selectedOrientation:
|
|
75
|
+
selectedOrientation: OrientationId = "coordsys"
|
|
73
76
|
|
|
74
77
|
/**
|
|
75
78
|
* Id of selected increment amount for jogging. Options are defined by robot pad.
|
|
@@ -426,7 +429,7 @@ export class JoggingStore {
|
|
|
426
429
|
this.selectedTcpId = id
|
|
427
430
|
}
|
|
428
431
|
|
|
429
|
-
setSelectedOrientation(orientation:
|
|
432
|
+
setSelectedOrientation(orientation: OrientationId) {
|
|
430
433
|
this.selectedOrientation = orientation
|
|
431
434
|
}
|
|
432
435
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { styled, ToggleButtonGroup } from "@mui/material"
|
|
2
|
+
|
|
3
|
+
export const JoggingToggleButtonGroup = styled(ToggleButtonGroup)(
|
|
4
|
+
({ theme }) => ({
|
|
5
|
+
"&.MuiToggleButtonGroup-root": {
|
|
6
|
+
background: theme.palette.backgroundPaperElevation?.[8],
|
|
7
|
+
borderRadius: "8px",
|
|
8
|
+
padding: "4px",
|
|
9
|
+
gap: "4px",
|
|
10
|
+
button: {
|
|
11
|
+
border: "none",
|
|
12
|
+
borderRadius: "4px",
|
|
13
|
+
flex: "1 1 0px",
|
|
14
|
+
minWidth: 0,
|
|
15
|
+
"&.MuiToggleButtonGroup-firstButton": {
|
|
16
|
+
borderRadius: "8px 4px 4px 8px",
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
"&.MuiToggleButtonGroup-lastButton": {
|
|
20
|
+
borderRadius: "4px 8px 8px 4px",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
}),
|
|
25
|
+
)
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Stack } from "@mui/material"
|
|
2
1
|
import { observer, useLocalObservable } from "mobx-react-lite"
|
|
3
2
|
import { useTranslation } from "react-i18next"
|
|
4
|
-
import { VelocitySlider } from "../VelocitySlider"
|
|
3
|
+
import { VelocitySlider, VelocitySliderLabel } from "../VelocitySlider"
|
|
5
4
|
import type { JoggingStore } from "./JoggingStore"
|
|
6
5
|
|
|
7
6
|
export const JoggingVelocitySlider = observer(
|
|
@@ -12,32 +11,31 @@ export const JoggingVelocitySlider = observer(
|
|
|
12
11
|
get valueLabelFormat() {
|
|
13
12
|
if (store.currentMotionType === "translate") {
|
|
14
13
|
return (value: number) =>
|
|
15
|
-
`v
|
|
14
|
+
`v = ${t("Jogging.Cartesian.Translation.velocityMmPerSec.lb", { amount: value })}`
|
|
16
15
|
} else {
|
|
17
16
|
return (value: number) =>
|
|
18
|
-
`v
|
|
17
|
+
`v = ${t("Jogging.Cartesian.Rotation.velocityDegPerSec.lb", { amount: value })}`
|
|
19
18
|
}
|
|
20
19
|
},
|
|
21
20
|
}))
|
|
22
21
|
|
|
23
22
|
return (
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
valueLabelFormat={state.valueLabelFormat}
|
|
23
|
+
<VelocitySlider
|
|
24
|
+
velocity={store.velocityInCurrentUnits}
|
|
25
|
+
min={store.minVelocityInCurrentUnits}
|
|
26
|
+
max={store.maxVelocityInCurrentUnits}
|
|
27
|
+
onVelocityChange={store.setVelocityFromSlider}
|
|
28
|
+
disabled={store.isLocked}
|
|
29
|
+
renderValue={(value) => (
|
|
30
|
+
<VelocitySliderLabel
|
|
31
|
+
value={state.valueLabelFormat(value)}
|
|
32
|
+
sx={{
|
|
33
|
+
minWidth:
|
|
34
|
+
store.currentMotionType === "translate" ? "111px" : "90px",
|
|
35
|
+
}}
|
|
38
36
|
/>
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
)}
|
|
38
|
+
/>
|
|
41
39
|
)
|
|
42
40
|
},
|
|
43
41
|
)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Stack } from "@mui/material"
|
|
2
|
+
import {
|
|
3
|
+
MotionStreamConnection,
|
|
4
|
+
poseToWandelscriptString,
|
|
5
|
+
} from "@wandelbots/wandelbots-js"
|
|
6
|
+
import { observer } from "mobx-react-lite"
|
|
7
|
+
import { useRef } from "react"
|
|
8
|
+
import { CopyableText } from "../CopyableText"
|
|
9
|
+
import { useAnimationFrame } from "../utils/hooks"
|
|
10
|
+
|
|
11
|
+
export const PoseCartesianValues = observer(
|
|
12
|
+
({ motionStream }: { motionStream: MotionStreamConnection }) => {
|
|
13
|
+
const poseHolderRef = useRef<HTMLDivElement>(null)
|
|
14
|
+
|
|
15
|
+
function getCurrentPoseString() {
|
|
16
|
+
const tcpPose = motionStream.rapidlyChangingMotionState.tcp_pose
|
|
17
|
+
if (!tcpPose) return ""
|
|
18
|
+
return poseToWandelscriptString(tcpPose)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
useAnimationFrame(() => {
|
|
22
|
+
if (!poseHolderRef.current) {
|
|
23
|
+
return
|
|
24
|
+
}
|
|
25
|
+
const newPoseContent = getCurrentPoseString()
|
|
26
|
+
if (poseHolderRef.current.textContent === newPoseContent) {
|
|
27
|
+
return
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
poseHolderRef.current.textContent = newPoseContent
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<Stack
|
|
35
|
+
alignItems="left"
|
|
36
|
+
spacing={2}
|
|
37
|
+
sx={{ flexGrow: 1, minWidth: 0, overflow: "hidden" }}
|
|
38
|
+
>
|
|
39
|
+
<CopyableText value={getCurrentPoseString()} ref={poseHolderRef} />
|
|
40
|
+
</Stack>
|
|
41
|
+
)
|
|
42
|
+
},
|
|
43
|
+
)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Stack } from "@mui/material"
|
|
2
|
+
import type { MotionStreamConnection } from "@wandelbots/wandelbots-js"
|
|
3
|
+
import { observer } from "mobx-react-lite"
|
|
4
|
+
import { useRef } from "react"
|
|
5
|
+
import { CopyableText } from "../CopyableText"
|
|
6
|
+
import { useAnimationFrame } from "../utils/hooks"
|
|
7
|
+
|
|
8
|
+
export const PoseJointValues = observer(
|
|
9
|
+
({ motionStream }: { motionStream: MotionStreamConnection }) => {
|
|
10
|
+
const poseHolderRef = useRef<HTMLDivElement>(null)
|
|
11
|
+
|
|
12
|
+
function getCurrentPoseString() {
|
|
13
|
+
const { joints } =
|
|
14
|
+
motionStream.rapidlyChangingMotionState.state.joint_position
|
|
15
|
+
return `[${joints.map((j) => parseFloat(j.toFixed(4))).join(", ")}]`
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
useAnimationFrame(() => {
|
|
19
|
+
if (!poseHolderRef.current) {
|
|
20
|
+
return
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const newPoseContent = getCurrentPoseString()
|
|
24
|
+
if (poseHolderRef.current.textContent === newPoseContent) {
|
|
25
|
+
return
|
|
26
|
+
}
|
|
27
|
+
poseHolderRef.current.textContent = newPoseContent
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<Stack
|
|
32
|
+
alignItems="left"
|
|
33
|
+
spacing={2}
|
|
34
|
+
sx={{ flexGrow: 1, minWidth: 0, overflow: "hidden" }}
|
|
35
|
+
>
|
|
36
|
+
<CopyableText value={getCurrentPoseString()} ref={poseHolderRef} />
|
|
37
|
+
</Stack>
|
|
38
|
+
)
|
|
39
|
+
},
|
|
40
|
+
)
|
|
@@ -12,5 +12,7 @@
|
|
|
12
12
|
"Jogging.Cartesian.Orientation.lb": "Orientierung",
|
|
13
13
|
"Jogging.Activate.bt": "Jogging aktivieren",
|
|
14
14
|
"Jogging.Activating.lb": "Jogging wird aktiviert",
|
|
15
|
-
"Jogging.JointLimitsReached.lb": "Joint-Limit für Joint {{jointNumbers}} erreicht"
|
|
15
|
+
"Jogging.JointLimitsReached.lb": "Joint-Limit für Joint {{jointNumbers}} erreicht",
|
|
16
|
+
"Jogging.Orientation.coordsys": "Base",
|
|
17
|
+
"Jogging.Orientation.tool": "Tool"
|
|
16
18
|
}
|
|
@@ -12,5 +12,7 @@
|
|
|
12
12
|
"Jogging.Cartesian.Orientation.lb": "Orientation",
|
|
13
13
|
"Jogging.Activate.bt": "Activate jogging",
|
|
14
14
|
"Jogging.Activating.lb": "Activating jogging",
|
|
15
|
-
"Jogging.JointLimitsReached.lb": "Joint limit reached for joint {{jointNumbers}}"
|
|
15
|
+
"Jogging.JointLimitsReached.lb": "Joint limit reached for joint {{jointNumbers}}",
|
|
16
|
+
"Jogging.Orientation.coordsys": "Base",
|
|
17
|
+
"Jogging.Orientation.tool": "Tool"
|
|
16
18
|
}
|