@wandelbots/wandelbots-js-react-components 1.17.1 → 1.17.3
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/JoggingCartesianTab.d.ts.map +1 -1
- package/dist/components/jogging/JoggingJointLimitDetector.d.ts +1 -1
- package/dist/components/jogging/JoggingJointLimitDetector.d.ts.map +1 -1
- package/dist/components/jogging/JoggingPanel.d.ts +1 -1
- package/dist/components/jogging/JoggingPanel.d.ts.map +1 -1
- package/dist/components/jogging/JoggingStore.d.ts.map +1 -1
- package/dist/components/jogging/JoggingVelocitySlider.d.ts.map +1 -1
- package/dist/i18n/config.d.ts.map +1 -1
- package/dist/index.cjs +25 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2925 -2915
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/jogging/JoggingCartesianTab.tsx +11 -11
- package/src/components/jogging/JoggingJointLimitDetector.tsx +9 -8
- package/src/components/jogging/JoggingPanel.tsx +8 -10
- package/src/components/jogging/JoggingStore.tsx +12 -0
- package/src/components/jogging/JoggingVelocitySlider.tsx +4 -5
- package/src/i18n/config.ts +15 -19
- package/src/i18n/locales/de/translations.json +2 -1
- package/src/i18n/locales/en/translations.json +2 -1
package/package.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
|
-
ToggleButtonGroup,
|
|
3
|
-
ToggleButton,
|
|
4
2
|
Stack,
|
|
3
|
+
ToggleButton,
|
|
4
|
+
ToggleButtonGroup,
|
|
5
5
|
Typography,
|
|
6
6
|
} from "@mui/material"
|
|
7
|
-
import { observer } from "mobx-react-lite"
|
|
8
|
-
import { JoggingCartesianAxisControl } from "./JoggingCartesianAxisControl"
|
|
9
7
|
import { degreesToRadians, radiansToDegrees } from "@wandelbots/wandelbots-js"
|
|
8
|
+
import { observer } from "mobx-react-lite"
|
|
10
9
|
import { useTranslation } from "react-i18next"
|
|
11
|
-
import RotationIcon from "../../icons/rotation.svg"
|
|
12
10
|
import XAxisIcon from "../../icons/axis-x.svg"
|
|
13
11
|
import YAxisIcon from "../../icons/axis-y.svg"
|
|
14
12
|
import ZAxisIcon from "../../icons/axis-z.svg"
|
|
15
|
-
import
|
|
16
|
-
import { JoggingOptions } from "./JoggingOptions"
|
|
17
|
-
import { JoggingVelocitySlider } from "./JoggingVelocitySlider"
|
|
13
|
+
import RotationIcon from "../../icons/rotation.svg"
|
|
18
14
|
import { useReaction } from "../utils/hooks"
|
|
15
|
+
import { JoggingCartesianAxisControl } from "./JoggingCartesianAxisControl"
|
|
19
16
|
import { JoggingCartesianValues } from "./JoggingCartesianValues"
|
|
20
17
|
import { JoggingJointLimitDetector } from "./JoggingJointLimitDetector"
|
|
18
|
+
import { JoggingOptions } from "./JoggingOptions"
|
|
19
|
+
import type { DiscreteIncrementOption, JoggingStore } from "./JoggingStore"
|
|
20
|
+
import { JoggingVelocitySlider } from "./JoggingVelocitySlider"
|
|
21
21
|
|
|
22
22
|
type JoggingCartesianOpts = {
|
|
23
23
|
axis: "x" | "y" | "z"
|
|
@@ -247,11 +247,11 @@ export const JoggingCartesianTab = observer(
|
|
|
247
247
|
))}
|
|
248
248
|
</Stack>
|
|
249
249
|
|
|
250
|
-
{/* Velocity slider */}
|
|
251
|
-
<JoggingVelocitySlider store={store} />
|
|
252
|
-
|
|
253
250
|
{/* Show message if joint limits reached */}
|
|
254
251
|
<JoggingJointLimitDetector store={store} />
|
|
252
|
+
|
|
253
|
+
{/* Velocity slider */}
|
|
254
|
+
<JoggingVelocitySlider store={store} />
|
|
255
255
|
</Stack>
|
|
256
256
|
)
|
|
257
257
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Typography } from "@mui/material"
|
|
2
|
-
import { useTranslation } from "react-i18next"
|
|
3
|
-
import { useState } from "react"
|
|
4
2
|
import isEqual from "lodash-es/isEqual"
|
|
3
|
+
import { useRef, useState } from "react"
|
|
4
|
+
import { useTranslation } from "react-i18next"
|
|
5
5
|
import { useAnimationFrame } from "../utils/hooks"
|
|
6
6
|
import type { JoggingStore } from "./JoggingStore"
|
|
7
7
|
|
|
@@ -20,30 +20,31 @@ export const JoggingJointLimitDetector = ({
|
|
|
20
20
|
store.jogger.motionStream.rapidlyChangingMotionState.state
|
|
21
21
|
.joint_limit_reached.limit_reached,
|
|
22
22
|
)
|
|
23
|
+
const jointLimitsReachedRef = useRef(jointLimitsReached)
|
|
23
24
|
|
|
24
25
|
useAnimationFrame(() => {
|
|
25
26
|
const newLimitsReached =
|
|
26
27
|
store.jogger.motionStream.rapidlyChangingMotionState.state
|
|
27
28
|
.joint_limit_reached.limit_reached
|
|
28
29
|
|
|
29
|
-
if (!isEqual(
|
|
30
|
+
if (!isEqual(jointLimitsReachedRef.current, newLimitsReached)) {
|
|
31
|
+
jointLimitsReachedRef.current = newLimitsReached
|
|
30
32
|
setJointLimitsReached(newLimitsReached)
|
|
31
33
|
}
|
|
32
34
|
})
|
|
33
35
|
|
|
34
36
|
const jointLimitReachedIndices: number[] = []
|
|
35
|
-
jointLimitsReached.
|
|
37
|
+
for (const [index, limitReached] of jointLimitsReached.entries()) {
|
|
36
38
|
if (limitReached) jointLimitReachedIndices.push(index)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (!jointLimitReachedIndices.length) return null
|
|
39
|
+
}
|
|
40
40
|
|
|
41
41
|
return (
|
|
42
42
|
<Typography
|
|
43
43
|
color="error"
|
|
44
44
|
sx={{
|
|
45
|
-
|
|
45
|
+
margin: "0.5rem 1rem",
|
|
46
46
|
textAlign: "center",
|
|
47
|
+
visibility: jointLimitReachedIndices.length ? "visible" : "hidden",
|
|
47
48
|
}}
|
|
48
49
|
>
|
|
49
50
|
{t("Jogging.JointLimitsReached.lb", {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Button, Paper, Stack, Tab, Tabs } from "@mui/material"
|
|
2
|
+
import { NovaClient } from "@wandelbots/wandelbots-js"
|
|
3
|
+
import { isString } from "lodash-es"
|
|
4
|
+
import { runInAction } from "mobx"
|
|
2
5
|
import { observer, useLocalObservable } from "mobx-react-lite"
|
|
3
6
|
import { useEffect } from "react"
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { JoggingStore } from "./JoggingStore"
|
|
7
|
+
import { useTranslation } from "react-i18next"
|
|
8
|
+
import { externalizeComponent } from "../../externalizeComponent"
|
|
7
9
|
import { LoadingCover } from "../LoadingCover"
|
|
8
10
|
import { TransparentOverlay } from "../TransparentOverlay"
|
|
9
|
-
import { runInAction } from "mobx"
|
|
10
|
-
import { NovaClient } from "@wandelbots/wandelbots-js"
|
|
11
|
-
import { externalizeComponent } from "../../externalizeComponent"
|
|
12
|
-
import { isString } from "lodash-es"
|
|
13
11
|
import { useReaction } from "../utils/hooks"
|
|
14
|
-
import {
|
|
12
|
+
import { JoggingCartesianTab } from "./JoggingCartesianTab"
|
|
13
|
+
import { JoggingJointTab } from "./JoggingJointTab"
|
|
14
|
+
import { JoggingStore } from "./JoggingStore"
|
|
15
15
|
|
|
16
16
|
export type JoggingPanelProps = {
|
|
17
17
|
/** Either an existing NovaClient or the base url of a deployed Nova instance */
|
|
@@ -31,8 +31,6 @@ export type JoggingPanelProps = {
|
|
|
31
31
|
*/
|
|
32
32
|
export const JoggingPanel = externalizeComponent(
|
|
33
33
|
observer((props: JoggingPanelProps) => {
|
|
34
|
-
const { t } = useTranslation()
|
|
35
|
-
|
|
36
34
|
const nova = isString(props.nova)
|
|
37
35
|
? new NovaClient({ instanceUrl: props.nova })
|
|
38
36
|
: props.nova
|
|
@@ -203,6 +203,18 @@ export class JoggingStore {
|
|
|
203
203
|
this.activationError = null
|
|
204
204
|
})
|
|
205
205
|
|
|
206
|
+
// Setting mode control makes jogging startup slightly faster
|
|
207
|
+
// on physical robots
|
|
208
|
+
// https://wandelbots.slack.com/archives/C06VA4J59PF/p1725523765976109?thread_ts=1725464963.859559&cid=C06VA4J59PF
|
|
209
|
+
try {
|
|
210
|
+
await this.jogger.nova.api.controller.setDefaultMode(
|
|
211
|
+
this.jogger.motionStream.controllerId,
|
|
212
|
+
"MODE_CONTROL",
|
|
213
|
+
)
|
|
214
|
+
} catch (err) {
|
|
215
|
+
console.error(err)
|
|
216
|
+
}
|
|
217
|
+
|
|
206
218
|
if (currentTab.id === "cartesian") {
|
|
207
219
|
const cartesianJoggingOpts = {
|
|
208
220
|
tcpId: selectedTcpId,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Stack
|
|
1
|
+
import { Stack } from "@mui/material"
|
|
2
2
|
import { observer, useLocalObservable } from "mobx-react-lite"
|
|
3
|
-
import type { JoggingStore } from "./JoggingStore"
|
|
4
|
-
import { VelocitySlider } from "../VelocitySlider"
|
|
5
3
|
import { useTranslation } from "react-i18next"
|
|
4
|
+
import { VelocitySlider } from "../VelocitySlider"
|
|
5
|
+
import type { JoggingStore } from "./JoggingStore"
|
|
6
6
|
|
|
7
7
|
export const JoggingVelocitySlider = observer(
|
|
8
8
|
({ store }: { store: JoggingStore }) => {
|
|
@@ -24,8 +24,7 @@ export const JoggingVelocitySlider = observer(
|
|
|
24
24
|
<Stack
|
|
25
25
|
sx={{
|
|
26
26
|
margin: "0px 20px",
|
|
27
|
-
|
|
28
|
-
marginBottom: "24px",
|
|
27
|
+
marginBottom: "12px",
|
|
29
28
|
}}
|
|
30
29
|
>
|
|
31
30
|
<Stack sx={{ width: "380px", maxWidth: "90%", margin: "auto" }}>
|
package/src/i18n/config.ts
CHANGED
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
import deJSON from "./locales/de/translations.json"
|
|
2
|
-
import enJSON from "./locales/en/translations.json"
|
|
3
|
-
import i18next from "i18next"
|
|
4
1
|
import type { i18n } from "i18next"
|
|
2
|
+
import i18next from "i18next"
|
|
5
3
|
import LanguageDetector from "i18next-browser-languagedetector"
|
|
6
|
-
import
|
|
4
|
+
import deJSON from "./locales/de/translations.json"
|
|
5
|
+
import enJSON from "./locales/en/translations.json"
|
|
7
6
|
|
|
8
7
|
const i18n: i18n = i18next.createInstance()
|
|
9
8
|
|
|
10
|
-
i18n
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
de: {
|
|
20
|
-
translations: deJSON,
|
|
21
|
-
},
|
|
9
|
+
i18n.use(LanguageDetector).init({
|
|
10
|
+
supportedLngs: ["en", "de"],
|
|
11
|
+
resources: {
|
|
12
|
+
en: {
|
|
13
|
+
translations: enJSON,
|
|
14
|
+
},
|
|
15
|
+
de: {
|
|
16
|
+
translations: deJSON,
|
|
22
17
|
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
},
|
|
19
|
+
ns: ["translations"],
|
|
20
|
+
defaultNS: "translations",
|
|
21
|
+
})
|
|
26
22
|
|
|
27
23
|
export default i18n
|
|
@@ -11,5 +11,6 @@
|
|
|
11
11
|
"Jogging.Increment.Continuous.dd": "Fortlaufend",
|
|
12
12
|
"Jogging.Cartesian.Orientation.lb": "Orientierung",
|
|
13
13
|
"Jogging.Activate.bt": "Jogging activieren",
|
|
14
|
-
"Jogging.Activating.lb": "Jogging wird aktivieren"
|
|
14
|
+
"Jogging.Activating.lb": "Jogging wird aktivieren",
|
|
15
|
+
"Jogging.JointLimitsReached.lb": "Joint-Limit für Joint {{jointNumbers}} erreicht"
|
|
15
16
|
}
|
|
@@ -11,5 +11,6 @@
|
|
|
11
11
|
"Jogging.Increment.Continuous.dd": "Continuous",
|
|
12
12
|
"Jogging.Cartesian.Orientation.lb": "Orientation",
|
|
13
13
|
"Jogging.Activate.bt": "Activate jogging",
|
|
14
|
-
"Jogging.Activating.lb": "Activating jogging"
|
|
14
|
+
"Jogging.Activating.lb": "Activating jogging",
|
|
15
|
+
"Jogging.JointLimitsReached.lb": "Joint limit reached for joint {{jointNumbers}}"
|
|
15
16
|
}
|