@wandelbots/wandelbots-js-react-components 1.3.1 → 1.4.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 +18 -8
- package/src/components/3d-viewport/CoordinateSystemTransform.tsx +44 -0
- package/src/components/3d-viewport/PresetEnvironment.tsx +78 -0
- package/src/components/3d-viewport/SafetyZonesRenderer.tsx +55 -0
- package/src/components/LoadingButton.stories.tsx +61 -0
- package/src/components/LoadingButton.tsx +19 -0
- package/src/components/LoadingCover.tsx +75 -0
- package/src/components/ThemeSelect.tsx +49 -0
- package/src/components/VelocitySlider.stories.tsx +32 -0
- package/src/components/VelocitySlider.tsx +52 -0
- package/src/components/jogging/JoggingCartesianAxisControl.stories.tsx +41 -0
- package/src/components/jogging/JoggingCartesianAxisControl.tsx +127 -0
- package/src/components/jogging/JoggingCartesianTab.tsx +265 -0
- package/src/components/jogging/JoggingCartesianValues.tsx +45 -0
- package/src/components/jogging/JoggingFreedriveTab.tsx +9 -0
- package/src/components/jogging/JoggingJointLimitDetector.tsx +51 -0
- package/src/components/jogging/JoggingJointRotationControl.stories.tsx +38 -0
- package/src/components/jogging/JoggingJointRotationControl.tsx +197 -0
- package/src/components/jogging/JoggingJointTab.tsx +93 -0
- package/src/components/jogging/JoggingJointValues.tsx +45 -0
- package/src/components/jogging/JoggingOptions.tsx +96 -0
- package/src/components/jogging/JoggingPanel.stories.tsx +26 -0
- package/src/components/jogging/JoggingPanel.tsx +148 -0
- package/src/components/jogging/JoggingStore.tsx +294 -0
- package/src/components/jogging/JoggingVelocitySlider.tsx +56 -0
- package/src/components/robots/ABB_1200_07_7.tsx +127 -0
- package/src/components/robots/AxisConfig.ts +3 -0
- package/src/components/robots/DHRobot.tsx +128 -0
- package/src/components/robots/FANUC_ARC_Mate_100iD.tsx +187 -0
- package/src/components/robots/FANUC_ARC_Mate_120iD.tsx +187 -0
- package/src/components/robots/FANUC_CRX10iA.tsx +171 -0
- package/src/components/robots/FANUC_CRX25iA.tsx +171 -0
- package/src/components/robots/FANUC_CRX25iAL.tsx +182 -0
- package/src/components/robots/KUKA_KR210_R2700.tsx +291 -0
- package/src/components/robots/KUKA_KR270_R2700.tsx +244 -0
- package/src/components/robots/Robot.tsx +42 -0
- package/src/components/robots/RobotAnimator.tsx +82 -0
- package/src/components/robots/SupportedRobot.tsx +144 -0
- package/src/components/robots/UniversalRobots_UR10.tsx +112 -0
- package/src/components/robots/UniversalRobots_UR10e.tsx +275 -0
- package/src/components/robots/UniversalRobots_UR3.tsx +112 -0
- package/src/components/robots/UniversalRobots_UR3e.tsx +112 -0
- package/src/components/robots/UniversalRobots_UR5.tsx +111 -0
- package/src/components/robots/UniversalRobots_UR5e.tsx +280 -0
- package/src/components/robots/Yaskawa_AR1440.tsx +156 -0
- package/src/components/robots/Yaskawa_AR1730.tsx +169 -0
- package/src/components/robots/Yaskawa_AR2010.tsx +163 -0
- package/src/components/robots/Yaskawa_AR3120.tsx +164 -0
- package/src/components/robots/Yaskawa_AR900.tsx +125 -0
- package/src/components/utils/converters.ts +23 -0
- package/src/components/utils/errorHandling.ts +30 -0
- package/src/components/utils/hooks.tsx +54 -0
- package/src/components/utils/robotTreeQuery.ts +27 -0
- package/src/components/wandelscript-editor/WandelscriptEditor.stories.tsx +45 -0
- package/src/components/wandelscript-editor/WandelscriptEditor.tsx +114 -0
- package/src/components/wandelscript-editor/wandelscript.tmLanguage.ts +62 -0
- package/src/declarations.d.ts +10 -0
- package/src/i18n/config.ts +27 -0
- package/src/i18n/locales/de/translations.json +12 -0
- package/src/i18n/locales/en/translations.json +12 -0
- package/src/icons/arrowForwardFilled.tsx +7 -0
- package/src/icons/axis-x.svg +3 -0
- package/src/icons/axis-y.svg +3 -0
- package/src/icons/axis-z.svg +3 -0
- package/src/icons/expandFilled.tsx +11 -0
- package/src/icons/home.tsx +12 -0
- package/src/icons/index.ts +6 -0
- package/src/icons/infoOutlined.tsx +10 -0
- package/src/icons/jogging.svg +3 -0
- package/src/icons/robot.svg +3 -0
- package/src/icons/robot.tsx +14 -0
- package/src/icons/rotation.svg +4 -0
- package/src/icons/wbLogo.tsx +21 -0
- package/src/index.ts +8 -0
- package/src/themes/color.tsx +74 -0
- package/src/themes/theme.ts +150 -0
- package/src/themes/wbTheme.stories.tsx +64 -0
- package/src/themes/wbTheme.ts +186 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { Suspense } from "react"
|
|
2
|
+
|
|
3
|
+
import { UniversalRobots_UR3 } from "./UniversalRobots_UR3"
|
|
4
|
+
import { UniversalRobots_UR3e } from "./UniversalRobots_UR3e"
|
|
5
|
+
import { UniversalRobots_UR5 } from "./UniversalRobots_UR5"
|
|
6
|
+
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
|
+
import { Yaskawa_AR1440 } from "./Yaskawa_AR1440"
|
|
11
|
+
import { Yaskawa_AR1730 } from "./Yaskawa_AR1730"
|
|
12
|
+
import { Yaskawa_AR2010 } from "./Yaskawa_AR2010"
|
|
13
|
+
import { Yaskawa_AR3120 } from "./Yaskawa_AR3120"
|
|
14
|
+
import { FANUC_CRX10iA } from "./FANUC_CRX10iA"
|
|
15
|
+
import { FANUC_CRX25iA } from "./FANUC_CRX25iA"
|
|
16
|
+
import { FANUC_CRX25iAL } from "./FANUC_CRX25iAL"
|
|
17
|
+
import { KUKA_KR210_R2700 } from "./KUKA_KR210_R2700"
|
|
18
|
+
import { KUKA_KR270_R2700 } from "./KUKA_KR270_R2700"
|
|
19
|
+
import { FANUC_ARC_Mate_100iD } from "./FANUC_ARC_Mate_100iD"
|
|
20
|
+
import { FANUC_ARC_Mate_120iD } from "./FANUC_ARC_Mate_120iD"
|
|
21
|
+
import { ABB_1200_07_7 } from "./ABB_1200_07_7"
|
|
22
|
+
|
|
23
|
+
import type { GroupProps } from "@react-three/fiber"
|
|
24
|
+
import type {
|
|
25
|
+
MotionGroupStateResponse,
|
|
26
|
+
DHParameter,
|
|
27
|
+
} from "@wandelbots/wandelbots-api-client"
|
|
28
|
+
import { DHRobot } from "./DHRobot"
|
|
29
|
+
|
|
30
|
+
export type DHRobotProps = {
|
|
31
|
+
rapidlyChangingMotionState: MotionGroupStateResponse
|
|
32
|
+
dhParameters: Array<DHParameter>
|
|
33
|
+
} & GroupProps
|
|
34
|
+
|
|
35
|
+
export type RobotProps = {
|
|
36
|
+
rapidlyChangingMotionState: MotionGroupStateResponse
|
|
37
|
+
modelURL: string
|
|
38
|
+
} & GroupProps
|
|
39
|
+
|
|
40
|
+
export type SupportedRobotProps = {
|
|
41
|
+
rapidlyChangingMotionState: MotionGroupStateResponse
|
|
42
|
+
modelFromController: string
|
|
43
|
+
dhParameters: DHParameter[]
|
|
44
|
+
getModel?: (modelFromController: string) => string
|
|
45
|
+
} & GroupProps
|
|
46
|
+
|
|
47
|
+
export function defaultGetModel(modelFromController: string): string {
|
|
48
|
+
return `https://cdn.jsdelivr.net/gh/wandelbotsgmbh/wandelbots-js-react-components/public/models/${modelFromController}.glb`
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function SupportedRobot({
|
|
52
|
+
rapidlyChangingMotionState,
|
|
53
|
+
modelFromController,
|
|
54
|
+
dhParameters,
|
|
55
|
+
getModel = defaultGetModel,
|
|
56
|
+
...props
|
|
57
|
+
}: SupportedRobotProps) {
|
|
58
|
+
let Robot
|
|
59
|
+
|
|
60
|
+
switch (modelFromController) {
|
|
61
|
+
case "UniversalRobots_UR3":
|
|
62
|
+
Robot = UniversalRobots_UR3
|
|
63
|
+
break
|
|
64
|
+
case "UniversalRobots_UR3e":
|
|
65
|
+
Robot = UniversalRobots_UR3e
|
|
66
|
+
break
|
|
67
|
+
case "UniversalRobots_UR5":
|
|
68
|
+
Robot = UniversalRobots_UR5
|
|
69
|
+
break
|
|
70
|
+
case "UniversalRobots_UR5e":
|
|
71
|
+
Robot = UniversalRobots_UR5e
|
|
72
|
+
break
|
|
73
|
+
case "UniversalRobots_UR10":
|
|
74
|
+
Robot = UniversalRobots_UR10
|
|
75
|
+
break
|
|
76
|
+
case "UniversalRobots_UR10e":
|
|
77
|
+
Robot = UniversalRobots_UR10e
|
|
78
|
+
break
|
|
79
|
+
case "Yaskawa_AR900":
|
|
80
|
+
Robot = Yaskawa_AR900
|
|
81
|
+
break
|
|
82
|
+
case "Yaskawa_GP7":
|
|
83
|
+
Robot = Yaskawa_AR900
|
|
84
|
+
break
|
|
85
|
+
case "Yaskawa_AR1440":
|
|
86
|
+
Robot = Yaskawa_AR1440
|
|
87
|
+
break
|
|
88
|
+
case "Yaskawa_AR1730":
|
|
89
|
+
Robot = Yaskawa_AR1730
|
|
90
|
+
break
|
|
91
|
+
case "Yaskawa_AR2010":
|
|
92
|
+
Robot = Yaskawa_AR2010
|
|
93
|
+
break
|
|
94
|
+
case "Yaskawa_AR3120":
|
|
95
|
+
Robot = Yaskawa_AR3120
|
|
96
|
+
break
|
|
97
|
+
case "FANUC_CRX10iA":
|
|
98
|
+
Robot = FANUC_CRX10iA
|
|
99
|
+
break
|
|
100
|
+
case "FANUC_CRX25iA":
|
|
101
|
+
Robot = FANUC_CRX25iA
|
|
102
|
+
break
|
|
103
|
+
case "FANUC_CRX25iAL":
|
|
104
|
+
Robot = FANUC_CRX25iAL
|
|
105
|
+
break
|
|
106
|
+
case "FANUC_ARC_Mate_120iD":
|
|
107
|
+
Robot = FANUC_ARC_Mate_120iD
|
|
108
|
+
break
|
|
109
|
+
case "FANUC_ARC_Mate_100iD":
|
|
110
|
+
Robot = FANUC_ARC_Mate_100iD
|
|
111
|
+
break
|
|
112
|
+
case "KUKA_KR210_R2700":
|
|
113
|
+
Robot = KUKA_KR210_R2700
|
|
114
|
+
break
|
|
115
|
+
case "KUKA_KR270_R2700":
|
|
116
|
+
Robot = KUKA_KR270_R2700
|
|
117
|
+
break
|
|
118
|
+
case "ABB_1200_07_7":
|
|
119
|
+
Robot = ABB_1200_07_7
|
|
120
|
+
break
|
|
121
|
+
default:
|
|
122
|
+
console.warn(`Unknown robot type: ${modelFromController}`)
|
|
123
|
+
Robot = DHRobot
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return (
|
|
127
|
+
<Suspense
|
|
128
|
+
fallback={
|
|
129
|
+
<DHRobot
|
|
130
|
+
rapidlyChangingMotionState={rapidlyChangingMotionState}
|
|
131
|
+
dhParameters={dhParameters}
|
|
132
|
+
{...props}
|
|
133
|
+
/>
|
|
134
|
+
}
|
|
135
|
+
>
|
|
136
|
+
<Robot
|
|
137
|
+
rapidlyChangingMotionState={rapidlyChangingMotionState}
|
|
138
|
+
modelURL={getModel(modelFromController)}
|
|
139
|
+
dhParameters={dhParameters}
|
|
140
|
+
{...props}
|
|
141
|
+
/>
|
|
142
|
+
</Suspense>
|
|
143
|
+
)
|
|
144
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
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 UniversalRobots_UR10({
|
|
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
|
+
|
|
16
|
+
function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
|
|
17
|
+
jointObjects.forEach(
|
|
18
|
+
(object, index) => (object.rotation.y = jointValues[index]!),
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<>
|
|
24
|
+
<RobotAnimator
|
|
25
|
+
rapidlyChangingMotionState={rapidlyChangingMotionState}
|
|
26
|
+
robotRootObjectName="Scene"
|
|
27
|
+
onRotationChanged={setRotation}
|
|
28
|
+
/>
|
|
29
|
+
<group {...props} dispose={null}>
|
|
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]}>
|
|
33
|
+
<animated.group
|
|
34
|
+
name="UR10_J02"
|
|
35
|
+
position={[0, 0.126, 0]}
|
|
36
|
+
rotation={[Math.PI / 2, 0, 0]}
|
|
37
|
+
>
|
|
38
|
+
<animated.group name="UR10_J03" position={[-0.612, 0, 0]}>
|
|
39
|
+
<animated.group name="UR10_J04" position={[-0.572, 0, 0]}>
|
|
40
|
+
<animated.group
|
|
41
|
+
name="UR10_J05"
|
|
42
|
+
position={[0, 0.164, 0]}
|
|
43
|
+
rotation={[Math.PI / 2, 0, 0]}
|
|
44
|
+
>
|
|
45
|
+
<animated.group
|
|
46
|
+
name="UR10_J06"
|
|
47
|
+
position={[0, 0.116, 0]}
|
|
48
|
+
rotation={[-Math.PI / 2, 0, 0]}
|
|
49
|
+
>
|
|
50
|
+
<group name="UR10_FLG" position={[0, 0.092, 0]} />
|
|
51
|
+
<mesh
|
|
52
|
+
name="UR10_L06"
|
|
53
|
+
castShadow
|
|
54
|
+
receiveShadow
|
|
55
|
+
geometry={nodes.UR10_L06.geometry}
|
|
56
|
+
material={materials.Standard}
|
|
57
|
+
/>
|
|
58
|
+
</animated.group>
|
|
59
|
+
<mesh
|
|
60
|
+
name="UR10_L05"
|
|
61
|
+
castShadow
|
|
62
|
+
receiveShadow
|
|
63
|
+
geometry={nodes.UR10_L05.geometry}
|
|
64
|
+
material={materials.Standard}
|
|
65
|
+
/>
|
|
66
|
+
</animated.group>
|
|
67
|
+
<mesh
|
|
68
|
+
name="UR10_L04"
|
|
69
|
+
castShadow
|
|
70
|
+
receiveShadow
|
|
71
|
+
geometry={nodes.UR10_L04.geometry}
|
|
72
|
+
material={materials.Standard}
|
|
73
|
+
/>
|
|
74
|
+
</animated.group>
|
|
75
|
+
<mesh
|
|
76
|
+
name="UR10_L03"
|
|
77
|
+
castShadow
|
|
78
|
+
receiveShadow
|
|
79
|
+
geometry={nodes.UR10_L03.geometry}
|
|
80
|
+
material={materials.Standard}
|
|
81
|
+
/>
|
|
82
|
+
</animated.group>
|
|
83
|
+
<mesh
|
|
84
|
+
name="UR10_L02"
|
|
85
|
+
castShadow
|
|
86
|
+
receiveShadow
|
|
87
|
+
geometry={nodes.UR10_L02.geometry}
|
|
88
|
+
material={materials.Standard}
|
|
89
|
+
/>
|
|
90
|
+
</animated.group>
|
|
91
|
+
<mesh
|
|
92
|
+
name="UR10_L01"
|
|
93
|
+
castShadow
|
|
94
|
+
receiveShadow
|
|
95
|
+
geometry={nodes.UR10_L01.geometry}
|
|
96
|
+
material={materials.Standard}
|
|
97
|
+
/>
|
|
98
|
+
</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>
|
|
108
|
+
</group>
|
|
109
|
+
</group>
|
|
110
|
+
</>
|
|
111
|
+
)
|
|
112
|
+
}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { animated } from "@react-spring/three"
|
|
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"
|
|
6
|
+
|
|
7
|
+
export function UniversalRobots_UR10e({
|
|
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
|
+
|
|
16
|
+
function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
|
|
17
|
+
jointObjects.forEach(
|
|
18
|
+
(object, index) => (object.rotation.y = jointValues[index]!),
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<>
|
|
24
|
+
<RobotAnimator
|
|
25
|
+
rapidlyChangingMotionState={rapidlyChangingMotionState}
|
|
26
|
+
robotRootObjectName="Scene"
|
|
27
|
+
onRotationChanged={setRotation}
|
|
28
|
+
/>
|
|
29
|
+
<group {...props} dispose={null}>
|
|
30
|
+
<group name="Scene">
|
|
31
|
+
<group name="UR10e" rotation={[Math.PI / 2, 0, 0]}>
|
|
32
|
+
<animated.group name="UR10e_J01" rotation={[-Math.PI / 2, 0, 0]}>
|
|
33
|
+
<animated.group
|
|
34
|
+
name="UR10e_J02"
|
|
35
|
+
position={[0, 0.181, 0]}
|
|
36
|
+
rotation={[Math.PI / 2, 0, 0]}
|
|
37
|
+
>
|
|
38
|
+
<animated.group name="UR10e_J03" position={[-0.613, 0, 0]}>
|
|
39
|
+
<animated.group name="UR10e_J04" position={[-0.572, 0, 0]}>
|
|
40
|
+
<animated.group
|
|
41
|
+
name="UR10e_J05"
|
|
42
|
+
position={[0, 0.174, 0]}
|
|
43
|
+
rotation={[Math.PI / 2, 0, 0]}
|
|
44
|
+
>
|
|
45
|
+
<animated.group
|
|
46
|
+
name="UR10e_J06"
|
|
47
|
+
position={[0, 0.12, 0]}
|
|
48
|
+
rotation={[-Math.PI / 2, 0, 0]}
|
|
49
|
+
>
|
|
50
|
+
<animated.group
|
|
51
|
+
name="UR10e_FLG"
|
|
52
|
+
position={[1.184, -0.174, 0.061]}
|
|
53
|
+
rotation={[-Math.PI / 2, 0, 0]}
|
|
54
|
+
>
|
|
55
|
+
<mesh
|
|
56
|
+
name="C-1000493"
|
|
57
|
+
geometry={nodes["C-1000493"].geometry}
|
|
58
|
+
material={materials.Black}
|
|
59
|
+
castShadow
|
|
60
|
+
receiveShadow
|
|
61
|
+
/>
|
|
62
|
+
<mesh
|
|
63
|
+
name="C-1000493_1"
|
|
64
|
+
geometry={nodes["C-1000493_1"].geometry}
|
|
65
|
+
material={materials.Metal}
|
|
66
|
+
castShadow
|
|
67
|
+
receiveShadow
|
|
68
|
+
/>
|
|
69
|
+
</animated.group>
|
|
70
|
+
|
|
71
|
+
<group
|
|
72
|
+
name="UR10e_L07"
|
|
73
|
+
position={[0, 0.117, 0]}
|
|
74
|
+
></group>
|
|
75
|
+
</animated.group>
|
|
76
|
+
<group
|
|
77
|
+
name="UR10e_L06"
|
|
78
|
+
position={[1.184, 0.181, 0.174]}
|
|
79
|
+
rotation={[Math.PI, 0, 0]}
|
|
80
|
+
>
|
|
81
|
+
<mesh
|
|
82
|
+
name="C-1000492"
|
|
83
|
+
geometry={nodes["C-1000492"].geometry}
|
|
84
|
+
material={materials.DarkGray}
|
|
85
|
+
castShadow
|
|
86
|
+
receiveShadow
|
|
87
|
+
/>
|
|
88
|
+
<mesh
|
|
89
|
+
name="C-1000492_1"
|
|
90
|
+
geometry={nodes["C-1000492_1"].geometry}
|
|
91
|
+
material={materials.Black}
|
|
92
|
+
castShadow
|
|
93
|
+
receiveShadow
|
|
94
|
+
/>
|
|
95
|
+
<mesh
|
|
96
|
+
name="C-1000492_2"
|
|
97
|
+
geometry={nodes["C-1000492_2"].geometry}
|
|
98
|
+
material={materials.Blue}
|
|
99
|
+
castShadow
|
|
100
|
+
receiveShadow
|
|
101
|
+
/>
|
|
102
|
+
<mesh
|
|
103
|
+
name="C-1000492_3"
|
|
104
|
+
geometry={nodes["C-1000492_3"].geometry}
|
|
105
|
+
material={materials.Screw}
|
|
106
|
+
castShadow
|
|
107
|
+
receiveShadow
|
|
108
|
+
/>
|
|
109
|
+
</group>
|
|
110
|
+
</animated.group>
|
|
111
|
+
<group
|
|
112
|
+
name="UR10e_L05"
|
|
113
|
+
position={[1.184, 0, 0.181]}
|
|
114
|
+
rotation={[-Math.PI / 2, 0, 0]}
|
|
115
|
+
>
|
|
116
|
+
<mesh
|
|
117
|
+
name="C-1000491"
|
|
118
|
+
geometry={nodes["C-1000491"].geometry}
|
|
119
|
+
material={materials.DarkGray}
|
|
120
|
+
castShadow
|
|
121
|
+
receiveShadow
|
|
122
|
+
/>
|
|
123
|
+
<mesh
|
|
124
|
+
name="C-1000491_1"
|
|
125
|
+
geometry={nodes["C-1000491_1"].geometry}
|
|
126
|
+
material={materials.Blue}
|
|
127
|
+
castShadow
|
|
128
|
+
receiveShadow
|
|
129
|
+
/>
|
|
130
|
+
<mesh
|
|
131
|
+
name="C-1000491_2"
|
|
132
|
+
geometry={nodes["C-1000491_2"].geometry}
|
|
133
|
+
material={materials.Black}
|
|
134
|
+
castShadow
|
|
135
|
+
receiveShadow
|
|
136
|
+
/>
|
|
137
|
+
<mesh
|
|
138
|
+
name="C-1000491_3"
|
|
139
|
+
geometry={nodes["C-1000491_3"].geometry}
|
|
140
|
+
material={materials.Screw}
|
|
141
|
+
castShadow
|
|
142
|
+
receiveShadow
|
|
143
|
+
/>
|
|
144
|
+
</group>
|
|
145
|
+
</animated.group>
|
|
146
|
+
<group
|
|
147
|
+
name="UR10e_L04"
|
|
148
|
+
position={[0.613, 0, 0.181]}
|
|
149
|
+
rotation={[-Math.PI / 2, 0, 0]}
|
|
150
|
+
>
|
|
151
|
+
<mesh
|
|
152
|
+
name="C-1000490"
|
|
153
|
+
geometry={nodes["C-1000490"].geometry}
|
|
154
|
+
material={materials.Metal}
|
|
155
|
+
castShadow
|
|
156
|
+
receiveShadow
|
|
157
|
+
/>
|
|
158
|
+
<mesh
|
|
159
|
+
name="C-1000490_1"
|
|
160
|
+
geometry={nodes["C-1000490_1"].geometry}
|
|
161
|
+
material={materials.Black}
|
|
162
|
+
castShadow
|
|
163
|
+
receiveShadow
|
|
164
|
+
/>
|
|
165
|
+
<mesh
|
|
166
|
+
name="C-1000490_2"
|
|
167
|
+
geometry={nodes["C-1000490_2"].geometry}
|
|
168
|
+
material={materials.DarkGray}
|
|
169
|
+
castShadow
|
|
170
|
+
receiveShadow
|
|
171
|
+
/>
|
|
172
|
+
<mesh
|
|
173
|
+
name="C-1000490_3"
|
|
174
|
+
geometry={nodes["C-1000490_3"].geometry}
|
|
175
|
+
material={materials.Blue}
|
|
176
|
+
castShadow
|
|
177
|
+
receiveShadow
|
|
178
|
+
/>
|
|
179
|
+
</group>
|
|
180
|
+
</animated.group>
|
|
181
|
+
<animated.group
|
|
182
|
+
name="UR10e_L03"
|
|
183
|
+
position={[0, 0, 0.181]}
|
|
184
|
+
rotation={[-Math.PI / 2, 0, 0]}
|
|
185
|
+
>
|
|
186
|
+
<mesh
|
|
187
|
+
name="C-1000489"
|
|
188
|
+
geometry={nodes["C-1000489"].geometry}
|
|
189
|
+
material={materials.Blue}
|
|
190
|
+
castShadow
|
|
191
|
+
receiveShadow
|
|
192
|
+
/>
|
|
193
|
+
<mesh
|
|
194
|
+
name="C-1000489_1"
|
|
195
|
+
geometry={nodes["C-1000489_1"].geometry}
|
|
196
|
+
material={materials.Black}
|
|
197
|
+
castShadow
|
|
198
|
+
receiveShadow
|
|
199
|
+
/>
|
|
200
|
+
<mesh
|
|
201
|
+
name="C-1000489_2"
|
|
202
|
+
geometry={nodes["C-1000489_2"].geometry}
|
|
203
|
+
material={materials.DarkGray}
|
|
204
|
+
castShadow
|
|
205
|
+
receiveShadow
|
|
206
|
+
/>
|
|
207
|
+
<mesh
|
|
208
|
+
name="C-1000489_3"
|
|
209
|
+
geometry={nodes["C-1000489_3"].geometry}
|
|
210
|
+
material={materials.Screw}
|
|
211
|
+
castShadow
|
|
212
|
+
receiveShadow
|
|
213
|
+
/>
|
|
214
|
+
<mesh
|
|
215
|
+
name="C-1000489_4"
|
|
216
|
+
geometry={nodes["C-1000489_4"].geometry}
|
|
217
|
+
material={materials.Metal}
|
|
218
|
+
castShadow
|
|
219
|
+
receiveShadow
|
|
220
|
+
/>
|
|
221
|
+
</animated.group>
|
|
222
|
+
</animated.group>
|
|
223
|
+
<group name="UR10e_L02">
|
|
224
|
+
<mesh
|
|
225
|
+
name="C-1000488"
|
|
226
|
+
geometry={nodes["C-1000488"].geometry}
|
|
227
|
+
material={materials.Black}
|
|
228
|
+
castShadow
|
|
229
|
+
receiveShadow
|
|
230
|
+
/>
|
|
231
|
+
<mesh
|
|
232
|
+
name="C-1000488_1"
|
|
233
|
+
geometry={nodes["C-1000488_1"].geometry}
|
|
234
|
+
material={materials.Blue}
|
|
235
|
+
castShadow
|
|
236
|
+
receiveShadow
|
|
237
|
+
/>
|
|
238
|
+
<mesh
|
|
239
|
+
name="C-1000488_2"
|
|
240
|
+
geometry={nodes["C-1000488_2"].geometry}
|
|
241
|
+
material={materials.Screw}
|
|
242
|
+
castShadow
|
|
243
|
+
receiveShadow
|
|
244
|
+
/>
|
|
245
|
+
<mesh
|
|
246
|
+
name="C-1000488_3"
|
|
247
|
+
geometry={nodes["C-1000488_3"].geometry}
|
|
248
|
+
material={materials.DarkGray}
|
|
249
|
+
castShadow
|
|
250
|
+
receiveShadow
|
|
251
|
+
/>
|
|
252
|
+
</group>
|
|
253
|
+
</animated.group>
|
|
254
|
+
<group name="UR10e_L01" rotation={[-Math.PI / 2, 0, 0]}>
|
|
255
|
+
<mesh
|
|
256
|
+
name="C-1000487"
|
|
257
|
+
geometry={nodes["C-1000487"].geometry}
|
|
258
|
+
material={materials.Black}
|
|
259
|
+
castShadow
|
|
260
|
+
receiveShadow
|
|
261
|
+
/>
|
|
262
|
+
<mesh
|
|
263
|
+
name="C-1000487_1"
|
|
264
|
+
geometry={nodes["C-1000487_1"].geometry}
|
|
265
|
+
material={materials.Metal}
|
|
266
|
+
castShadow
|
|
267
|
+
receiveShadow
|
|
268
|
+
/>
|
|
269
|
+
</group>
|
|
270
|
+
</group>
|
|
271
|
+
</group>
|
|
272
|
+
</group>
|
|
273
|
+
</>
|
|
274
|
+
)
|
|
275
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { animated } from "@react-spring/three"
|
|
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"
|
|
6
|
+
|
|
7
|
+
export function UniversalRobots_UR3({
|
|
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
|
+
|
|
16
|
+
function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
|
|
17
|
+
jointObjects.forEach(
|
|
18
|
+
(object, index) => (object.rotation.y = jointValues[index]!),
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<>
|
|
24
|
+
<RobotAnimator
|
|
25
|
+
rapidlyChangingMotionState={rapidlyChangingMotionState}
|
|
26
|
+
robotRootObjectName="Scene"
|
|
27
|
+
onRotationChanged={setRotation}
|
|
28
|
+
/>
|
|
29
|
+
<group {...props} dispose={null}>
|
|
30
|
+
<group name="Scene">
|
|
31
|
+
<group name="UR3" rotation={[Math.PI / 2, 0, 0]}>
|
|
32
|
+
<animated.group name="UR3_J01" rotation={[-Math.PI / 2, 0, 0]}>
|
|
33
|
+
<animated.group
|
|
34
|
+
name="UR3_J02"
|
|
35
|
+
position={[0, 0.152, 0]}
|
|
36
|
+
rotation={[Math.PI / 2, 0, 0]}
|
|
37
|
+
>
|
|
38
|
+
<animated.group name="UR3_J03" position={[-0.244, 0, 0]}>
|
|
39
|
+
<animated.group name="UR3_J04" position={[-0.213, 0, 0]}>
|
|
40
|
+
<animated.group
|
|
41
|
+
name="UR3_J05"
|
|
42
|
+
position={[0, 0.112, 0]}
|
|
43
|
+
rotation={[Math.PI / 2, 0, 0]}
|
|
44
|
+
>
|
|
45
|
+
<mesh
|
|
46
|
+
name="UR3_05"
|
|
47
|
+
castShadow
|
|
48
|
+
receiveShadow
|
|
49
|
+
geometry={nodes.UR3_05.geometry}
|
|
50
|
+
material={materials.Standard}
|
|
51
|
+
/>
|
|
52
|
+
<animated.group
|
|
53
|
+
name="UR3_J06"
|
|
54
|
+
position={[0, 0.085, 0]}
|
|
55
|
+
rotation={[-Math.PI / 2, 0, 0]}
|
|
56
|
+
>
|
|
57
|
+
<group name="UR3_FLG" position={[0, 0.082, 0]} />
|
|
58
|
+
<mesh
|
|
59
|
+
name="UR3_L06"
|
|
60
|
+
castShadow
|
|
61
|
+
receiveShadow
|
|
62
|
+
geometry={nodes.UR3_L06.geometry}
|
|
63
|
+
material={materials.Standard}
|
|
64
|
+
/>
|
|
65
|
+
</animated.group>
|
|
66
|
+
</animated.group>
|
|
67
|
+
<mesh
|
|
68
|
+
name="UR3_L04"
|
|
69
|
+
castShadow
|
|
70
|
+
receiveShadow
|
|
71
|
+
geometry={nodes.UR3_L04.geometry}
|
|
72
|
+
material={materials.Standard}
|
|
73
|
+
/>
|
|
74
|
+
</animated.group>
|
|
75
|
+
<mesh
|
|
76
|
+
name="UR3_L03"
|
|
77
|
+
castShadow
|
|
78
|
+
receiveShadow
|
|
79
|
+
geometry={nodes.UR3_L03.geometry}
|
|
80
|
+
material={materials.Standard}
|
|
81
|
+
/>
|
|
82
|
+
</animated.group>
|
|
83
|
+
<mesh
|
|
84
|
+
name="UR3_L02"
|
|
85
|
+
castShadow
|
|
86
|
+
receiveShadow
|
|
87
|
+
geometry={nodes.UR3_L02.geometry}
|
|
88
|
+
material={materials.Standard}
|
|
89
|
+
/>
|
|
90
|
+
</animated.group>
|
|
91
|
+
<mesh
|
|
92
|
+
name="UR3_L01"
|
|
93
|
+
castShadow
|
|
94
|
+
receiveShadow
|
|
95
|
+
geometry={nodes.UR3_L01.geometry}
|
|
96
|
+
material={materials.Standard}
|
|
97
|
+
/>
|
|
98
|
+
</animated.group>
|
|
99
|
+
<mesh
|
|
100
|
+
name="UR3_L00"
|
|
101
|
+
castShadow
|
|
102
|
+
receiveShadow
|
|
103
|
+
geometry={nodes.UR3_L00.geometry}
|
|
104
|
+
material={materials.Standard}
|
|
105
|
+
rotation={[-Math.PI / 2, 0, 0]}
|
|
106
|
+
/>
|
|
107
|
+
</group>
|
|
108
|
+
</group>
|
|
109
|
+
</group>
|
|
110
|
+
</>
|
|
111
|
+
)
|
|
112
|
+
}
|