@wandelbots/wandelbots-js-react-components 1.7.1 → 1.8.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.7.1",
3
+ "version": "1.8.0",
4
4
  "description": "React UI toolkit for building applications on top of the Wandelbots platform",
5
5
  "files": [
6
6
  "dist",
@@ -0,0 +1,176 @@
1
+ import { useGLTF } from "@react-three/drei"
2
+ import type * as THREE from "three"
3
+ import type { RobotProps } from "./SupportedRobot"
4
+ import { animated } from "@react-spring/three"
5
+ import RobotAnimator from "./RobotAnimator"
6
+
7
+ export function FANUC_CRX20iAL({
8
+ modelURL,
9
+ rapidlyChangingMotionState,
10
+ ...props
11
+ }: RobotProps) {
12
+ const gltf = useGLTF(modelURL) as any
13
+ const nodes = gltf.nodes
14
+ const materials = gltf.materials
15
+ const rotationOffsets = [0, Math.PI / 2, 0, 0, 0, 0]
16
+
17
+ function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
18
+ jointObjects.forEach(
19
+ (object, index) =>
20
+ (object.rotation.y = jointValues[index]! + rotationOffsets[index]!),
21
+ )
22
+ }
23
+
24
+ return (
25
+ <>
26
+ <RobotAnimator
27
+ rapidlyChangingMotionState={rapidlyChangingMotionState}
28
+ robotRootObjectName="Scene"
29
+ onRotationChanged={setRotation}
30
+ />
31
+ <group {...props} dispose={null}>
32
+ <group name="Scene">
33
+ <mesh
34
+ name="link_0"
35
+ castShadow
36
+ receiveShadow
37
+ geometry={nodes.link_0.geometry}
38
+ material={materials.fanuc_metal_black}
39
+ />
40
+ <animated.group name="FANUC_CRX20iAL_J00" position={[0, -0.245, 0]}>
41
+ <animated.group
42
+ name="FANUC_CRX20iAL_J01"
43
+ position={[0, 0.245, 0]}
44
+ rotation={[Math.PI / 2, Math.PI / 2, 0]}
45
+ >
46
+ <animated.group name="FANUC_CRX20iAL_J02" position={[0.71, 0, 0]}>
47
+ <animated.group
48
+ name="FANUC_CRX20iAL_J03"
49
+ rotation={[-Math.PI / 2, 0, 0]}
50
+ >
51
+ <animated.group
52
+ name="FANUC_CRX20iAL_J04"
53
+ position={[0, -0.54, 0]}
54
+ rotation={[Math.PI / 2, 0, 0]}
55
+ >
56
+ <animated.group
57
+ name="FANUC_CRX20iAL_J05"
58
+ position={[0, 0.15, 0]}
59
+ rotation={[-Math.PI / 2, 0, 0]}
60
+ >
61
+ <animated.group
62
+ name="FANUC_CRX20iAL_FLG"
63
+ position={[0, -0.16, 0]}
64
+ rotation={[-Math.PI, 0, 0]}
65
+ />
66
+ <mesh
67
+ name="link_6"
68
+ castShadow
69
+ receiveShadow
70
+ geometry={nodes.link_6.geometry}
71
+ material={materials.fanuc_metal_black}
72
+ position={[-0.71, 0.54, -0.15]}
73
+ rotation={[0, 0, -Math.PI / 2]}
74
+ />
75
+ </animated.group>
76
+ <animated.group
77
+ name="link_5"
78
+ position={[-0.71, 0, -0.54]}
79
+ rotation={[-Math.PI / 2, 0, -Math.PI / 2]}
80
+ >
81
+ <mesh
82
+ name="shape053"
83
+ castShadow
84
+ receiveShadow
85
+ geometry={nodes.shape053.geometry}
86
+ material={materials.fanuc_white}
87
+ />
88
+ <mesh
89
+ name="shape053_1"
90
+ castShadow
91
+ receiveShadow
92
+ geometry={nodes.shape053_1.geometry}
93
+ material={materials.fanuc_green}
94
+ />
95
+ </animated.group>
96
+ </animated.group>
97
+ <animated.group
98
+ name="link_4"
99
+ position={[-0.71, 0, 0]}
100
+ rotation={[0, 0, -Math.PI / 2]}
101
+ >
102
+ <mesh
103
+ name="shape054"
104
+ castShadow
105
+ receiveShadow
106
+ geometry={nodes.shape054.geometry}
107
+ material={materials.fanuc_white}
108
+ />
109
+ <mesh
110
+ name="shape054_1"
111
+ castShadow
112
+ receiveShadow
113
+ geometry={nodes.shape054_1.geometry}
114
+ material={materials.fanuc_red}
115
+ />
116
+ <mesh
117
+ name="shape054_2"
118
+ castShadow
119
+ receiveShadow
120
+ geometry={nodes.shape054_2.geometry}
121
+ material={materials.fanuc_metal_black}
122
+ />
123
+ </animated.group>
124
+ </animated.group>
125
+ <animated.group
126
+ name="link_3"
127
+ position={[-0.71, 0, 0]}
128
+ rotation={[-Math.PI / 2, 0, -Math.PI / 2]}
129
+ >
130
+ <mesh
131
+ name="shape009"
132
+ castShadow
133
+ receiveShadow
134
+ geometry={nodes.shape009.geometry}
135
+ material={materials.fanuc_green}
136
+ />
137
+ <mesh
138
+ name="shape009_1"
139
+ castShadow
140
+ receiveShadow
141
+ geometry={nodes.shape009_1.geometry}
142
+ material={materials.fanuc_white}
143
+ />
144
+ </animated.group>
145
+ </animated.group>
146
+ <mesh
147
+ name="link_2"
148
+ castShadow
149
+ receiveShadow
150
+ geometry={nodes.link_2.geometry}
151
+ material={materials.fanuc_white}
152
+ rotation={[-Math.PI / 2, 0, -Math.PI / 2]}
153
+ />
154
+ </animated.group>
155
+ <group name="link_1" position={[0, 0.245, 0]}>
156
+ <mesh
157
+ name="shape005"
158
+ castShadow
159
+ receiveShadow
160
+ geometry={nodes.shape005.geometry}
161
+ material={materials.fanuc_white}
162
+ />
163
+ <mesh
164
+ name="shape005_1"
165
+ castShadow
166
+ receiveShadow
167
+ geometry={nodes.shape005_1.geometry}
168
+ material={materials.fanuc_green}
169
+ />
170
+ </group>
171
+ </animated.group>
172
+ </group>
173
+ </group>
174
+ </>
175
+ )
176
+ }
@@ -12,6 +12,7 @@ import { Yaskawa_AR1730 } from "./Yaskawa_AR1730"
12
12
  import { Yaskawa_AR2010 } from "./Yaskawa_AR2010"
13
13
  import { Yaskawa_AR3120 } from "./Yaskawa_AR3120"
14
14
  import { FANUC_CRX10iA } from "./FANUC_CRX10iA"
15
+ import { FANUC_CRX20iAL } from "./FANUC_CRX20iAL"
15
16
  import { FANUC_CRX25iA } from "./FANUC_CRX25iA"
16
17
  import { FANUC_CRX25iAL } from "./FANUC_CRX25iAL"
17
18
  import { KUKA_KR210_R2700 } from "./KUKA_KR210_R2700"
@@ -204,6 +205,9 @@ export function SupportedRobot({
204
205
  case "FANUC_CRX10iA":
205
206
  Robot = FANUC_CRX10iA
206
207
  break
208
+ case "FANUC_CRX20iAL":
209
+ Robot = FANUC_CRX20iAL
210
+ break
207
211
  case "FANUC_CRX25iA":
208
212
  Robot = FANUC_CRX25iA
209
213
  break