@wandelbots/wandelbots-js-react-components 1.15.2 → 1.16.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wandelbots/wandelbots-js-react-components",
3
- "version": "1.15.2",
3
+ "version": "1.16.1",
4
4
  "description": "React UI toolkit for building applications on top of the Wandelbots platform",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -11,6 +11,7 @@ import { NovaClient } from "@wandelbots/wandelbots-js"
11
11
  import { externalizeComponent } from "../../externalizeComponent"
12
12
  import { isString } from "lodash-es"
13
13
  import { useReaction } from "../utils/hooks"
14
+ import { useTranslation } from "react-i18next"
14
15
 
15
16
  export type JoggingPanelProps = {
16
17
  /** Either an existing NovaClient or the base url of a deployed Nova instance */
@@ -30,6 +31,8 @@ export type JoggingPanelProps = {
30
31
  */
31
32
  export const JoggingPanel = externalizeComponent(
32
33
  observer((props: JoggingPanelProps) => {
34
+ const { t } = useTranslation()
35
+
33
36
  const nova = isString(props.nova)
34
37
  ? new NovaClient({ instanceUrl: props.nova })
35
38
  : props.nova
@@ -116,12 +119,24 @@ const JoggingPanelInner = observer(
116
119
  store: JoggingStore
117
120
  children?: React.ReactNode
118
121
  }) => {
122
+ const { t } = useTranslation()
123
+
119
124
  // Jogger is only active as long as the tab is focused
120
125
  useEffect(() => {
121
- window.addEventListener("blur", store.deactivate)
126
+ function deactivate() {
127
+ store.deactivate()
128
+ }
129
+
130
+ function activate() {
131
+ store.activate()
132
+ }
133
+
134
+ window.addEventListener("blur", deactivate)
135
+ window.addEventListener("focus", activate)
122
136
 
123
137
  return () => {
124
- window.removeEventListener("blur", store.deactivate)
138
+ window.removeEventListener("blur", deactivate)
139
+ window.removeEventListener("focus", activate)
125
140
  }
126
141
  })
127
142
 
@@ -145,10 +160,10 @@ const JoggingPanelInner = observer(
145
160
  <Button
146
161
  color="primary"
147
162
  variant="contained"
148
- onClick={store.activate}
163
+ onClick={() => store.activate({ manual: true })}
149
164
  disabled={store.isLocked}
150
165
  >
151
- Activate jogging
166
+ {t("Jogging.Activate.bt")}
152
167
  </Button>
153
168
  </TransparentOverlay>
154
169
  )
@@ -156,7 +171,7 @@ const JoggingPanelInner = observer(
156
171
  return (
157
172
  <TransparentOverlay>
158
173
  <LoadingCover
159
- message="Activating jogging"
174
+ message={t("Jogging.Activating.lb")}
160
175
  error={store.activationError}
161
176
  />
162
177
  </TransparentOverlay>
@@ -33,6 +33,12 @@ export type IncrementOptionId = IncrementOption["id"]
33
33
  export class JoggingStore {
34
34
  selectedTabId: "cartesian" | "joint" | "debug" = "cartesian"
35
35
 
36
+ /**
37
+ * Whether the user must manually interact to activate jogging, or
38
+ * if it can be done automatically
39
+ */
40
+ manualActivationRequired: boolean = true
41
+
36
42
  /**
37
43
  * State of the jogging panel. Starts as "inactive"
38
44
  */
@@ -160,7 +166,7 @@ export class JoggingStore {
160
166
  this.jogger.dispose()
161
167
  }
162
168
 
163
- async deactivate() {
169
+ async deactivate(opts: { requireManualReactivation?: boolean } = {}) {
164
170
  if (this.activationState === "inactive") return
165
171
  const websocket = this.jogger.activeWebsocket
166
172
 
@@ -170,10 +176,16 @@ export class JoggingStore {
170
176
  if (websocket) {
171
177
  await websocket.closed()
172
178
  }
179
+
180
+ if (opts.requireManualReactivation) {
181
+ runInAction(() => {
182
+ this.manualActivationRequired = true
183
+ })
184
+ }
173
185
  }
174
186
 
175
187
  /** Activate the jogger with current settings */
176
- async activate() {
188
+ async activate(opts: { manual?: boolean } = {}) {
177
189
  const {
178
190
  currentTab,
179
191
  selectedTcpId,
@@ -184,6 +196,8 @@ export class JoggingStore {
184
196
 
185
197
  if (this.activationState === "loading") return
186
198
 
199
+ if (this.manualActivationRequired && !opts.manual) return
200
+
187
201
  runInAction(() => {
188
202
  this.activationState = "loading"
189
203
  this.activationError = null
@@ -219,6 +233,9 @@ export class JoggingStore {
219
233
 
220
234
  runInAction(() => {
221
235
  this.activationState = "active"
236
+ if (opts.manual) {
237
+ this.manualActivationRequired = false
238
+ }
222
239
  })
223
240
  }
224
241
 
@@ -28,83 +28,293 @@ export function UniversalRobots_UR10({
28
28
  />
29
29
  <group {...props} dispose={null}>
30
30
  <group name="Scene">
31
- <group name="UR10" rotation={[Math.PI / 2, 0, 0]}>
32
- <animated.group name="UR10_J01" rotation={[-Math.PI / 2, 0, 0]}>
31
+ <animated.group name="UNIVERSALROBOTS_UR10CB3_J00">
32
+ <group name="link_0">
33
+ <mesh
34
+ name="visuals_0"
35
+ castShadow
36
+ receiveShadow
37
+ geometry={nodes.visuals_0.geometry}
38
+ material={materials.universalrobots_aluminum}
39
+ />
40
+ <mesh
41
+ name="visuals_0_1"
42
+ castShadow
43
+ receiveShadow
44
+ geometry={nodes.visuals_0_1.geometry}
45
+ material={materials.universalrobots_aluminum}
46
+ />
47
+ </group>
48
+ <animated.group
49
+ name="UNIVERSALROBOTS_UR10CB3_J01"
50
+ position={[0, 0.127, 0]}
51
+ rotation={[Math.PI / 2, 0, 0]}
52
+ >
53
+ <group
54
+ name="link_1"
55
+ position={[0, 0, 0.127]}
56
+ rotation={[-Math.PI / 2, 0, 0]}
57
+ >
58
+ <mesh
59
+ name="visuals_1"
60
+ castShadow
61
+ receiveShadow
62
+ geometry={nodes.visuals_1.geometry}
63
+ material={materials.universalrobots_darkgrey}
64
+ />
65
+ <mesh
66
+ name="visuals_1_1"
67
+ castShadow
68
+ receiveShadow
69
+ geometry={nodes.visuals_1_1.geometry}
70
+ material={materials.universalrobots_stainlesssteel}
71
+ />
72
+ <mesh
73
+ name="visuals_1_2"
74
+ castShadow
75
+ receiveShadow
76
+ geometry={nodes.visuals_1_2.geometry}
77
+ material={materials.universalrobots_stainlesssteel}
78
+ />
79
+ <mesh
80
+ name="visuals_1_3"
81
+ castShadow
82
+ receiveShadow
83
+ geometry={nodes.visuals_1_3.geometry}
84
+ material={materials.universalrobots_stainlesssteel}
85
+ />
86
+ <mesh
87
+ name="visuals_1_4"
88
+ castShadow
89
+ receiveShadow
90
+ geometry={nodes.visuals_1_4.geometry}
91
+ material={materials.universalrobots_black}
92
+ />
93
+ <mesh
94
+ name="visuals_1_5"
95
+ castShadow
96
+ receiveShadow
97
+ geometry={nodes.visuals_1_5.geometry}
98
+ material={materials.universalrobots_lightblue}
99
+ />
100
+ </group>
33
101
  <animated.group
34
- name="UR10_J02"
35
- position={[0, 0.126, 0]}
36
- rotation={[Math.PI / 2, 0, 0]}
102
+ name="UNIVERSALROBOTS_UR10CB3_J02"
103
+ position={[-0.612, 0, 0]}
37
104
  >
38
- <animated.group name="UR10_J03" position={[-0.612, 0, 0]}>
39
- <animated.group name="UR10_J04" position={[-0.572, 0, 0]}>
105
+ <group
106
+ name="link_2"
107
+ position={[0.612, 0, 0.127]}
108
+ rotation={[-Math.PI / 2, 0, 0]}
109
+ >
110
+ <mesh
111
+ name="visuals_2"
112
+ castShadow
113
+ receiveShadow
114
+ geometry={nodes.visuals_2.geometry}
115
+ material={materials.universalrobots_aluminum}
116
+ />
117
+ <mesh
118
+ name="visuals_2_1"
119
+ castShadow
120
+ receiveShadow
121
+ geometry={nodes.visuals_2_1.geometry}
122
+ material={materials.universalrobots_stainlesssteel}
123
+ />
124
+ <mesh
125
+ name="visuals_2_2"
126
+ castShadow
127
+ receiveShadow
128
+ geometry={nodes.visuals_2_2.geometry}
129
+ material={materials.universalrobots_darkgrey}
130
+ />
131
+ <mesh
132
+ name="visuals_2_3"
133
+ castShadow
134
+ receiveShadow
135
+ geometry={nodes.visuals_2_3.geometry}
136
+ material={materials.universalrobots_black}
137
+ />
138
+ <mesh
139
+ name="visuals_2_4"
140
+ castShadow
141
+ receiveShadow
142
+ geometry={nodes.visuals_2_4.geometry}
143
+ material={materials.universalrobots_stainlesssteel}
144
+ />
145
+ <mesh
146
+ name="visuals_2_5"
147
+ castShadow
148
+ receiveShadow
149
+ geometry={nodes.visuals_2_5.geometry}
150
+ material={materials.universalrobots_lightblue}
151
+ />
152
+ </group>
153
+ <animated.group
154
+ name="UNIVERSALROBOTS_UR10CB3_J03"
155
+ position={[-0.572, 0, 0]}
156
+ >
157
+ <group
158
+ name="link_3"
159
+ position={[1.184, 0, 0.127]}
160
+ rotation={[-Math.PI / 2, 0, 0]}
161
+ >
162
+ <mesh
163
+ name="visuals_3"
164
+ castShadow
165
+ receiveShadow
166
+ geometry={nodes.visuals_3.geometry}
167
+ material={materials.universalrobots_aluminum}
168
+ />
169
+ <mesh
170
+ name="visuals_3_1"
171
+ castShadow
172
+ receiveShadow
173
+ geometry={nodes.visuals_3_1.geometry}
174
+ material={materials.universalrobots_stainlesssteel}
175
+ />
176
+ <mesh
177
+ name="visuals_3_2"
178
+ castShadow
179
+ receiveShadow
180
+ geometry={nodes.visuals_3_2.geometry}
181
+ material={materials.universalrobots_darkgrey}
182
+ />
183
+ <mesh
184
+ name="visuals_3_3"
185
+ castShadow
186
+ receiveShadow
187
+ geometry={nodes.visuals_3_3.geometry}
188
+ material={materials.universalrobots_black}
189
+ />
190
+ <mesh
191
+ name="visuals_3_4"
192
+ castShadow
193
+ receiveShadow
194
+ geometry={nodes.visuals_3_4.geometry}
195
+ material={materials.universalrobots_lightblue}
196
+ />
197
+ </group>
198
+ <animated.group
199
+ name="UNIVERSALROBOTS_UR10CB3_J04"
200
+ position={[0, 0.164, 0]}
201
+ rotation={[Math.PI / 2, 0, 0]}
202
+ >
203
+ <group
204
+ name="link_4"
205
+ position={[1.184, 0.127, 0.164]}
206
+ rotation={[Math.PI, 0, 0]}
207
+ >
208
+ <mesh
209
+ name="visuals_4"
210
+ castShadow
211
+ receiveShadow
212
+ geometry={nodes.visuals_4.geometry}
213
+ material={materials.universalrobots_darkgrey}
214
+ />
215
+ <mesh
216
+ name="visuals_4_1"
217
+ castShadow
218
+ receiveShadow
219
+ geometry={nodes.visuals_4_1.geometry}
220
+ material={materials.universalrobots_stainlesssteel}
221
+ />
222
+ <mesh
223
+ name="visuals_4_2"
224
+ castShadow
225
+ receiveShadow
226
+ geometry={nodes.visuals_4_2.geometry}
227
+ material={materials.universalrobots_black}
228
+ />
229
+ <mesh
230
+ name="visuals_4_3"
231
+ castShadow
232
+ receiveShadow
233
+ geometry={nodes.visuals_4_3.geometry}
234
+ material={materials.universalrobots_stainlesssteel}
235
+ />
236
+ <mesh
237
+ name="visuals_4_4"
238
+ castShadow
239
+ receiveShadow
240
+ geometry={nodes.visuals_4_4.geometry}
241
+ material={materials.universalrobots_lightblue}
242
+ />
243
+ </group>
40
244
  <animated.group
41
- name="UR10_J05"
42
- position={[0, 0.164, 0]}
43
- rotation={[Math.PI / 2, 0, 0]}
245
+ name="UNIVERSALROBOTS_UR10CB3_J05"
246
+ position={[0, 0.116, 0]}
247
+ rotation={[-Math.PI / 2, 0, 0]}
44
248
  >
45
- <animated.group
46
- name="UR10_J06"
47
- position={[0, 0.116, 0]}
249
+ <group
250
+ name="link_5"
251
+ position={[1.184, -0.164, 0.012]}
48
252
  rotation={[-Math.PI / 2, 0, 0]}
49
253
  >
50
- <group name="UR10_FLG" position={[0, 0.092, 0]} />
51
254
  <mesh
52
- name="UR10_L06"
255
+ name="visuals_5"
53
256
  castShadow
54
257
  receiveShadow
55
- geometry={nodes.UR10_L06.geometry}
56
- material={materials.Standard}
258
+ geometry={nodes.visuals_5.geometry}
259
+ material={materials.universalrobots_darkgrey}
57
260
  />
58
- </animated.group>
59
- <mesh
60
- name="UR10_L05"
61
- castShadow
62
- receiveShadow
63
- geometry={nodes.UR10_L05.geometry}
64
- material={materials.Standard}
65
- />
261
+ <mesh
262
+ name="visuals_5_1"
263
+ castShadow
264
+ receiveShadow
265
+ geometry={nodes.visuals_5_1.geometry}
266
+ material={materials.universalrobots_stainlesssteel}
267
+ />
268
+ <mesh
269
+ name="visuals_5_2"
270
+ castShadow
271
+ receiveShadow
272
+ geometry={nodes.visuals_5_2.geometry}
273
+ material={materials.universalrobots_black}
274
+ />
275
+ <mesh
276
+ name="visuals_5_3"
277
+ castShadow
278
+ receiveShadow
279
+ geometry={nodes.visuals_5_3.geometry}
280
+ material={materials.universalrobots_aluminum}
281
+ />
282
+ <mesh
283
+ name="visuals_5_4"
284
+ castShadow
285
+ receiveShadow
286
+ geometry={nodes.visuals_5_4.geometry}
287
+ material={materials.universalrobots_lightblue}
288
+ />
289
+ </group>
290
+ <group
291
+ name="UNIVERSALROBOTS_UR10CB3_FLG"
292
+ position={[0, 0.116, 0]}
293
+ rotation={[-Math.PI / 2, 0, 0]}
294
+ >
295
+ <group name="link_6" position={[1.184, -0.012, -0.28]}>
296
+ <mesh
297
+ name="visuals_6"
298
+ castShadow
299
+ receiveShadow
300
+ geometry={nodes.visuals_6.geometry}
301
+ material={materials.universalrobots_aluminum}
302
+ />
303
+ <mesh
304
+ name="visuals_6_1"
305
+ castShadow
306
+ receiveShadow
307
+ geometry={nodes.visuals_6_1.geometry}
308
+ material={materials.universalrobots_aluminum}
309
+ />
310
+ </group>
311
+ </group>
66
312
  </animated.group>
67
- <mesh
68
- name="UR10_L04"
69
- castShadow
70
- receiveShadow
71
- geometry={nodes.UR10_L04.geometry}
72
- material={materials.Standard}
73
- />
74
313
  </animated.group>
75
- <mesh
76
- name="UR10_L03"
77
- castShadow
78
- receiveShadow
79
- geometry={nodes.UR10_L03.geometry}
80
- material={materials.Standard}
81
- />
82
314
  </animated.group>
83
- <mesh
84
- name="UR10_L02"
85
- castShadow
86
- receiveShadow
87
- geometry={nodes.UR10_L02.geometry}
88
- material={materials.Standard}
89
- />
90
315
  </animated.group>
91
- <mesh
92
- name="UR10_L01"
93
- castShadow
94
- receiveShadow
95
- geometry={nodes.UR10_L01.geometry}
96
- material={materials.Standard}
97
- />
98
316
  </animated.group>
99
- <mesh
100
- name="UR10_L00"
101
- castShadow
102
- receiveShadow
103
- geometry={nodes.UR10_L00.geometry}
104
- material={materials.Standard}
105
- rotation={[-Math.PI / 2, 0, 0]}
106
- />
107
- </group>
317
+ </animated.group>
108
318
  </group>
109
319
  </group>
110
320
  </>
@@ -9,5 +9,7 @@
9
9
  "Jogging.Cartesian.Rotation.bt": "Rotation",
10
10
  "Jogging.Joints.JointValues.lb": "Gelenkwerte",
11
11
  "Jogging.Increment.Continuous.dd": "Fortlaufend",
12
- "Jogging.Cartesian.Orientation.lb": "Orientierung"
12
+ "Jogging.Cartesian.Orientation.lb": "Orientierung",
13
+ "Jogging.Activate.bt": "Jogging activieren",
14
+ "Jogging.Activating.lb": "Jogging wird aktivieren"
13
15
  }
@@ -9,5 +9,7 @@
9
9
  "Jogging.Cartesian.Rotation.bt": "Rotation",
10
10
  "Jogging.Joints.JointValues.lb": "Joint values",
11
11
  "Jogging.Increment.Continuous.dd": "Continuous",
12
- "Jogging.Cartesian.Orientation.lb": "Orientation"
12
+ "Jogging.Cartesian.Orientation.lb": "Orientation",
13
+ "Jogging.Activate.bt": "Activate jogging",
14
+ "Jogging.Activating.lb": "Activating jogging"
13
15
  }