@wandelbots/wandelbots-js-react-components 5.1.1 → 5.2.0-pr.fix-RB-3135-dhparam-type-check.571.bb107d7
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/MotionGroupVisualizer-C6MgXjCN.cjs.map +1 -1
- package/dist/MotionGroupVisualizer-Cm-XYEZe.js.map +1 -1
- package/dist/components/VelocitySlider.d.ts.map +1 -1
- package/dist/components/jogging/JoggingBlocked.d.ts.map +1 -1
- package/dist/components/jogging/JoggingCartesianAxisControl.d.ts.map +1 -1
- package/dist/components/jogging/JoggingCartesianTab.d.ts.map +1 -1
- package/dist/components/jogging/JoggingJointLimitDetector.d.ts +4 -2
- package/dist/components/jogging/JoggingJointLimitDetector.d.ts.map +1 -1
- package/dist/components/jogging/JoggingJointTab.d.ts.map +1 -1
- package/dist/components/jogging/JoggingOptions.d.ts.map +1 -1
- package/dist/components/jogging/JoggingPanel.d.ts.map +1 -1
- package/dist/components/jogging/JoggingStore.d.ts +13 -19
- package/dist/components/jogging/JoggingStore.d.ts.map +1 -1
- package/dist/components/robots/MotionGroupVisualizer.d.ts.map +1 -1
- package/dist/core.cjs.js +1 -1
- package/dist/core.es.js +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/{theming-DouElHKD.js → theming-DdhG_xJf.js} +1123 -1067
- package/dist/{theming-DouElHKD.js.map → theming-DdhG_xJf.js.map} +1 -1
- package/dist/{theming-BgAu1ds7.cjs → theming-UfdcCzUl.cjs} +36 -36
- package/dist/{theming-BgAu1ds7.cjs.map → theming-UfdcCzUl.cjs.map} +1 -1
- package/package.json +1 -1
- package/src/components/VelocitySlider.tsx +7 -1
- package/src/components/jogging/JoggingBlocked.tsx +2 -0
- package/src/components/jogging/JoggingCartesianAxisControl.tsx +6 -1
- package/src/components/jogging/JoggingCartesianTab.tsx +11 -1
- package/src/components/jogging/JoggingJointLimitDetector.tsx +5 -2
- package/src/components/jogging/JoggingJointTab.tsx +21 -7
- package/src/components/jogging/JoggingOptions.tsx +2 -0
- package/src/components/jogging/JoggingPanel.tsx +6 -0
- package/src/components/jogging/JoggingStore.ts +46 -53
- package/src/components/robots/MotionGroupVisualizer.tsx +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wandelbots/wandelbots-js-react-components",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0-pr.fix-RB-3135-dhparam-type-check.571.bb107d7",
|
|
4
4
|
"description": "React UI toolkit for building applications on top of the Wandelbots platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -30,7 +30,13 @@ export const VelocitySlider = observer((props: VelocitySliderProps) => {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
return (
|
|
33
|
-
<Stack
|
|
33
|
+
<Stack
|
|
34
|
+
direction="row"
|
|
35
|
+
gap={2}
|
|
36
|
+
alignItems="center"
|
|
37
|
+
data-testid="velocity-slider"
|
|
38
|
+
aria-label="velocity-slider"
|
|
39
|
+
>
|
|
34
40
|
{store.showVelocityLegend && (
|
|
35
41
|
<Typography
|
|
36
42
|
sx={{
|
|
@@ -137,7 +137,12 @@ export const JoggingCartesianAxisControl = externalizeComponent(
|
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
return (
|
|
140
|
-
<Stack
|
|
140
|
+
<Stack
|
|
141
|
+
height="64px"
|
|
142
|
+
direction="row"
|
|
143
|
+
justifyContent="center"
|
|
144
|
+
{...rest}
|
|
145
|
+
>
|
|
141
146
|
<IconButton
|
|
142
147
|
disabled={disabled}
|
|
143
148
|
disableRipple
|
|
@@ -192,7 +192,13 @@ export const JoggingCartesianTab = observer(
|
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
return (
|
|
195
|
-
<Stack
|
|
195
|
+
<Stack
|
|
196
|
+
data-testid="jogging-cartesian-tab"
|
|
197
|
+
aria-label="jogging-cartesian-tab"
|
|
198
|
+
flexGrow={1}
|
|
199
|
+
gap={2}
|
|
200
|
+
sx={{ padding: "18px 24px" }}
|
|
201
|
+
>
|
|
196
202
|
<Stack gap={2}>
|
|
197
203
|
<JoggingOptions
|
|
198
204
|
store={store}
|
|
@@ -242,6 +248,8 @@ export const JoggingCartesianTab = observer(
|
|
|
242
248
|
axisList.map((axis) => (
|
|
243
249
|
<JoggingCartesianAxisControl
|
|
244
250
|
key={axis.id}
|
|
251
|
+
data-testid={`jogging-cartesian-axis-control-${axis.id}`}
|
|
252
|
+
aria-label={`jogging-cartesian-axis-control-${axis.id}`}
|
|
245
253
|
colors={axis.colors}
|
|
246
254
|
disabled={store.isLocked}
|
|
247
255
|
activeJoggingDirection={
|
|
@@ -286,6 +294,8 @@ export const JoggingCartesianTab = observer(
|
|
|
286
294
|
axisList.map((axis) => (
|
|
287
295
|
<JoggingCartesianAxisControl
|
|
288
296
|
key={axis.id}
|
|
297
|
+
data-testid={`jogging-cartesian-axis-control-${axis.id}`}
|
|
298
|
+
aria-label={`jogging-cartesian-axis-control-${axis.id}`}
|
|
289
299
|
colors={axis.colors}
|
|
290
300
|
disabled={store.isLocked}
|
|
291
301
|
activeJoggingDirection={
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Typography } from "@mui/material"
|
|
2
|
+
import { observer } from "mobx-react-lite"
|
|
2
3
|
import isEqual from "lodash-es/isEqual"
|
|
3
4
|
import { useRef, useState } from "react"
|
|
4
5
|
import { useTranslation } from "react-i18next"
|
|
@@ -9,7 +10,7 @@ import type { JoggingStore } from "./JoggingStore"
|
|
|
9
10
|
* Monitors the active robot motion state and displays a message if
|
|
10
11
|
* any joint limits are reached.
|
|
11
12
|
*/
|
|
12
|
-
export const JoggingJointLimitDetector = ({
|
|
13
|
+
export const JoggingJointLimitDetector = observer(({
|
|
13
14
|
store,
|
|
14
15
|
}: {
|
|
15
16
|
store: JoggingStore
|
|
@@ -40,6 +41,8 @@ export const JoggingJointLimitDetector = ({
|
|
|
40
41
|
|
|
41
42
|
return (
|
|
42
43
|
<Typography
|
|
44
|
+
data-testid="jogging-joint-limit-detector"
|
|
45
|
+
aria-label="jogging-joint-limit-detector"
|
|
43
46
|
color="error"
|
|
44
47
|
sx={{
|
|
45
48
|
margin: "0.5rem 1rem",
|
|
@@ -53,4 +56,4 @@ export const JoggingJointLimitDetector = ({
|
|
|
53
56
|
})}
|
|
54
57
|
</Typography>
|
|
55
58
|
)
|
|
56
|
-
}
|
|
59
|
+
})
|
|
@@ -3,8 +3,9 @@ import { observer } from "mobx-react-lite"
|
|
|
3
3
|
import type { ReactNode } from "react"
|
|
4
4
|
import { JoggingJointLimitDetector } from "./JoggingJointLimitDetector"
|
|
5
5
|
import { JoggingJointValueControl } from "./JoggingJointValueControl"
|
|
6
|
-
import { type JoggingStore
|
|
6
|
+
import { type JoggingStore } from "./JoggingStore"
|
|
7
7
|
import { JoggingVelocitySlider } from "./JoggingVelocitySlider"
|
|
8
|
+
import { JointTypeEnum } from "@wandelbots/nova-js/v2"
|
|
8
9
|
|
|
9
10
|
export const JoggingJointTab = observer(
|
|
10
11
|
({ store, children }: { store: JoggingStore; children: ReactNode }) => {
|
|
@@ -19,11 +20,11 @@ export const JoggingJointTab = observer(
|
|
|
19
20
|
joint: opts.joint,
|
|
20
21
|
direction: opts.direction,
|
|
21
22
|
velocityUnit:
|
|
22
|
-
store.
|
|
23
|
+
store.jointType === JointTypeEnum.PrismaticJoint
|
|
23
24
|
? "mm/s"
|
|
24
25
|
: "rad/s",
|
|
25
26
|
velocityValue:
|
|
26
|
-
store.
|
|
27
|
+
store.jointType === JointTypeEnum.PrismaticJoint
|
|
27
28
|
? store.translationVelocityMmPerSec
|
|
28
29
|
: store.rotationVelocityRadsPerSec,
|
|
29
30
|
|
|
@@ -36,11 +37,17 @@ export const JoggingJointTab = observer(
|
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
return (
|
|
39
|
-
<Stack
|
|
40
|
+
<Stack
|
|
41
|
+
data-testid="jogging-joint-tab"
|
|
42
|
+
aria-label="jogging-joint-tab"
|
|
43
|
+
flexGrow={1}
|
|
44
|
+
gap={2}
|
|
45
|
+
sx={{ padding: "18px 24px" }}
|
|
46
|
+
>
|
|
40
47
|
<JoggingVelocitySlider
|
|
41
48
|
store={store}
|
|
42
49
|
useDegree={
|
|
43
|
-
store.
|
|
50
|
+
store.jointType === JointTypeEnum.RevoluteJoint
|
|
44
51
|
}
|
|
45
52
|
/>
|
|
46
53
|
|
|
@@ -51,7 +58,12 @@ export const JoggingJointTab = observer(
|
|
|
51
58
|
alignItems="stretch"
|
|
52
59
|
sx={{ flexGrow: "1" }}
|
|
53
60
|
>
|
|
54
|
-
<Stack
|
|
61
|
+
<Stack
|
|
62
|
+
data-testid="jogging-joint-value-controls-wrapper"
|
|
63
|
+
aria-label="jogging-joint-value-controls-wrapper"
|
|
64
|
+
alignItems="center"
|
|
65
|
+
gap="24px"
|
|
66
|
+
>
|
|
55
67
|
{store.jogger.motionStream.joints.map((joint) => {
|
|
56
68
|
const jointLimits =
|
|
57
69
|
store.motionGroupDescription.operation_limits.auto_limits
|
|
@@ -60,6 +72,8 @@ export const JoggingJointTab = observer(
|
|
|
60
72
|
return (
|
|
61
73
|
<Stack
|
|
62
74
|
key={`joint-${joint.index}`}
|
|
75
|
+
data-testid={`jogging-joint-value-control-${joint.index}`}
|
|
76
|
+
aria-label={`jogging-joint-value-control-${joint.index}`}
|
|
63
77
|
direction="row"
|
|
64
78
|
alignItems="center"
|
|
65
79
|
justifyContent={"center"}
|
|
@@ -83,7 +97,7 @@ export const JoggingJointTab = observer(
|
|
|
83
97
|
lowerLimit={jointLimits?.lower_limit}
|
|
84
98
|
upperLimit={jointLimits?.upper_limit}
|
|
85
99
|
useDegree={
|
|
86
|
-
store.
|
|
100
|
+
store.jointType === JointTypeEnum.RevoluteJoint
|
|
87
101
|
}
|
|
88
102
|
|
|
89
103
|
getValue={() => {
|
|
@@ -96,6 +96,8 @@ export const JoggingPanel = externalizeComponent(
|
|
|
96
96
|
|
|
97
97
|
return (
|
|
98
98
|
<Stack
|
|
99
|
+
data-testid="jogging-panel"
|
|
100
|
+
aria-label="jogging-panel"
|
|
99
101
|
sx={{
|
|
100
102
|
maxWidth: "460px",
|
|
101
103
|
minWidth: "320px",
|
|
@@ -147,6 +149,8 @@ const JoggingPanelInner = observer(
|
|
|
147
149
|
<Stack flexGrow={1} sx={{ overflow: "hidden" }}>
|
|
148
150
|
{/* Tab selection */}
|
|
149
151
|
<Tabs
|
|
152
|
+
data-testid="jogging-tabs"
|
|
153
|
+
aria-label="jogging-tabs"
|
|
150
154
|
value={store.tabIndex}
|
|
151
155
|
onChange={store.onTabChange}
|
|
152
156
|
variant="fullWidth"
|
|
@@ -167,6 +171,8 @@ const JoggingPanelInner = observer(
|
|
|
167
171
|
return (
|
|
168
172
|
<Tab
|
|
169
173
|
key={tab.id}
|
|
174
|
+
data-testid={`jogging-tab-${tab.id}`}
|
|
175
|
+
aria-label={`jogging-tab-${tab.id}`}
|
|
170
176
|
label={
|
|
171
177
|
store.showTabIcons ? (
|
|
172
178
|
<Stack direction="row" alignItems="center">
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { tryParseJson } from "@wandelbots/nova-js"
|
|
2
|
-
import
|
|
3
|
-
CoordinateSystem,
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import {
|
|
3
|
+
type CoordinateSystem,
|
|
4
|
+
type DHParameter,
|
|
5
|
+
type MotionGroupDescription,
|
|
6
|
+
type RobotTcp,
|
|
7
|
+
type KinematicModel,
|
|
8
|
+
JointTypeEnum,
|
|
6
9
|
} from "@wandelbots/nova-js/v2"
|
|
7
10
|
import { countBy } from "lodash-es"
|
|
8
11
|
import keyBy from "lodash-es/keyBy"
|
|
@@ -40,30 +43,12 @@ export type IncrementJogInProgress = {
|
|
|
40
43
|
axis: JoggingAxis
|
|
41
44
|
}
|
|
42
45
|
|
|
43
|
-
export enum JointCategory {
|
|
44
|
-
REVOLUTE = "REVOLUTE",
|
|
45
|
-
PRISMATIC = "PRISMATIC",
|
|
46
|
-
}
|
|
47
|
-
|
|
48
46
|
type TabType = "cartesian" | "joint" | "debug";
|
|
49
47
|
export type CartesianMotionType = "translate" | "rotate"
|
|
50
48
|
|
|
51
49
|
export class JoggingStore {
|
|
52
50
|
selectedTabId: TabType = "cartesian";
|
|
53
51
|
|
|
54
|
-
/**
|
|
55
|
-
* State of the jogging panel. Starts as "inactive"
|
|
56
|
-
*/
|
|
57
|
-
activationState: "inactive" | "loading" | "active" = "inactive"
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* If an error occurred connecting to the jogging websocket
|
|
61
|
-
*/
|
|
62
|
-
activationError: unknown | null = null
|
|
63
|
-
|
|
64
|
-
/** To avoid activation race conditions */
|
|
65
|
-
activationCounter: number = 0
|
|
66
|
-
|
|
67
52
|
/** Locks to prevent UI interactions during certain operations */
|
|
68
53
|
locks = new Set<string>()
|
|
69
54
|
|
|
@@ -145,6 +130,19 @@ export class JoggingStore {
|
|
|
145
130
|
|
|
146
131
|
disposers: IReactionDisposer[] = []
|
|
147
132
|
|
|
133
|
+
dhParameters: DHParameter[] = []
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Inverse solver from the kinematic model of the motion group to determine, which tabs should be rendered
|
|
137
|
+
*/
|
|
138
|
+
inverseSolver: string | null | undefined = undefined
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Joint type to determine, whether the active robot should be displayed as Robot or Linear Axis and what tabs
|
|
142
|
+
* should be rendered by the JoggingPanel component.
|
|
143
|
+
*/
|
|
144
|
+
jointType: JointTypeEnum = JointTypeEnum.RevoluteJoint
|
|
145
|
+
|
|
148
146
|
/**
|
|
149
147
|
* Load a jogging store with the relevant data it needs
|
|
150
148
|
* from the backend
|
|
@@ -167,6 +165,10 @@ export class JoggingStore {
|
|
|
167
165
|
),
|
|
168
166
|
])
|
|
169
167
|
|
|
168
|
+
const kinematicModel: KinematicModel = await nova.api.motionGroupModels.getMotionGroupKinematicModel(
|
|
169
|
+
description.motion_group_model,
|
|
170
|
+
)
|
|
171
|
+
|
|
170
172
|
const tcps = Object.entries(description.tcps || {}).map(([id, tcp]) => ({
|
|
171
173
|
id,
|
|
172
174
|
readable_name: tcp.name,
|
|
@@ -174,7 +176,7 @@ export class JoggingStore {
|
|
|
174
176
|
orientation: tcp.pose.orientation as Vector3Simple,
|
|
175
177
|
}))
|
|
176
178
|
|
|
177
|
-
return new JoggingStore(jogger, coordinatesystems || [], description, tcps)
|
|
179
|
+
return new JoggingStore(jogger, coordinatesystems || [], description, tcps, kinematicModel)
|
|
178
180
|
}
|
|
179
181
|
|
|
180
182
|
constructor(
|
|
@@ -182,6 +184,7 @@ export class JoggingStore {
|
|
|
182
184
|
readonly coordSystems: CoordinateSystem[],
|
|
183
185
|
readonly motionGroupDescription: MotionGroupDescription,
|
|
184
186
|
readonly tcps: RobotTcp[],
|
|
187
|
+
readonly kinematicModel: KinematicModel,
|
|
185
188
|
) {
|
|
186
189
|
// TODO workaround for default coord system on backend having a canonical id
|
|
187
190
|
// of empty string. Can remove when fixed on API side
|
|
@@ -193,6 +196,10 @@ export class JoggingStore {
|
|
|
193
196
|
}
|
|
194
197
|
this.selectedCoordSystemId = coordSystems[0]?.coordinate_system || "world"
|
|
195
198
|
this.selectedTcpId = tcps[0]?.id || ""
|
|
199
|
+
this.inverseSolver = this.kinematicModel.inverse_solver
|
|
200
|
+
this.jointType =
|
|
201
|
+
motionGroupDescription?.dh_parameters?.[0]?.type ??
|
|
202
|
+
JointTypeEnum.RevoluteJoint
|
|
196
203
|
|
|
197
204
|
// Make all properties observable and actions auto-bound
|
|
198
205
|
makeAutoObservable(this, {}, { autoBind: true })
|
|
@@ -306,17 +313,25 @@ export class JoggingStore {
|
|
|
306
313
|
}
|
|
307
314
|
|
|
308
315
|
get tabs() {
|
|
309
|
-
const tempTabs
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
316
|
+
const tempTabs: { id: TabType; label: string }[] = [
|
|
317
|
+
{
|
|
318
|
+
id: "joint",
|
|
319
|
+
label: "Joints",
|
|
320
|
+
},
|
|
321
|
+
]
|
|
322
|
+
// show the cartesian tab only : 1. when there is a solver or 2. when no solver could be loaded ( as a default )
|
|
323
|
+
// do not show the cartesia tab when the solver is null this means, it cannot get jogged cartesian
|
|
324
|
+
if (
|
|
325
|
+
this.inverseSolver === undefined ||
|
|
326
|
+
this.inverseSolver !== null
|
|
327
|
+
) {
|
|
314
328
|
tempTabs.unshift({
|
|
315
329
|
id: "cartesian",
|
|
316
330
|
label: "Cartesian",
|
|
317
|
-
})
|
|
331
|
+
})
|
|
332
|
+
}
|
|
318
333
|
|
|
319
|
-
return tempTabs
|
|
334
|
+
return tempTabs
|
|
320
335
|
}
|
|
321
336
|
|
|
322
337
|
|
|
@@ -348,10 +363,6 @@ export class JoggingStore {
|
|
|
348
363
|
return keyBy(this.coordSystems, (cs) => cs.coordinate_system)
|
|
349
364
|
}
|
|
350
365
|
|
|
351
|
-
get selectedCoordSystem() {
|
|
352
|
-
return this.coordSystemsById[this.selectedCoordSystemId]
|
|
353
|
-
}
|
|
354
|
-
|
|
355
366
|
/**
|
|
356
367
|
* The id of the coordinate system to use for jogging.
|
|
357
368
|
* If in tool orientation, this is set to "tool", not the
|
|
@@ -401,24 +412,6 @@ export class JoggingStore {
|
|
|
401
412
|
: this.maxTranslationVelocityMmPerSec
|
|
402
413
|
}
|
|
403
414
|
|
|
404
|
-
|
|
405
|
-
/*
|
|
406
|
-
* ToDo replace Hardcoded Models with an api request that delivers the type (will become part of DH-Parameters)
|
|
407
|
-
* Ticket already created
|
|
408
|
-
* */
|
|
409
|
-
get jointCategory(): JointCategory {
|
|
410
|
-
return this.motionGroupDescription.motion_group_model === "ABB_IRT710"
|
|
411
|
-
? JointCategory.PRISMATIC
|
|
412
|
-
: JointCategory.REVOLUTE
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
get isTcpCartesianMoveable(): boolean{
|
|
416
|
-
if(this.motionGroupDescription.motion_group_model === "ABB_IRT710"){
|
|
417
|
-
return false;
|
|
418
|
-
}
|
|
419
|
-
return true;
|
|
420
|
-
}
|
|
421
|
-
|
|
422
415
|
onTabChange(_event: React.SyntheticEvent, newValue: number) {
|
|
423
416
|
const tab = this.tabs[newValue] || this.tabs[0]!
|
|
424
417
|
this.selectedTabId = tab.id
|
|
@@ -444,7 +437,7 @@ export class JoggingStore {
|
|
|
444
437
|
this.incrementJogInProgress = incrementJog
|
|
445
438
|
}
|
|
446
439
|
|
|
447
|
-
setVelocityFromSlider(velocity: number,useDegree
|
|
440
|
+
setVelocityFromSlider(velocity: number, useDegree: boolean) {
|
|
448
441
|
if (useDegree) {
|
|
449
442
|
this.rotationVelocityDegPerSec = velocity
|
|
450
443
|
} else {
|
|
@@ -25,10 +25,6 @@ export const MotionGroupVisualizer: React.FC<MotionGroupVisualizerProps> = exter
|
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Sets the joint type according to delivered dh parameter type
|
|
28
|
-
*
|
|
29
|
-
* TODO as soon as V2 api migration is done, the setting of the default RevoluteJoint value should be
|
|
30
|
-
* deleted, cause the type property is expected to be always delivered. It is not the case in the V1 at the
|
|
31
|
-
* moment.
|
|
32
28
|
*/
|
|
33
29
|
useEffect(() => {
|
|
34
30
|
if (dhParameters.length) {
|