@wandelbots/wandelbots-js-react-components 1.17.3 → 1.17.5

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.
Files changed (95) hide show
  1. package/dist/components/jogging/JoggingActivationRequired.d.ts +9 -0
  2. package/dist/components/jogging/JoggingActivationRequired.d.ts.map +1 -0
  3. package/dist/components/jogging/JoggingCartesianTab.d.ts.map +1 -1
  4. package/dist/components/jogging/JoggingJointTab.d.ts.map +1 -1
  5. package/dist/components/jogging/JoggingPanel.d.ts.map +1 -1
  6. package/dist/components/robots/ABB_1200_07_7.d.ts +7 -2
  7. package/dist/components/robots/ABB_1200_07_7.d.ts.map +1 -1
  8. package/dist/components/robots/DHRobot.d.ts.map +1 -1
  9. package/dist/components/robots/FANUC_ARC_Mate_100iD.d.ts +7 -2
  10. package/dist/components/robots/FANUC_ARC_Mate_100iD.d.ts.map +1 -1
  11. package/dist/components/robots/FANUC_ARC_Mate_120iD.d.ts +7 -2
  12. package/dist/components/robots/FANUC_ARC_Mate_120iD.d.ts.map +1 -1
  13. package/dist/components/robots/FANUC_CRX10iA.d.ts +7 -2
  14. package/dist/components/robots/FANUC_CRX10iA.d.ts.map +1 -1
  15. package/dist/components/robots/FANUC_CRX20iAL.d.ts +7 -2
  16. package/dist/components/robots/FANUC_CRX20iAL.d.ts.map +1 -1
  17. package/dist/components/robots/FANUC_CRX25iA.d.ts +7 -2
  18. package/dist/components/robots/FANUC_CRX25iA.d.ts.map +1 -1
  19. package/dist/components/robots/FANUC_CRX25iAL.d.ts +7 -2
  20. package/dist/components/robots/FANUC_CRX25iAL.d.ts.map +1 -1
  21. package/dist/components/robots/KUKA_KR16_R2010_2.d.ts +7 -2
  22. package/dist/components/robots/KUKA_KR16_R2010_2.d.ts.map +1 -1
  23. package/dist/components/robots/KUKA_KR210_R2700.d.ts +7 -2
  24. package/dist/components/robots/KUKA_KR210_R2700.d.ts.map +1 -1
  25. package/dist/components/robots/KUKA_KR270_R2700.d.ts +7 -2
  26. package/dist/components/robots/KUKA_KR270_R2700.d.ts.map +1 -1
  27. package/dist/components/robots/Robot.d.ts +3 -3
  28. package/dist/components/robots/Robot.d.ts.map +1 -1
  29. package/dist/components/robots/RobotAnimator.d.ts +7 -4
  30. package/dist/components/robots/RobotAnimator.d.ts.map +1 -1
  31. package/dist/components/robots/SupportedRobot.d.ts +1 -5
  32. package/dist/components/robots/SupportedRobot.d.ts.map +1 -1
  33. package/dist/components/robots/UniversalRobots_UR10.d.ts +2 -2
  34. package/dist/components/robots/UniversalRobots_UR10.d.ts.map +1 -1
  35. package/dist/components/robots/UniversalRobots_UR10e.d.ts +2 -2
  36. package/dist/components/robots/UniversalRobots_UR10e.d.ts.map +1 -1
  37. package/dist/components/robots/UniversalRobots_UR3.d.ts +2 -2
  38. package/dist/components/robots/UniversalRobots_UR3.d.ts.map +1 -1
  39. package/dist/components/robots/UniversalRobots_UR3e.d.ts +2 -2
  40. package/dist/components/robots/UniversalRobots_UR3e.d.ts.map +1 -1
  41. package/dist/components/robots/UniversalRobots_UR5.d.ts +2 -2
  42. package/dist/components/robots/UniversalRobots_UR5.d.ts.map +1 -1
  43. package/dist/components/robots/UniversalRobots_UR5e.d.ts +2 -2
  44. package/dist/components/robots/UniversalRobots_UR5e.d.ts.map +1 -1
  45. package/dist/components/robots/Yaskawa_AR1440.d.ts +8 -2
  46. package/dist/components/robots/Yaskawa_AR1440.d.ts.map +1 -1
  47. package/dist/components/robots/Yaskawa_AR1730.d.ts +8 -2
  48. package/dist/components/robots/Yaskawa_AR1730.d.ts.map +1 -1
  49. package/dist/components/robots/Yaskawa_AR2010.d.ts +8 -2
  50. package/dist/components/robots/Yaskawa_AR2010.d.ts.map +1 -1
  51. package/dist/components/robots/Yaskawa_AR3120.d.ts +8 -2
  52. package/dist/components/robots/Yaskawa_AR3120.d.ts.map +1 -1
  53. package/dist/components/robots/Yaskawa_AR900.d.ts +7 -2
  54. package/dist/components/robots/Yaskawa_AR900.d.ts.map +1 -1
  55. package/dist/components/robots/Yaskawa_GP50.d.ts +7 -2
  56. package/dist/components/robots/Yaskawa_GP50.d.ts.map +1 -1
  57. package/dist/components/robots/types.d.ts +17 -0
  58. package/dist/components/robots/types.d.ts.map +1 -0
  59. package/dist/index.cjs +32 -32
  60. package/dist/index.cjs.map +1 -1
  61. package/dist/index.js +9370 -9717
  62. package/dist/index.js.map +1 -1
  63. package/package.json +1 -1
  64. package/src/components/TransparentOverlay.tsx +2 -2
  65. package/src/components/jogging/JoggingActivationRequired.tsx +46 -0
  66. package/src/components/jogging/JoggingCartesianTab.tsx +84 -79
  67. package/src/components/jogging/JoggingJointTab.tsx +66 -61
  68. package/src/components/jogging/JoggingPanel.tsx +1 -32
  69. package/src/components/robots/ABB_1200_07_7.tsx +7 -22
  70. package/src/components/robots/DHRobot.tsx +34 -33
  71. package/src/components/robots/FANUC_ARC_Mate_100iD.tsx +7 -22
  72. package/src/components/robots/FANUC_ARC_Mate_120iD.tsx +7 -22
  73. package/src/components/robots/FANUC_CRX10iA.tsx +7 -22
  74. package/src/components/robots/FANUC_CRX20iAL.tsx +7 -22
  75. package/src/components/robots/FANUC_CRX25iA.tsx +7 -22
  76. package/src/components/robots/FANUC_CRX25iAL.tsx +7 -22
  77. package/src/components/robots/KUKA_KR16_R2010_2.tsx +19 -34
  78. package/src/components/robots/KUKA_KR210_R2700.tsx +7 -23
  79. package/src/components/robots/KUKA_KR270_R2700.tsx +7 -23
  80. package/src/components/robots/Robot.tsx +3 -3
  81. package/src/components/robots/RobotAnimator.tsx +32 -21
  82. package/src/components/robots/SupportedRobot.tsx +93 -103
  83. package/src/components/robots/UniversalRobots_UR10.tsx +3 -20
  84. package/src/components/robots/UniversalRobots_UR10e.tsx +2 -19
  85. package/src/components/robots/UniversalRobots_UR3.tsx +2 -19
  86. package/src/components/robots/UniversalRobots_UR3e.tsx +3 -20
  87. package/src/components/robots/UniversalRobots_UR5.tsx +3 -20
  88. package/src/components/robots/UniversalRobots_UR5e.tsx +3 -20
  89. package/src/components/robots/Yaskawa_AR1440.tsx +8 -24
  90. package/src/components/robots/Yaskawa_AR1730.tsx +8 -24
  91. package/src/components/robots/Yaskawa_AR2010.tsx +8 -24
  92. package/src/components/robots/Yaskawa_AR3120.tsx +8 -24
  93. package/src/components/robots/Yaskawa_AR900.tsx +7 -22
  94. package/src/components/robots/Yaskawa_GP50.tsx +7 -24
  95. package/src/components/robots/types.ts +19 -0
@@ -1,50 +1,47 @@
1
1
  import { Suspense, useCallback, useEffect, useRef } from "react"
2
2
 
3
+ import { ABB_1200_07_7 } from "./ABB_1200_07_7"
4
+ import { FANUC_ARC_Mate_100iD } from "./FANUC_ARC_Mate_100iD"
5
+ import { FANUC_ARC_Mate_120iD } from "./FANUC_ARC_Mate_120iD"
6
+ import { FANUC_CRX10iA } from "./FANUC_CRX10iA"
7
+ import { FANUC_CRX20iAL } from "./FANUC_CRX20iAL"
8
+ import { FANUC_CRX25iA } from "./FANUC_CRX25iA"
9
+ import { FANUC_CRX25iAL } from "./FANUC_CRX25iAL"
10
+ import { KUKA_KR16_R2010_2 } from "./KUKA_KR16_R2010_2"
11
+ import { KUKA_KR210_R2700 } from "./KUKA_KR210_R2700"
12
+ import { KUKA_KR270_R2700 } from "./KUKA_KR270_R2700"
13
+ import { UniversalRobots_UR10 } from "./UniversalRobots_UR10"
14
+ import { UniversalRobots_UR10e } from "./UniversalRobots_UR10e"
3
15
  import { UniversalRobots_UR3 } from "./UniversalRobots_UR3"
4
16
  import { UniversalRobots_UR3e } from "./UniversalRobots_UR3e"
5
17
  import { UniversalRobots_UR5 } from "./UniversalRobots_UR5"
6
18
  import { UniversalRobots_UR5e } from "./UniversalRobots_UR5e"
7
- import { UniversalRobots_UR10 } from "./UniversalRobots_UR10"
8
- import { UniversalRobots_UR10e } from "./UniversalRobots_UR10e"
9
- import { Yaskawa_AR900 } from "./Yaskawa_AR900"
10
19
  import { Yaskawa_AR1440 } from "./Yaskawa_AR1440"
11
20
  import { Yaskawa_AR1730 } from "./Yaskawa_AR1730"
12
21
  import { Yaskawa_AR2010 } from "./Yaskawa_AR2010"
13
22
  import { Yaskawa_AR3120 } from "./Yaskawa_AR3120"
23
+ import { Yaskawa_AR900 } from "./Yaskawa_AR900"
14
24
  import { Yaskawa_GP50 } from "./Yaskawa_GP50"
15
- import { FANUC_CRX10iA } from "./FANUC_CRX10iA"
16
- import { FANUC_CRX20iAL } from "./FANUC_CRX20iAL"
17
- import { FANUC_CRX25iA } from "./FANUC_CRX25iA"
18
- import { FANUC_CRX25iAL } from "./FANUC_CRX25iAL"
19
- import { KUKA_KR210_R2700 } from "./KUKA_KR210_R2700"
20
- import { KUKA_KR270_R2700 } from "./KUKA_KR270_R2700"
21
- import { KUKA_KR16_R2010_2 } from "./KUKA_KR16_R2010_2"
22
- import { FANUC_ARC_Mate_100iD } from "./FANUC_ARC_Mate_100iD"
23
- import { FANUC_ARC_Mate_120iD } from "./FANUC_ARC_Mate_120iD"
24
- import { ABB_1200_07_7 } from "./ABB_1200_07_7"
25
25
 
26
26
  import type { GroupProps } from "@react-three/fiber"
27
27
  import type {
28
- MotionGroupStateResponse,
29
28
  DHParameter,
29
+ MotionGroupStateResponse,
30
30
  } from "@wandelbots/wandelbots-api-client"
31
31
  import { DHRobot } from "./DHRobot"
32
32
 
33
- import * as THREE from "three"
34
33
  import { ErrorBoundary } from "react-error-boundary"
35
- import ConsoleFilter from "../ConsoleFilter"
34
+ import * as THREE from "three"
36
35
  import { externalizeComponent } from "../../externalizeComponent"
36
+ import ConsoleFilter from "../ConsoleFilter"
37
+ import RobotAnimator from "./RobotAnimator"
38
+ import type { RobotModelComponent } from "./types"
37
39
 
38
40
  export type DHRobotProps = {
39
41
  rapidlyChangingMotionState: MotionGroupStateResponse
40
42
  dhParameters: Array<DHParameter>
41
43
  } & GroupProps
42
44
 
43
- export type RobotProps = {
44
- rapidlyChangingMotionState: MotionGroupStateResponse
45
- modelURL: string
46
- } & GroupProps
47
-
48
45
  export type SupportedRobotProps = {
49
46
  rapidlyChangingMotionState: MotionGroupStateResponse
50
47
  modelFromController: string
@@ -66,107 +63,93 @@ export const SupportedRobot = externalizeComponent(
66
63
  isGhost = false,
67
64
  ...props
68
65
  }: SupportedRobotProps) => {
69
- let Robot
66
+ let Robot: RobotModelComponent | null = null
70
67
 
71
- const robotRef = useRef<THREE.Group>(new THREE.Group())
68
+ const robotRef = useRef<THREE.Group>()
72
69
 
73
70
  const setRobotRef = useCallback(
74
71
  (instance: THREE.Group | null) => {
75
- if (instance !== null) {
76
- robotRef.current = instance
77
- console.log("robotRef.current", robotRef.current)
78
- if (
79
- isGhost &&
80
- robotRef.current &&
81
- robotRef.current.children.length > 0
82
- ) {
83
- addGhosts()
84
- }
85
- }
72
+ if (!instance) return
73
+ robotRef.current = instance
74
+
75
+ if (isGhost) applyGhostStyle()
86
76
  },
87
77
  [isGhost],
88
78
  )
89
79
 
90
- const addGhosts = () => {
91
- if (robotRef.current && !robotRef.current.userData.ghostsCreated) {
92
- robotRef.current.traverse((obj) => {
93
- if (obj instanceof THREE.Mesh && !obj.userData.isGhost) {
94
- if (obj.material instanceof THREE.Material) {
95
- obj.material.colorWrite = false
96
- }
80
+ const applyGhostStyle = () => {
81
+ if (!robotRef.current || robotRef.current.userData.isGhost) return
97
82
 
98
- // Create a clone of the mesh
99
- const depth = obj.clone()
100
- const ghost = obj.clone()
83
+ robotRef.current.traverse((obj) => {
84
+ if (obj instanceof THREE.Mesh) {
85
+ if (obj.material instanceof THREE.Material) {
86
+ obj.material.colorWrite = true
87
+ }
88
+
89
+ // Create a clone of the mesh
90
+ const depth = obj.clone()
91
+ const ghost = obj.clone()
101
92
 
102
- depth.material = new THREE.MeshStandardMaterial({
103
- depthTest: true,
104
- depthWrite: true,
105
- colorWrite: false,
106
- polygonOffset: true,
107
- polygonOffsetFactor: 1,
108
- })
109
- depth.userData.isGhost = true
93
+ depth.material = new THREE.MeshStandardMaterial({
94
+ depthTest: true,
95
+ depthWrite: true,
96
+ colorWrite: false,
97
+ polygonOffset: true,
98
+ polygonOffsetFactor: 1,
99
+ })
100
+ depth.userData.isGhost = true
110
101
 
111
- // Set the material for the ghost mesh
112
- ghost.material = new THREE.MeshStandardMaterial({
113
- color: "#D91433",
114
- opacity: 0.3,
115
- depthTest: true,
116
- depthWrite: false,
117
- transparent: true,
118
- polygonOffset: true,
119
- polygonOffsetFactor: -1,
120
- })
121
- ghost.userData.isGhost = true
102
+ // Set the material for the ghost mesh
103
+ ghost.material = new THREE.MeshStandardMaterial({
104
+ color: "#D91433",
105
+ opacity: 0.3,
106
+ depthTest: true,
107
+ depthWrite: false,
108
+ transparent: true,
109
+ polygonOffset: true,
110
+ polygonOffsetFactor: -1,
111
+ })
112
+ ghost.userData.isGhost = true
122
113
 
123
- if (obj.parent) {
124
- obj.parent.add(depth)
125
- obj.parent.add(ghost)
126
- }
114
+ if (obj.parent) {
115
+ obj.parent.add(depth)
116
+ obj.parent.add(ghost)
127
117
  }
128
- })
129
- robotRef.current.userData.ghostsCreated = true
130
- }
118
+ }
119
+ })
120
+
121
+ robotRef.current.userData.isGhost = true
131
122
  }
132
123
 
133
- const removeGhosts = () => {
134
- if (robotRef.current) {
135
- const objectsToRemove: THREE.Object3D[] = []
124
+ const removeGhostStyle = () => {
125
+ if (!robotRef.current || !robotRef.current.userData.isGhost) return
136
126
 
137
- robotRef.current.traverse((obj) => {
138
- if (obj instanceof THREE.Mesh) {
139
- if (obj.material instanceof THREE.Material) {
140
- obj.material.colorWrite = true
141
- }
142
- }
127
+ const objectsToRemove: THREE.Object3D[] = []
143
128
 
144
- if (
145
- obj instanceof THREE.Mesh &&
146
- obj.userData !== undefined &&
147
- obj.userData &&
148
- obj.userData.isGhost !== undefined &&
149
- obj.userData.isGhost
150
- ) {
129
+ robotRef.current.traverse((obj) => {
130
+ if (obj instanceof THREE.Mesh) {
131
+ if (obj.userData?.isGhost) {
151
132
  objectsToRemove.push(obj)
133
+ } else if (obj.material instanceof THREE.Material) {
134
+ obj.material.colorWrite = true
152
135
  }
153
- })
136
+ }
137
+ })
154
138
 
155
- objectsToRemove.forEach((obj) => {
156
- if (obj.parent) {
157
- obj.parent.remove(obj)
158
- }
159
- })
139
+ objectsToRemove.forEach((obj) => {
140
+ if (obj.parent) {
141
+ obj.parent.remove(obj)
142
+ }
143
+ })
160
144
 
161
- robotRef.current.userData.ghostsCreated = false
162
- }
145
+ robotRef.current.userData.isGhost = true
163
146
  }
164
147
 
165
148
  useEffect(() => {
166
149
  if (isGhost) {
167
- addGhosts()
150
+ applyGhostStyle()
168
151
  } else {
169
- removeGhosts()
152
+ removeGhostStyle()
170
153
  }
171
154
  }, [isGhost])
172
155
 
@@ -245,7 +228,7 @@ export const SupportedRobot = externalizeComponent(
245
228
  break
246
229
  default:
247
230
  console.warn(`Unknown robot type: ${modelFromController}`)
248
- Robot = DHRobot
231
+ Robot = null
249
232
  }
250
233
 
251
234
  return (
@@ -268,12 +251,19 @@ export const SupportedRobot = externalizeComponent(
268
251
  }
269
252
  >
270
253
  <group ref={setRobotRef}>
271
- <Robot
272
- rapidlyChangingMotionState={rapidlyChangingMotionState}
273
- modelURL={getModel(modelFromController)}
274
- dhParameters={dhParameters}
275
- {...props}
276
- />
254
+ {Robot ? (
255
+ <RobotAnimator
256
+ rapidlyChangingMotionState={rapidlyChangingMotionState}
257
+ robotConfig={Robot.config}
258
+ >
259
+ <Robot modelURL={getModel(modelFromController)} {...props} />
260
+ </RobotAnimator>
261
+ ) : (
262
+ <DHRobot
263
+ rapidlyChangingMotionState={rapidlyChangingMotionState}
264
+ dhParameters={dhParameters}
265
+ />
266
+ )}
277
267
  </group>
278
268
  </Suspense>
279
269
  <ConsoleFilter />
@@ -1,31 +1,14 @@
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
1
  import { animated } from "@react-spring/three"
2
+ import { useGLTF } from "@react-three/drei"
3
+ import type { RobotModelProps } from "./types"
6
4
 
7
- export function UniversalRobots_UR10({
8
- modelURL,
9
- rapidlyChangingMotionState,
10
- ...props
11
- }: RobotProps) {
5
+ export function UniversalRobots_UR10({ modelURL, ...props }: RobotModelProps) {
12
6
  const gltf = useGLTF(modelURL) as any
13
7
  const nodes = gltf.nodes
14
8
  const materials = gltf.materials
15
9
 
16
- function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
17
- jointObjects.forEach(
18
- (object, index) => (object.rotation.y = jointValues[index]!),
19
- )
20
- }
21
-
22
10
  return (
23
11
  <>
24
- <RobotAnimator
25
- rapidlyChangingMotionState={rapidlyChangingMotionState}
26
- robotRootObjectName="Scene"
27
- onRotationChanged={setRotation}
28
- />
29
12
  <group {...props} dispose={null}>
30
13
  <group name="Scene">
31
14
  <animated.group name="UNIVERSALROBOTS_UR10CB3_J00">
@@ -1,31 +1,14 @@
1
1
  import { animated } from "@react-spring/three"
2
2
  import { useGLTF } from "@react-three/drei"
3
- import type { RobotProps } from "./SupportedRobot"
4
- import RobotAnimator from "./RobotAnimator"
5
- import type * as THREE from "three"
3
+ import type { RobotModelProps } from "./types"
6
4
 
7
- export function UniversalRobots_UR10e({
8
- modelURL,
9
- rapidlyChangingMotionState,
10
- ...props
11
- }: RobotProps) {
5
+ export function UniversalRobots_UR10e({ modelURL, ...props }: RobotModelProps) {
12
6
  const gltf = useGLTF(modelURL) as any
13
7
  const nodes = gltf.nodes
14
8
  const materials = gltf.materials
15
9
 
16
- function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
17
- jointObjects.forEach(
18
- (object, index) => (object.rotation.y = jointValues[index]!),
19
- )
20
- }
21
-
22
10
  return (
23
11
  <>
24
- <RobotAnimator
25
- rapidlyChangingMotionState={rapidlyChangingMotionState}
26
- robotRootObjectName="Scene"
27
- onRotationChanged={setRotation}
28
- />
29
12
  <group {...props} dispose={null}>
30
13
  <group name="Scene">
31
14
  <group name="UR10e" rotation={[Math.PI / 2, 0, 0]}>
@@ -1,31 +1,14 @@
1
1
  import { animated } from "@react-spring/three"
2
2
  import { useGLTF } from "@react-three/drei"
3
- import type * as THREE from "three"
4
- import type { RobotProps } from "./SupportedRobot"
5
- import RobotAnimator from "./RobotAnimator"
3
+ import type { RobotModelProps } from "./types"
6
4
 
7
- export function UniversalRobots_UR3({
8
- modelURL,
9
- rapidlyChangingMotionState,
10
- ...props
11
- }: RobotProps) {
5
+ export function UniversalRobots_UR3({ modelURL, ...props }: RobotModelProps) {
12
6
  const gltf = useGLTF(modelURL) as any
13
7
  const nodes = gltf.nodes
14
8
  const materials = gltf.materials
15
9
 
16
- function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
17
- jointObjects.forEach(
18
- (object, index) => (object.rotation.y = jointValues[index]!),
19
- )
20
- }
21
-
22
10
  return (
23
11
  <>
24
- <RobotAnimator
25
- rapidlyChangingMotionState={rapidlyChangingMotionState}
26
- robotRootObjectName="Scene"
27
- onRotationChanged={setRotation}
28
- />
29
12
  <group {...props} dispose={null}>
30
13
  <group name="Scene">
31
14
  <group name="UR3" rotation={[Math.PI / 2, 0, 0]}>
@@ -1,31 +1,14 @@
1
- import { useGLTF } from "@react-three/drei"
2
- import type * as THREE from "three"
3
- import type { RobotProps } from "./SupportedRobot"
4
1
  import { animated } from "@react-spring/three"
5
- import RobotAnimator from "./RobotAnimator"
2
+ import { useGLTF } from "@react-three/drei"
3
+ import type { RobotModelProps } from "./types"
6
4
 
7
- export function UniversalRobots_UR3e({
8
- modelURL,
9
- rapidlyChangingMotionState,
10
- ...props
11
- }: RobotProps) {
5
+ export function UniversalRobots_UR3e({ modelURL, ...props }: RobotModelProps) {
12
6
  const gltf = useGLTF(modelURL) as any
13
7
  const nodes = gltf.nodes
14
8
  const materials = gltf.materials
15
9
 
16
- function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
17
- jointObjects.forEach(
18
- (object, index) => (object.rotation.y = jointValues[index]!),
19
- )
20
- }
21
-
22
10
  return (
23
11
  <>
24
- <RobotAnimator
25
- rapidlyChangingMotionState={rapidlyChangingMotionState}
26
- robotRootObjectName="Scene"
27
- onRotationChanged={setRotation}
28
- />
29
12
  <group {...props} dispose={null}>
30
13
  <group name="Scene">
31
14
  <animated.group name="UR3e" rotation={[Math.PI / 2, 0, 0]}>
@@ -1,31 +1,14 @@
1
- import { useGLTF } from "@react-three/drei"
2
- import type * as THREE from "three"
3
1
  import { animated } from "@react-spring/three"
4
- import type { RobotProps } from "./SupportedRobot"
5
- import RobotAnimator from "./RobotAnimator"
2
+ import { useGLTF } from "@react-three/drei"
3
+ import type { RobotModelProps } from "./types"
6
4
 
7
- export function UniversalRobots_UR5({
8
- modelURL,
9
- rapidlyChangingMotionState,
10
- ...props
11
- }: RobotProps) {
5
+ export function UniversalRobots_UR5({ modelURL, ...props }: RobotModelProps) {
12
6
  const gltf = useGLTF(modelURL) as any
13
7
  const nodes = gltf.nodes
14
8
  const materials = gltf.materials
15
9
 
16
- function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
17
- jointObjects.forEach(
18
- (object, index) => (object.rotation.y = jointValues[index]!),
19
- )
20
- }
21
-
22
10
  return (
23
11
  <>
24
- <RobotAnimator
25
- rapidlyChangingMotionState={rapidlyChangingMotionState}
26
- robotRootObjectName="Scene"
27
- onRotationChanged={setRotation}
28
- />
29
12
  <group {...props} dispose={null}>
30
13
  <group name="Scene">
31
14
  <animated.group name="UNIVERSALROBOTS_UR5CB3_J00">
@@ -1,31 +1,14 @@
1
- import { useGLTF } from "@react-three/drei"
2
- import type * as THREE from "three"
3
- import type { RobotProps } from "./SupportedRobot"
4
1
  import { animated } from "@react-spring/three"
5
- import RobotAnimator from "./RobotAnimator"
2
+ import { useGLTF } from "@react-three/drei"
3
+ import type { RobotModelProps } from "./types"
6
4
 
7
- export function UniversalRobots_UR5e({
8
- modelURL,
9
- rapidlyChangingMotionState,
10
- ...props
11
- }: RobotProps) {
5
+ export function UniversalRobots_UR5e({ modelURL, ...props }: RobotModelProps) {
12
6
  const gltf = useGLTF(modelURL) as any
13
7
  const nodes = gltf.nodes
14
8
  const materials = gltf.materials
15
9
 
16
- function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
17
- jointObjects.forEach(
18
- (object, index) => (object.rotation.y = jointValues[index]!),
19
- )
20
- }
21
-
22
10
  return (
23
11
  <>
24
- <RobotAnimator
25
- rapidlyChangingMotionState={rapidlyChangingMotionState}
26
- robotRootObjectName="Scene"
27
- onRotationChanged={setRotation}
28
- />
29
12
  <group {...props} dispose={null}>
30
13
  <group name="Scene">
31
14
  <group name="UR5e" rotation={[Math.PI / 2, 0, 0]}>
@@ -1,36 +1,20 @@
1
- import { useGLTF } from "@react-three/drei"
2
- import type * as THREE from "three"
3
- import type { RobotProps } from "./SupportedRobot"
4
1
  import { animated } from "@react-spring/three"
5
- import RobotAnimator from "./RobotAnimator"
2
+ import { useGLTF } from "@react-three/drei"
3
+ import type { RobotModelProps } from "./types"
6
4
 
7
- export function Yaskawa_AR1440({
8
- modelURL,
9
- rapidlyChangingMotionState,
10
- ...props
11
- }: RobotProps) {
5
+ Yaskawa_AR1440.config = {
6
+ rotationOffsets: [0, -Math.PI / 2, 0, 0, 0, 0],
7
+ rotationSign: [1, -1, 1, 1, 1, 1],
8
+ }
9
+
10
+ export function Yaskawa_AR1440({ modelURL, ...props }: RobotModelProps) {
12
11
  const gltf = useGLTF(modelURL) as any
13
12
 
14
13
  const nodes = gltf.nodes
15
14
  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
15
 
27
16
  return (
28
17
  <>
29
- <RobotAnimator
30
- rapidlyChangingMotionState={rapidlyChangingMotionState}
31
- robotRootObjectName="Scene"
32
- onRotationChanged={setRotation}
33
- />
34
18
  <group {...props} dispose={null}>
35
19
  <group name="Scene">
36
20
  <group name="AR1440" rotation={[Math.PI / 2, 0, 0]}>
@@ -1,36 +1,20 @@
1
- import { useGLTF } from "@react-three/drei"
2
- import type * as THREE from "three"
3
- import type { RobotProps } from "./SupportedRobot"
4
1
  import { animated } from "@react-spring/three"
5
- import RobotAnimator from "./RobotAnimator"
2
+ import { useGLTF } from "@react-three/drei"
3
+ import type { RobotModelProps } from "./types"
6
4
 
7
- export function Yaskawa_AR1730({
8
- modelURL,
9
- rapidlyChangingMotionState,
10
- ...props
11
- }: RobotProps) {
5
+ Yaskawa_AR1730.config = {
6
+ rotationOffsets: [0, -Math.PI / 2, 0, 0, 0, 0],
7
+ rotationSign: [1, -1, 1, 1, 1, 1],
8
+ }
9
+
10
+ export function Yaskawa_AR1730({ modelURL, ...props }: RobotModelProps) {
12
11
  const gltf = useGLTF(modelURL) as any
13
12
 
14
13
  const nodes = gltf.nodes
15
14
  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
15
 
27
16
  return (
28
17
  <>
29
- <RobotAnimator
30
- rapidlyChangingMotionState={rapidlyChangingMotionState}
31
- robotRootObjectName="Scene"
32
- onRotationChanged={setRotation}
33
- />
34
18
  <group {...props} dispose={null}>
35
19
  <group name="Scene">
36
20
  <animated.group name="AR1730_J00">
@@ -1,35 +1,19 @@
1
- import { useGLTF } from "@react-three/drei"
2
- import type * as THREE from "three"
3
- import type { RobotProps } from "./SupportedRobot"
4
1
  import { animated } from "@react-spring/three"
5
- import RobotAnimator from "./RobotAnimator"
2
+ import { useGLTF } from "@react-three/drei"
3
+ import type { RobotModelProps } from "./types"
6
4
 
7
- export function Yaskawa_AR2010({
8
- modelURL,
9
- rapidlyChangingMotionState,
10
- ...props
11
- }: RobotProps) {
5
+ Yaskawa_AR2010.config = {
6
+ rotationOffsets: [0, -Math.PI / 2, 0, 0, 0, 0],
7
+ rotationSign: [1, -1, 1, 1, 1, 1],
8
+ }
9
+
10
+ export function Yaskawa_AR2010({ modelURL, ...props }: RobotModelProps) {
12
11
  const gltf = useGLTF(modelURL) as any
13
12
  const nodes = gltf.nodes
14
13
  const materials = gltf.materials
15
- const rotationOffsets = [0, -Math.PI / 2, 0, 0, 0, 0]
16
- const rotationSign = [1, -1, 1, 1, 1, 1]
17
-
18
- function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
19
- jointObjects.forEach(
20
- (object, index) =>
21
- (object.rotation.y =
22
- rotationSign[index]! * jointValues[index]! + rotationOffsets[index]!),
23
- )
24
- }
25
14
 
26
15
  return (
27
16
  <>
28
- <RobotAnimator
29
- rapidlyChangingMotionState={rapidlyChangingMotionState}
30
- robotRootObjectName="Scene"
31
- onRotationChanged={setRotation}
32
- />
33
17
  <group {...props} dispose={null}>
34
18
  <group name="Scene">
35
19
  <group name="AR2010" rotation={[Math.PI / 2, 0, 0]}>
@@ -1,36 +1,20 @@
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
1
  import { animated } from "@react-spring/three"
2
+ import { useGLTF } from "@react-three/drei"
3
+ import type { RobotModelProps } from "./types"
6
4
 
7
- export function Yaskawa_AR3120({
8
- modelURL,
9
- rapidlyChangingMotionState,
10
- ...props
11
- }: RobotProps) {
5
+ Yaskawa_AR3120.config = {
6
+ rotationOffsets: [0, -Math.PI / 2, 0, 0, 0, 0],
7
+ rotationSign: [1, -1, 1, 1, 1, 1],
8
+ }
9
+
10
+ export function Yaskawa_AR3120({ modelURL, ...props }: RobotModelProps) {
12
11
  const gltf = useGLTF(modelURL) as any
13
12
 
14
13
  const nodes = gltf.nodes
15
14
  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
15
 
27
16
  return (
28
17
  <>
29
- <RobotAnimator
30
- rapidlyChangingMotionState={rapidlyChangingMotionState}
31
- robotRootObjectName="Scene"
32
- onRotationChanged={setRotation}
33
- />
34
18
  <group {...props} dispose={null}>
35
19
  <group name="Scene">
36
20
  <animated.group name="AR3120_J00">