@wandelbots/wandelbots-js-react-components 1.12.2 → 1.13.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wandelbots/wandelbots-js-react-components",
3
- "version": "1.12.2",
3
+ "version": "1.13.0",
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 { Yaskawa_AR1440 } from "./Yaskawa_AR1440"
11
11
  import { Yaskawa_AR1730 } from "./Yaskawa_AR1730"
12
12
  import { Yaskawa_AR2010 } from "./Yaskawa_AR2010"
13
13
  import { Yaskawa_AR3120 } from "./Yaskawa_AR3120"
14
+ import { Yaskawa_GP50 } from "./Yaskawa_GP50"
14
15
  import { FANUC_CRX10iA } from "./FANUC_CRX10iA"
15
16
  import { FANUC_CRX20iAL } from "./FANUC_CRX20iAL"
16
17
  import { FANUC_CRX25iA } from "./FANUC_CRX25iA"
@@ -205,6 +206,9 @@ export const SupportedRobot = externalizeComponent(
205
206
  case "Yaskawa_AR3120":
206
207
  Robot = Yaskawa_AR3120
207
208
  break
209
+ case "Yaskawa_GP50":
210
+ Robot = Yaskawa_GP50
211
+ break
208
212
  case "FANUC_CRX10iA":
209
213
  Robot = FANUC_CRX10iA
210
214
  break
@@ -0,0 +1,252 @@
1
+ import { useGLTF } from "@react-three/drei"
2
+ import type * as THREE from "three"
3
+ import type { RobotProps } from "./SupportedRobot"
4
+ import RobotAnimator from "./RobotAnimator"
5
+ import { animated } from "@react-spring/three"
6
+
7
+ export function Yaskawa_GP50({
8
+ modelURL,
9
+ rapidlyChangingMotionState,
10
+ ...props
11
+ }: RobotProps) {
12
+ const gltf = useGLTF(modelURL) as any
13
+
14
+ const nodes = gltf.nodes
15
+ const materials = gltf.materials
16
+ const rotationOffsets = [0, -Math.PI / 2, 0, 0, 0, 0]
17
+ const rotationSign = [1, 1, 1, 1, 1, 1]
18
+
19
+ function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
20
+ jointObjects.forEach(
21
+ (object, index) =>
22
+ (object.rotation.y =
23
+ rotationSign[index]! * jointValues[index]! + rotationOffsets[index]!),
24
+ )
25
+ }
26
+
27
+ return (
28
+ <>
29
+ <RobotAnimator
30
+ rapidlyChangingMotionState={rapidlyChangingMotionState}
31
+ robotRootObjectName="Scene"
32
+ onRotationChanged={setRotation}
33
+ />
34
+ <group {...props} dispose={null}>
35
+ <group name="Scene">
36
+ <group name="link_0">
37
+ <mesh
38
+ name="shape439"
39
+ castShadow
40
+ receiveShadow
41
+ geometry={nodes.shape439.geometry}
42
+ material={materials.yaskawa_blue}
43
+ />
44
+ <mesh
45
+ name="shape439_1"
46
+ castShadow
47
+ receiveShadow
48
+ geometry={nodes.shape439_1.geometry}
49
+ material={materials.yaskawa_metalsilver}
50
+ />
51
+ <mesh
52
+ name="shape439_2"
53
+ castShadow
54
+ receiveShadow
55
+ geometry={nodes.shape439_2.geometry}
56
+ material={materials.yaskawa_black}
57
+ />
58
+ </group>
59
+ <animated.group name="YASKAWA_GP50_J00" position={[0, -0.54, 0]}>
60
+ <group name="link_1" position={[0, 0.54, 0]}>
61
+ <mesh
62
+ name="shape320"
63
+ castShadow
64
+ receiveShadow
65
+ geometry={nodes.shape320.geometry}
66
+ material={materials.yaskawa_blue}
67
+ />
68
+ <mesh
69
+ name="shape320_1"
70
+ castShadow
71
+ receiveShadow
72
+ geometry={nodes.shape320_1.geometry}
73
+ material={materials.yaskawa_black}
74
+ />
75
+ <mesh
76
+ name="shape320_2"
77
+ castShadow
78
+ receiveShadow
79
+ geometry={nodes.shape320_2.geometry}
80
+ material={materials.yaskawa_metalsilver}
81
+ />
82
+ <mesh
83
+ name="shape320_3"
84
+ castShadow
85
+ receiveShadow
86
+ geometry={nodes.shape320_3.geometry}
87
+ material={materials.yaskawa_black}
88
+ />
89
+ <mesh
90
+ name="shape320_4"
91
+ castShadow
92
+ receiveShadow
93
+ geometry={nodes.shape320_4.geometry}
94
+ material={materials.yaskawa_white}
95
+ />
96
+ <mesh
97
+ name="shape320_5"
98
+ castShadow
99
+ receiveShadow
100
+ geometry={nodes.shape320_5.geometry}
101
+ material={materials.yaskawa_black}
102
+ />
103
+ </group>
104
+ <animated.group
105
+ name="YASKAWA_GP50_J01"
106
+ position={[0.145, 0.54, 0]}
107
+ rotation={[-Math.PI / 2, -Math.PI / 2, 0]}
108
+ >
109
+ <group
110
+ name="link_2"
111
+ position={[0, 0, 0.145]}
112
+ rotation={[Math.PI / 2, 0, -Math.PI / 2]}
113
+ >
114
+ <mesh
115
+ name="shape440"
116
+ castShadow
117
+ receiveShadow
118
+ geometry={nodes.shape440.geometry}
119
+ material={materials.yaskawa_blue}
120
+ />
121
+ <mesh
122
+ name="shape440_1"
123
+ castShadow
124
+ receiveShadow
125
+ geometry={nodes.shape440_1.geometry}
126
+ material={materials.yaskawa_white}
127
+ />
128
+ <mesh
129
+ name="shape440_2"
130
+ castShadow
131
+ receiveShadow
132
+ geometry={nodes.shape440_2.geometry}
133
+ material={materials.yaskawa_metalsilver}
134
+ />
135
+ <mesh
136
+ name="shape440_3"
137
+ castShadow
138
+ receiveShadow
139
+ geometry={nodes.shape440_3.geometry}
140
+ material={materials.yaskawa_black}
141
+ />
142
+ </group>
143
+ <animated.group
144
+ name="YASKAWA_GP50_J02"
145
+ position={[0.87, 0, 0]}
146
+ rotation={[-Math.PI, 0, 0]}
147
+ >
148
+ <group
149
+ name="link_3"
150
+ position={[-0.87, 0, -0.145]}
151
+ rotation={[-Math.PI / 2, 0, -Math.PI / 2]}
152
+ >
153
+ <mesh
154
+ name="shape341"
155
+ castShadow
156
+ receiveShadow
157
+ geometry={nodes.shape341.geometry}
158
+ material={materials.yaskawa_blue}
159
+ />
160
+ <mesh
161
+ name="shape341_1"
162
+ castShadow
163
+ receiveShadow
164
+ geometry={nodes.shape341_1.geometry}
165
+ material={materials.yaskawa_white}
166
+ />
167
+ <mesh
168
+ name="shape341_2"
169
+ castShadow
170
+ receiveShadow
171
+ geometry={nodes.shape341_2.geometry}
172
+ material={materials.yaskawa_black}
173
+ />
174
+ <mesh
175
+ name="shape341_3"
176
+ castShadow
177
+ receiveShadow
178
+ geometry={nodes.shape341_3.geometry}
179
+ material={materials.yaskawa_black}
180
+ />
181
+ <mesh
182
+ name="shape341_4"
183
+ castShadow
184
+ receiveShadow
185
+ geometry={nodes.shape341_4.geometry}
186
+ material={materials.yaskawa_metalsilver}
187
+ />
188
+ <mesh
189
+ name="shape341_5"
190
+ castShadow
191
+ receiveShadow
192
+ geometry={nodes.shape341_5.geometry}
193
+ material={materials.yaskawa_metalsilver}
194
+ />
195
+ </group>
196
+ <animated.group
197
+ name="YASKAWA_GP50_J03"
198
+ position={[0.21, 0, 0]}
199
+ rotation={[-Math.PI / 2, 0, 0]}
200
+ >
201
+ <mesh
202
+ name="link_4"
203
+ castShadow
204
+ receiveShadow
205
+ geometry={nodes.link_4.geometry}
206
+ material={materials.yaskawa_blue}
207
+ position={[-1.08, 0.145, 0]}
208
+ rotation={[0, 0, -Math.PI / 2]}
209
+ />
210
+ <animated.group
211
+ name="YASKAWA_GP50_J04"
212
+ position={[0, -1.025, 0]}
213
+ rotation={[Math.PI / 2, 0, 0]}
214
+ >
215
+ <mesh
216
+ name="link_5"
217
+ castShadow
218
+ receiveShadow
219
+ geometry={nodes.link_5.geometry}
220
+ material={materials.yaskawa_blue}
221
+ position={[-1.08, 0, -1.17]}
222
+ rotation={[-Math.PI / 2, 0, -Math.PI / 2]}
223
+ />
224
+ <animated.group
225
+ name="YASKAWA_GP50_J05"
226
+ rotation={[-Math.PI / 2, 0, 0]}
227
+ >
228
+ <mesh
229
+ name="link_6"
230
+ castShadow
231
+ receiveShadow
232
+ geometry={nodes.link_6.geometry}
233
+ material={materials.yaskawa_metalsilver}
234
+ position={[-1.08, 1.17, 0]}
235
+ rotation={[0, 0, -Math.PI / 2]}
236
+ />
237
+ <group
238
+ name="YASKAWA_GP50_FLG"
239
+ position={[0, -0.175, 0]}
240
+ rotation={[-Math.PI, 0, 0]}
241
+ />
242
+ </animated.group>
243
+ </animated.group>
244
+ </animated.group>
245
+ </animated.group>
246
+ </animated.group>
247
+ </animated.group>
248
+ </group>
249
+ </group>
250
+ </>
251
+ )
252
+ }