@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,127 @@
|
|
|
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 ABB_1200_07_7({
|
|
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
|
+
<group name="IRB1200_7_70_IRC5" rotation={[Math.PI / 2, 0, 0]}>
|
|
34
|
+
<animated.group
|
|
35
|
+
name="IRB1200_7_70_IRC5_J01"
|
|
36
|
+
rotation={[-Math.PI / 2, 0, 0]}
|
|
37
|
+
>
|
|
38
|
+
<animated.group
|
|
39
|
+
name="IRB1200_7_70_IRC5_J02"
|
|
40
|
+
position={[0, 0.399, 0]}
|
|
41
|
+
rotation={[-Math.PI / 2, -Math.PI / 2, 0]}
|
|
42
|
+
>
|
|
43
|
+
<animated.group
|
|
44
|
+
name="IRB1200_7_70_IRC5_J03"
|
|
45
|
+
position={[0.35, 0, 0]}
|
|
46
|
+
>
|
|
47
|
+
<animated.group
|
|
48
|
+
name="IRB1200_7_70_IRC5_J04"
|
|
49
|
+
position={[0.042, 0, 0]}
|
|
50
|
+
rotation={[-Math.PI / 2, 0, 0]}
|
|
51
|
+
>
|
|
52
|
+
<animated.group
|
|
53
|
+
name="IRB1200_7_70_IRC5_J05"
|
|
54
|
+
position={[0, 0.351, 0]}
|
|
55
|
+
rotation={[Math.PI / 2, 0, 0]}
|
|
56
|
+
>
|
|
57
|
+
<animated.group
|
|
58
|
+
name="IRB1200_7_70_IRC5_J06"
|
|
59
|
+
rotation={[Math.PI / 2, 0, -Math.PI]}
|
|
60
|
+
>
|
|
61
|
+
<group
|
|
62
|
+
name="IRB1200_7_70_IRC5_FLG"
|
|
63
|
+
position={[0, 0.082, 0]}
|
|
64
|
+
/>
|
|
65
|
+
<mesh
|
|
66
|
+
name="IRB1200_7_70_IRC5_L06"
|
|
67
|
+
castShadow
|
|
68
|
+
receiveShadow
|
|
69
|
+
geometry={nodes.IRB1200_7_70_IRC5_L06.geometry}
|
|
70
|
+
material={materials["IRB1200_7-70_IRC5.003_Bake"]}
|
|
71
|
+
/>
|
|
72
|
+
</animated.group>
|
|
73
|
+
<mesh
|
|
74
|
+
name="IRB1200_7_70_IRC5_L05"
|
|
75
|
+
castShadow
|
|
76
|
+
receiveShadow
|
|
77
|
+
geometry={nodes.IRB1200_7_70_IRC5_L05.geometry}
|
|
78
|
+
material={materials["IRB1200_7-70_IRC5.003_Bake"]}
|
|
79
|
+
/>
|
|
80
|
+
</animated.group>
|
|
81
|
+
<mesh
|
|
82
|
+
name="IRB1200_7_70_IRC5_L04"
|
|
83
|
+
castShadow
|
|
84
|
+
receiveShadow
|
|
85
|
+
geometry={nodes.IRB1200_7_70_IRC5_L04.geometry}
|
|
86
|
+
material={materials["IRB1200_7-70_IRC5.003_Bake"]}
|
|
87
|
+
/>
|
|
88
|
+
</animated.group>
|
|
89
|
+
<mesh
|
|
90
|
+
name="IRB1200_7_70_IRC5_L03"
|
|
91
|
+
castShadow
|
|
92
|
+
receiveShadow
|
|
93
|
+
geometry={nodes.IRB1200_7_70_IRC5_L03.geometry}
|
|
94
|
+
material={materials["IRB1200_7-70_IRC5.003_Bake"]}
|
|
95
|
+
/>
|
|
96
|
+
</animated.group>
|
|
97
|
+
<mesh
|
|
98
|
+
name="IRB1200_7_70_IRC5_L02"
|
|
99
|
+
castShadow
|
|
100
|
+
receiveShadow
|
|
101
|
+
geometry={nodes.IRB1200_7_70_IRC5_L02.geometry}
|
|
102
|
+
material={materials["IRB1200_7-70_IRC5.003_Bake"]}
|
|
103
|
+
/>
|
|
104
|
+
</animated.group>
|
|
105
|
+
<mesh
|
|
106
|
+
name="IRB1200_7_70_IRC5_L01"
|
|
107
|
+
castShadow
|
|
108
|
+
receiveShadow
|
|
109
|
+
geometry={nodes.IRB1200_7_70_IRC5_L01.geometry}
|
|
110
|
+
material={materials["IRB1200_7-70_IRC5.003_Bake"]}
|
|
111
|
+
rotation={[Math.PI / 2, 0, 0]}
|
|
112
|
+
/>
|
|
113
|
+
</animated.group>
|
|
114
|
+
<mesh
|
|
115
|
+
name="IRB1200_7_70_IRC5_L00"
|
|
116
|
+
castShadow
|
|
117
|
+
receiveShadow
|
|
118
|
+
geometry={nodes.IRB1200_7_70_IRC5_L00.geometry}
|
|
119
|
+
material={materials["IRB1200_7-70_IRC5.003_Bake"]}
|
|
120
|
+
rotation={[-Math.PI / 2, 0, 0]}
|
|
121
|
+
/>
|
|
122
|
+
</group>
|
|
123
|
+
</group>
|
|
124
|
+
</group>
|
|
125
|
+
</>
|
|
126
|
+
)
|
|
127
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { Vector3, Matrix4, Quaternion } from "three"
|
|
2
|
+
import { Line } from "@react-three/drei"
|
|
3
|
+
import type { LineGeometry } from "three/examples/jsm/lines/LineGeometry.js"
|
|
4
|
+
import type { DHParameter } from "@wandelbots/wandelbots-api-client"
|
|
5
|
+
import RobotAnimator from "./RobotAnimator"
|
|
6
|
+
import type * as THREE from "three"
|
|
7
|
+
import {
|
|
8
|
+
getAllJointsByName,
|
|
9
|
+
type RobotSceneJoint,
|
|
10
|
+
} from "../utils/robotTreeQuery"
|
|
11
|
+
import type { DHRobotProps } from "./SupportedRobot"
|
|
12
|
+
|
|
13
|
+
const CHILD_LINE = "line"
|
|
14
|
+
const CHILD_MESH = "mesh"
|
|
15
|
+
|
|
16
|
+
export function DHRobot({
|
|
17
|
+
rapidlyChangingMotionState,
|
|
18
|
+
dhParameters,
|
|
19
|
+
...props
|
|
20
|
+
}: DHRobotProps) {
|
|
21
|
+
// reused in every update
|
|
22
|
+
const accumulatedMatrix = new Matrix4()
|
|
23
|
+
|
|
24
|
+
// Updates accumulatedMatrix with every execution
|
|
25
|
+
// Reset the matrix to identity if you start a new position update
|
|
26
|
+
function getLinePoints(
|
|
27
|
+
dhParameter: DHParameter,
|
|
28
|
+
jointRotation: number,
|
|
29
|
+
): {
|
|
30
|
+
a: THREE.Vector3
|
|
31
|
+
b: THREE.Vector3
|
|
32
|
+
} {
|
|
33
|
+
const position = new Vector3()
|
|
34
|
+
const quaternion = new Quaternion()
|
|
35
|
+
const scale = new Vector3()
|
|
36
|
+
accumulatedMatrix.decompose(position, quaternion, scale)
|
|
37
|
+
const prevPosition = position.clone() // Update the previous position
|
|
38
|
+
|
|
39
|
+
const matrix = new Matrix4()
|
|
40
|
+
.makeRotationY(
|
|
41
|
+
dhParameter.theta! +
|
|
42
|
+
jointRotation * (dhParameter.reverse_rotation_direction ? -1 : 1),
|
|
43
|
+
) // Rotate around Z
|
|
44
|
+
.multiply(new Matrix4().makeTranslation(0, dhParameter.d! / 1000, 0)) // Translate along Z
|
|
45
|
+
.multiply(new Matrix4().makeTranslation(dhParameter.a! / 1000, 0, 0)) // Translate along X
|
|
46
|
+
.multiply(new Matrix4().makeRotationX(dhParameter.alpha!)) // Rotate around X
|
|
47
|
+
|
|
48
|
+
// Accumulate transformations
|
|
49
|
+
accumulatedMatrix.multiply(matrix)
|
|
50
|
+
accumulatedMatrix.decompose(position, quaternion, scale)
|
|
51
|
+
return { a: prevPosition, b: position }
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function setJointLineRotation(
|
|
55
|
+
jointIndex: number,
|
|
56
|
+
line: THREE.Line,
|
|
57
|
+
mesh: THREE.Mesh,
|
|
58
|
+
jointValue: number,
|
|
59
|
+
) {
|
|
60
|
+
if (!dhParameters) {
|
|
61
|
+
return
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const dh_parameter = dhParameters[jointIndex]
|
|
65
|
+
if (!dh_parameter) {
|
|
66
|
+
return
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const { a, b } = getLinePoints(dh_parameter, jointValue)
|
|
70
|
+
const lineGeometry = line.geometry as LineGeometry
|
|
71
|
+
lineGeometry.setPositions([a.toArray(), b.toArray()].flat())
|
|
72
|
+
|
|
73
|
+
mesh.position.set(b.x, b.y, b.z)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function setRotation(joints: THREE.Object3D[], jointValues: number[]) {
|
|
77
|
+
accumulatedMatrix.identity()
|
|
78
|
+
joints.forEach((joint, jointIndex) => {
|
|
79
|
+
setJointLineRotation(
|
|
80
|
+
jointIndex,
|
|
81
|
+
joint.getObjectByName(CHILD_LINE) as THREE.Line,
|
|
82
|
+
joint.getObjectByName(CHILD_MESH) as THREE.Mesh,
|
|
83
|
+
jointValues[jointIndex]!,
|
|
84
|
+
)
|
|
85
|
+
})
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function getAllJoints(rootObject: THREE.Object3D): RobotSceneJoint[] {
|
|
89
|
+
return getAllJointsByName(rootObject, "^group_[0-9]+$")
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<>
|
|
94
|
+
<RobotAnimator
|
|
95
|
+
rapidlyChangingMotionState={rapidlyChangingMotionState}
|
|
96
|
+
robotRootObjectName="Scene"
|
|
97
|
+
onRotationChanged={setRotation}
|
|
98
|
+
jointCollector={getAllJoints}
|
|
99
|
+
/>
|
|
100
|
+
<group {...props} name="Scene">
|
|
101
|
+
<mesh>
|
|
102
|
+
<sphereGeometry args={[0.01, 32, 32]} />
|
|
103
|
+
<meshStandardMaterial color={"black"} depthTest={true} />
|
|
104
|
+
</mesh>
|
|
105
|
+
{dhParameters!.map((param, index) => {
|
|
106
|
+
const { a, b } = getLinePoints(
|
|
107
|
+
param,
|
|
108
|
+
rapidlyChangingMotionState.state.joint_position.joints[index] ?? 0,
|
|
109
|
+
)
|
|
110
|
+
return (
|
|
111
|
+
<group name={`group_${index}`} key={"group_" + index}>
|
|
112
|
+
<Line
|
|
113
|
+
name={CHILD_LINE}
|
|
114
|
+
points={[a, b]}
|
|
115
|
+
color={"white"}
|
|
116
|
+
lineWidth={5}
|
|
117
|
+
/>
|
|
118
|
+
<mesh name={CHILD_MESH} key={"mesh_" + index} position={b}>
|
|
119
|
+
<sphereGeometry args={[0.01, 32, 32]} />
|
|
120
|
+
<meshStandardMaterial color={"black"} depthTest={true} />
|
|
121
|
+
</mesh>
|
|
122
|
+
</group>
|
|
123
|
+
)
|
|
124
|
+
})}
|
|
125
|
+
</group>
|
|
126
|
+
</>
|
|
127
|
+
)
|
|
128
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
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 FANUC_ARC_Mate_100iD({
|
|
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
|
+
<group name="M10iD" rotation={[Math.PI / 2, 0, 0]}>
|
|
34
|
+
<animated.group name="M10iD_J01" rotation={[-Math.PI / 2, 0, 0]}>
|
|
35
|
+
<animated.group
|
|
36
|
+
name="M10iD_J02"
|
|
37
|
+
position={[0.075, 0, 0]}
|
|
38
|
+
rotation={[Math.PI / 2, Math.PI / 2, 0]}
|
|
39
|
+
>
|
|
40
|
+
<animated.group name="M10iD_J03" position={[0.64, 0, 0]}>
|
|
41
|
+
<animated.group
|
|
42
|
+
name="M10iD_J04"
|
|
43
|
+
position={[0.195, 0, 0]}
|
|
44
|
+
rotation={[-Math.PI / 2, 0, 0]}
|
|
45
|
+
>
|
|
46
|
+
<animated.group
|
|
47
|
+
name="M10iD_J05"
|
|
48
|
+
position={[0, -0.7, 0]}
|
|
49
|
+
rotation={[Math.PI / 2, 0, 0]}
|
|
50
|
+
>
|
|
51
|
+
<animated.group
|
|
52
|
+
name="M10iD_J06"
|
|
53
|
+
rotation={[-Math.PI / 2, 0, 0]}
|
|
54
|
+
>
|
|
55
|
+
<group
|
|
56
|
+
name="M10iD_FLG"
|
|
57
|
+
position={[0, -0.075, 0]}
|
|
58
|
+
rotation={[-Math.PI, 0, 0]}
|
|
59
|
+
/>
|
|
60
|
+
<mesh
|
|
61
|
+
name="M10iD_L06"
|
|
62
|
+
castShadow
|
|
63
|
+
receiveShadow
|
|
64
|
+
geometry={nodes.M10iD_L06.geometry}
|
|
65
|
+
material={materials.Fanuc_BlackMetal_AO}
|
|
66
|
+
position={[-0.835, 0.775, 0]}
|
|
67
|
+
rotation={[0, 0, -Math.PI / 2]}
|
|
68
|
+
/>
|
|
69
|
+
</animated.group>
|
|
70
|
+
<mesh
|
|
71
|
+
name="M10iD_L05"
|
|
72
|
+
castShadow
|
|
73
|
+
receiveShadow
|
|
74
|
+
geometry={nodes.M10iD_L05.geometry}
|
|
75
|
+
material={materials.Fanuc_BlackMetal_AO}
|
|
76
|
+
position={[-0.835, 0, -0.775]}
|
|
77
|
+
rotation={[-Math.PI / 2, 0, -Math.PI / 2]}
|
|
78
|
+
/>
|
|
79
|
+
</animated.group>
|
|
80
|
+
<group
|
|
81
|
+
name="M10iD_L04"
|
|
82
|
+
position={[-0.835, 0.075, 0]}
|
|
83
|
+
rotation={[0, 0, -Math.PI / 2]}
|
|
84
|
+
>
|
|
85
|
+
<mesh
|
|
86
|
+
name="Mesh_654"
|
|
87
|
+
castShadow
|
|
88
|
+
receiveShadow
|
|
89
|
+
geometry={nodes.Mesh_654.geometry}
|
|
90
|
+
material={materials.Fanuc_Yellow_Textured_AO}
|
|
91
|
+
/>
|
|
92
|
+
<mesh
|
|
93
|
+
name="Mesh_654_1"
|
|
94
|
+
castShadow
|
|
95
|
+
receiveShadow
|
|
96
|
+
geometry={nodes.Mesh_654_1.geometry}
|
|
97
|
+
material={materials.Fanuc_BlackMetal_AO}
|
|
98
|
+
/>
|
|
99
|
+
</group>
|
|
100
|
+
</animated.group>
|
|
101
|
+
<group
|
|
102
|
+
name="M10iD_L03"
|
|
103
|
+
position={[-0.64, 0, -0.075]}
|
|
104
|
+
rotation={[-Math.PI / 2, 0, -Math.PI / 2]}
|
|
105
|
+
>
|
|
106
|
+
<mesh
|
|
107
|
+
name="Mesh_378"
|
|
108
|
+
castShadow
|
|
109
|
+
receiveShadow
|
|
110
|
+
geometry={nodes.Mesh_378.geometry}
|
|
111
|
+
material={materials.Material_1_AO}
|
|
112
|
+
/>
|
|
113
|
+
<mesh
|
|
114
|
+
name="Mesh_378_1"
|
|
115
|
+
castShadow
|
|
116
|
+
receiveShadow
|
|
117
|
+
geometry={nodes.Mesh_378_1.geometry}
|
|
118
|
+
material={materials.Fanuc_Yellow_Textured_AO}
|
|
119
|
+
/>
|
|
120
|
+
<mesh
|
|
121
|
+
name="Mesh_378_2"
|
|
122
|
+
castShadow
|
|
123
|
+
receiveShadow
|
|
124
|
+
geometry={nodes.Mesh_378_2.geometry}
|
|
125
|
+
material={materials.Fanuc_BlackMetal_AO}
|
|
126
|
+
/>
|
|
127
|
+
</group>
|
|
128
|
+
</animated.group>
|
|
129
|
+
<group
|
|
130
|
+
name="M10iD_L02"
|
|
131
|
+
position={[0, 0, -0.075]}
|
|
132
|
+
rotation={[-Math.PI / 2, 0, -Math.PI / 2]}
|
|
133
|
+
>
|
|
134
|
+
<mesh
|
|
135
|
+
name="Mesh_358"
|
|
136
|
+
castShadow
|
|
137
|
+
receiveShadow
|
|
138
|
+
geometry={nodes.Mesh_358.geometry}
|
|
139
|
+
material={materials.Fanuc_Yellow_Textured_AO}
|
|
140
|
+
/>
|
|
141
|
+
<mesh
|
|
142
|
+
name="Mesh_358_1"
|
|
143
|
+
castShadow
|
|
144
|
+
receiveShadow
|
|
145
|
+
geometry={nodes.Mesh_358_1.geometry}
|
|
146
|
+
material={materials.Fanuc_BlackMetal_AO}
|
|
147
|
+
/>
|
|
148
|
+
</group>
|
|
149
|
+
</animated.group>
|
|
150
|
+
<group name="M10iD_L01">
|
|
151
|
+
<mesh
|
|
152
|
+
name="Mesh_356"
|
|
153
|
+
castShadow
|
|
154
|
+
receiveShadow
|
|
155
|
+
geometry={nodes.Mesh_356.geometry}
|
|
156
|
+
material={materials.Fanuc_Yellow_Textured_AO}
|
|
157
|
+
/>
|
|
158
|
+
<mesh
|
|
159
|
+
name="Mesh_356_1"
|
|
160
|
+
castShadow
|
|
161
|
+
receiveShadow
|
|
162
|
+
geometry={nodes.Mesh_356_1.geometry}
|
|
163
|
+
material={materials.Material_1_AO}
|
|
164
|
+
/>
|
|
165
|
+
<mesh
|
|
166
|
+
name="Mesh_356_2"
|
|
167
|
+
castShadow
|
|
168
|
+
receiveShadow
|
|
169
|
+
geometry={nodes.Mesh_356_2.geometry}
|
|
170
|
+
material={materials.Fanuc_BlackMetal_AO}
|
|
171
|
+
/>
|
|
172
|
+
</group>
|
|
173
|
+
</animated.group>
|
|
174
|
+
<mesh
|
|
175
|
+
name="M10iD_L00"
|
|
176
|
+
castShadow
|
|
177
|
+
receiveShadow
|
|
178
|
+
geometry={nodes.M10iD_L00.geometry}
|
|
179
|
+
material={materials.Fanuc_BlackMetal_AO}
|
|
180
|
+
rotation={[-Math.PI / 2, 0, 0]}
|
|
181
|
+
/>
|
|
182
|
+
</group>
|
|
183
|
+
</group>
|
|
184
|
+
</group>
|
|
185
|
+
</>
|
|
186
|
+
)
|
|
187
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
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 FANUC_ARC_Mate_120iD({
|
|
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
|
+
<group name="M10iD" rotation={[0, 0, 0]}>
|
|
34
|
+
<animated.group name="M20iD25_J00">
|
|
35
|
+
<animated.group
|
|
36
|
+
name="M20iD25_J01"
|
|
37
|
+
position={[0.075, 0, 0]}
|
|
38
|
+
rotation={[Math.PI / 2, Math.PI / 2, 0]}
|
|
39
|
+
>
|
|
40
|
+
<animated.group name="M20iD25_J02" position={[0.84, 0, 0]}>
|
|
41
|
+
<animated.group
|
|
42
|
+
name="M20iD25_J03"
|
|
43
|
+
position={[0.215, 0, 0]}
|
|
44
|
+
rotation={[-Math.PI / 2, 0, 0]}
|
|
45
|
+
>
|
|
46
|
+
<animated.group
|
|
47
|
+
name="M20iD25_J04"
|
|
48
|
+
position={[0, -0.89, 0]}
|
|
49
|
+
rotation={[Math.PI / 2, 0, 0]}
|
|
50
|
+
>
|
|
51
|
+
<animated.group
|
|
52
|
+
name="M20iD25_J05"
|
|
53
|
+
rotation={[-Math.PI / 2, 0, 0]}
|
|
54
|
+
>
|
|
55
|
+
<group
|
|
56
|
+
name="M20iD25_FLG"
|
|
57
|
+
position={[0, -0.09, 0]}
|
|
58
|
+
rotation={[-Math.PI, 0, 0]}
|
|
59
|
+
/>
|
|
60
|
+
<mesh
|
|
61
|
+
name="M20iD25_L06"
|
|
62
|
+
castShadow
|
|
63
|
+
receiveShadow
|
|
64
|
+
geometry={nodes.M20iD25_L06.geometry}
|
|
65
|
+
material={materials.Fanuc_BlackMetal_AO}
|
|
66
|
+
position={[0, -0.09, 0]}
|
|
67
|
+
rotation={[Math.PI / 2, 0, Math.PI]}
|
|
68
|
+
/>
|
|
69
|
+
</animated.group>
|
|
70
|
+
<mesh
|
|
71
|
+
name="M20iD25_L05"
|
|
72
|
+
castShadow
|
|
73
|
+
receiveShadow
|
|
74
|
+
geometry={nodes.M20iD25_L05.geometry}
|
|
75
|
+
material={materials.Fanuc_BlackMetal_AO}
|
|
76
|
+
rotation={[Math.PI, Math.PI / 2, 0]}
|
|
77
|
+
/>
|
|
78
|
+
</animated.group>
|
|
79
|
+
<group
|
|
80
|
+
name="M20iD25_L04"
|
|
81
|
+
position={[0, -0.286, 0]}
|
|
82
|
+
rotation={[-Math.PI / 2, Math.PI / 2, 0]}
|
|
83
|
+
>
|
|
84
|
+
<mesh
|
|
85
|
+
name="Mesh_2"
|
|
86
|
+
castShadow
|
|
87
|
+
receiveShadow
|
|
88
|
+
geometry={nodes.Mesh_2.geometry}
|
|
89
|
+
material={materials.Fanuc_Yellow_Textured_AO}
|
|
90
|
+
/>
|
|
91
|
+
<mesh
|
|
92
|
+
name="Mesh_2_1"
|
|
93
|
+
castShadow
|
|
94
|
+
receiveShadow
|
|
95
|
+
geometry={nodes.Mesh_2_1.geometry}
|
|
96
|
+
material={materials.Fanuc_BlackMetal_AO}
|
|
97
|
+
/>
|
|
98
|
+
</group>
|
|
99
|
+
</animated.group>
|
|
100
|
+
<group
|
|
101
|
+
name="M20iD25_L03"
|
|
102
|
+
position={[0, 0.406, 0]}
|
|
103
|
+
rotation={[Math.PI, Math.PI / 2, 0]}
|
|
104
|
+
>
|
|
105
|
+
<mesh
|
|
106
|
+
name="Mesh_15"
|
|
107
|
+
castShadow
|
|
108
|
+
receiveShadow
|
|
109
|
+
geometry={nodes.Mesh_15.geometry}
|
|
110
|
+
material={materials.Fanuc_BlackMetal_AO}
|
|
111
|
+
/>
|
|
112
|
+
<mesh
|
|
113
|
+
name="Mesh_15_1"
|
|
114
|
+
castShadow
|
|
115
|
+
receiveShadow
|
|
116
|
+
geometry={nodes.Mesh_15_1.geometry}
|
|
117
|
+
material={materials.Fanuc_Yellow_Textured_AO}
|
|
118
|
+
/>
|
|
119
|
+
<mesh
|
|
120
|
+
name="Mesh_15_2"
|
|
121
|
+
castShadow
|
|
122
|
+
receiveShadow
|
|
123
|
+
geometry={nodes.Mesh_15_2.geometry}
|
|
124
|
+
material={materials.Material_9_AO}
|
|
125
|
+
/>
|
|
126
|
+
</group>
|
|
127
|
+
</animated.group>
|
|
128
|
+
<group
|
|
129
|
+
name="M20iD25_L02"
|
|
130
|
+
position={[0, 0.505, -0.055]}
|
|
131
|
+
rotation={[-Math.PI, Math.PI / 2, 0]}
|
|
132
|
+
>
|
|
133
|
+
<mesh
|
|
134
|
+
name="Mesh_37"
|
|
135
|
+
castShadow
|
|
136
|
+
receiveShadow
|
|
137
|
+
geometry={nodes.Mesh_37.geometry}
|
|
138
|
+
material={materials.Fanuc_BlackMetal_AO}
|
|
139
|
+
/>
|
|
140
|
+
<mesh
|
|
141
|
+
name="Mesh_37_1"
|
|
142
|
+
castShadow
|
|
143
|
+
receiveShadow
|
|
144
|
+
geometry={nodes.Mesh_37_1.geometry}
|
|
145
|
+
material={materials.Fanuc_Yellow_Textured_AO}
|
|
146
|
+
/>
|
|
147
|
+
</group>
|
|
148
|
+
</animated.group>
|
|
149
|
+
<group name="M20iD25_L01" rotation={[-Math.PI / 2, 0, 0]}>
|
|
150
|
+
<mesh
|
|
151
|
+
name="Mesh_45"
|
|
152
|
+
castShadow
|
|
153
|
+
receiveShadow
|
|
154
|
+
geometry={nodes.Mesh_45.geometry}
|
|
155
|
+
material={materials.Material_9_AO}
|
|
156
|
+
/>
|
|
157
|
+
<mesh
|
|
158
|
+
name="Mesh_45_1"
|
|
159
|
+
castShadow
|
|
160
|
+
receiveShadow
|
|
161
|
+
geometry={nodes.Mesh_45_1.geometry}
|
|
162
|
+
material={materials.Fanuc_Yellow_Textured_AO}
|
|
163
|
+
/>
|
|
164
|
+
<mesh
|
|
165
|
+
name="Mesh_45_2"
|
|
166
|
+
castShadow
|
|
167
|
+
receiveShadow
|
|
168
|
+
geometry={nodes.Mesh_45_2.geometry}
|
|
169
|
+
material={materials.Fanuc_BlackMetal_AO}
|
|
170
|
+
/>
|
|
171
|
+
</group>
|
|
172
|
+
</animated.group>
|
|
173
|
+
<mesh
|
|
174
|
+
name="M20iD25_L00"
|
|
175
|
+
castShadow
|
|
176
|
+
receiveShadow
|
|
177
|
+
geometry={nodes.M20iD25_L00.geometry}
|
|
178
|
+
material={materials.Fanuc_BlackMetal_AO}
|
|
179
|
+
position={[0, -0.425, 0]}
|
|
180
|
+
rotation={[-Math.PI / 2, 0, 0]}
|
|
181
|
+
/>
|
|
182
|
+
</group>
|
|
183
|
+
</group>
|
|
184
|
+
</group>
|
|
185
|
+
</>
|
|
186
|
+
)
|
|
187
|
+
}
|