@wandelbots/wandelbots-js-react-components 1.17.3 → 1.17.4
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/dist/components/robots/ABB_1200_07_7.d.ts +7 -2
- package/dist/components/robots/ABB_1200_07_7.d.ts.map +1 -1
- package/dist/components/robots/DHRobot.d.ts.map +1 -1
- package/dist/components/robots/FANUC_ARC_Mate_100iD.d.ts +7 -2
- package/dist/components/robots/FANUC_ARC_Mate_100iD.d.ts.map +1 -1
- package/dist/components/robots/FANUC_ARC_Mate_120iD.d.ts +7 -2
- package/dist/components/robots/FANUC_ARC_Mate_120iD.d.ts.map +1 -1
- package/dist/components/robots/FANUC_CRX10iA.d.ts +7 -2
- package/dist/components/robots/FANUC_CRX10iA.d.ts.map +1 -1
- package/dist/components/robots/FANUC_CRX20iAL.d.ts +7 -2
- package/dist/components/robots/FANUC_CRX20iAL.d.ts.map +1 -1
- package/dist/components/robots/FANUC_CRX25iA.d.ts +7 -2
- package/dist/components/robots/FANUC_CRX25iA.d.ts.map +1 -1
- package/dist/components/robots/FANUC_CRX25iAL.d.ts +7 -2
- package/dist/components/robots/FANUC_CRX25iAL.d.ts.map +1 -1
- package/dist/components/robots/KUKA_KR16_R2010_2.d.ts +7 -2
- package/dist/components/robots/KUKA_KR16_R2010_2.d.ts.map +1 -1
- package/dist/components/robots/KUKA_KR210_R2700.d.ts +7 -2
- package/dist/components/robots/KUKA_KR210_R2700.d.ts.map +1 -1
- package/dist/components/robots/KUKA_KR270_R2700.d.ts +7 -2
- package/dist/components/robots/KUKA_KR270_R2700.d.ts.map +1 -1
- package/dist/components/robots/Robot.d.ts +3 -3
- package/dist/components/robots/Robot.d.ts.map +1 -1
- package/dist/components/robots/RobotAnimator.d.ts +7 -4
- package/dist/components/robots/RobotAnimator.d.ts.map +1 -1
- package/dist/components/robots/SupportedRobot.d.ts +1 -5
- package/dist/components/robots/SupportedRobot.d.ts.map +1 -1
- package/dist/components/robots/UniversalRobots_UR10.d.ts +2 -2
- package/dist/components/robots/UniversalRobots_UR10.d.ts.map +1 -1
- package/dist/components/robots/UniversalRobots_UR10e.d.ts +2 -2
- package/dist/components/robots/UniversalRobots_UR10e.d.ts.map +1 -1
- package/dist/components/robots/UniversalRobots_UR3.d.ts +2 -2
- package/dist/components/robots/UniversalRobots_UR3.d.ts.map +1 -1
- package/dist/components/robots/UniversalRobots_UR3e.d.ts +2 -2
- package/dist/components/robots/UniversalRobots_UR3e.d.ts.map +1 -1
- package/dist/components/robots/UniversalRobots_UR5.d.ts +2 -2
- package/dist/components/robots/UniversalRobots_UR5.d.ts.map +1 -1
- package/dist/components/robots/UniversalRobots_UR5e.d.ts +2 -2
- package/dist/components/robots/UniversalRobots_UR5e.d.ts.map +1 -1
- package/dist/components/robots/Yaskawa_AR1440.d.ts +8 -2
- package/dist/components/robots/Yaskawa_AR1440.d.ts.map +1 -1
- package/dist/components/robots/Yaskawa_AR1730.d.ts +8 -2
- package/dist/components/robots/Yaskawa_AR1730.d.ts.map +1 -1
- package/dist/components/robots/Yaskawa_AR2010.d.ts +8 -2
- package/dist/components/robots/Yaskawa_AR2010.d.ts.map +1 -1
- package/dist/components/robots/Yaskawa_AR3120.d.ts +8 -2
- package/dist/components/robots/Yaskawa_AR3120.d.ts.map +1 -1
- package/dist/components/robots/Yaskawa_AR900.d.ts +7 -2
- package/dist/components/robots/Yaskawa_AR900.d.ts.map +1 -1
- package/dist/components/robots/Yaskawa_GP50.d.ts +7 -2
- package/dist/components/robots/Yaskawa_GP50.d.ts.map +1 -1
- package/dist/components/robots/types.d.ts +17 -0
- package/dist/components/robots/types.d.ts.map +1 -0
- package/dist/index.cjs +32 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8940 -9298
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/robots/ABB_1200_07_7.tsx +7 -22
- package/src/components/robots/DHRobot.tsx +34 -33
- package/src/components/robots/FANUC_ARC_Mate_100iD.tsx +7 -22
- package/src/components/robots/FANUC_ARC_Mate_120iD.tsx +7 -22
- package/src/components/robots/FANUC_CRX10iA.tsx +7 -22
- package/src/components/robots/FANUC_CRX20iAL.tsx +7 -22
- package/src/components/robots/FANUC_CRX25iA.tsx +7 -22
- package/src/components/robots/FANUC_CRX25iAL.tsx +7 -22
- package/src/components/robots/KUKA_KR16_R2010_2.tsx +19 -34
- package/src/components/robots/KUKA_KR210_R2700.tsx +7 -23
- package/src/components/robots/KUKA_KR270_R2700.tsx +7 -23
- package/src/components/robots/Robot.tsx +3 -3
- package/src/components/robots/RobotAnimator.tsx +32 -21
- package/src/components/robots/SupportedRobot.tsx +93 -103
- package/src/components/robots/UniversalRobots_UR10.tsx +3 -20
- package/src/components/robots/UniversalRobots_UR10e.tsx +2 -19
- package/src/components/robots/UniversalRobots_UR3.tsx +2 -19
- package/src/components/robots/UniversalRobots_UR3e.tsx +3 -20
- package/src/components/robots/UniversalRobots_UR5.tsx +3 -20
- package/src/components/robots/UniversalRobots_UR5e.tsx +3 -20
- package/src/components/robots/Yaskawa_AR1440.tsx +8 -24
- package/src/components/robots/Yaskawa_AR1730.tsx +8 -24
- package/src/components/robots/Yaskawa_AR2010.tsx +8 -24
- package/src/components/robots/Yaskawa_AR3120.tsx +8 -24
- package/src/components/robots/Yaskawa_AR900.tsx +7 -22
- package/src/components/robots/Yaskawa_GP50.tsx +7 -24
- package/src/components/robots/types.ts +19 -0
package/package.json
CHANGED
|
@@ -1,33 +1,18 @@
|
|
|
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
|
|
2
|
+
import { useGLTF } from "@react-three/drei"
|
|
3
|
+
import type { RobotModelProps } from "./types"
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}:
|
|
5
|
+
ABB_1200_07_7.config = {
|
|
6
|
+
rotationOffsets: [0, -Math.PI / 2, 0, 0, 0, 0],
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function ABB_1200_07_7({ modelURL, ...props }: RobotModelProps) {
|
|
12
10
|
const gltf = useGLTF(modelURL) as any
|
|
13
11
|
const nodes = gltf.nodes
|
|
14
12
|
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
13
|
|
|
24
14
|
return (
|
|
25
15
|
<>
|
|
26
|
-
<RobotAnimator
|
|
27
|
-
rapidlyChangingMotionState={rapidlyChangingMotionState}
|
|
28
|
-
robotRootObjectName="Scene"
|
|
29
|
-
onRotationChanged={setRotation}
|
|
30
|
-
/>
|
|
31
16
|
<group {...props} dispose={null}>
|
|
32
17
|
<group name="Scene">
|
|
33
18
|
<group name="IRB1200_7_70_IRC5" rotation={[Math.PI / 2, 0, 0]}>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Vector3, Matrix4, Quaternion } from "three"
|
|
2
1
|
import { Line } from "@react-three/drei"
|
|
3
|
-
import type { LineGeometry } from "three/examples/jsm/lines/LineGeometry.js"
|
|
4
2
|
import type { DHParameter } from "@wandelbots/wandelbots-api-client"
|
|
5
|
-
import RobotAnimator from "./RobotAnimator"
|
|
6
3
|
import type * as THREE from "three"
|
|
4
|
+
import { Matrix4, Quaternion, Vector3 } from "three"
|
|
5
|
+
import type { LineGeometry } from "three/examples/jsm/lines/LineGeometry.js"
|
|
7
6
|
import {
|
|
8
7
|
getAllJointsByName,
|
|
9
8
|
type RobotSceneJoint,
|
|
10
9
|
} from "../utils/robotTreeQuery"
|
|
10
|
+
import RobotAnimator from "./RobotAnimator"
|
|
11
11
|
import type { DHRobotProps } from "./SupportedRobot"
|
|
12
12
|
|
|
13
13
|
const CHILD_LINE = "line"
|
|
@@ -85,7 +85,7 @@ export function DHRobot({
|
|
|
85
85
|
})
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
function
|
|
88
|
+
function jointCollector(rootObject: THREE.Object3D): RobotSceneJoint[] {
|
|
89
89
|
return getAllJointsByName(rootObject, "^group_[0-9]+$")
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -93,36 +93,37 @@ export function DHRobot({
|
|
|
93
93
|
<>
|
|
94
94
|
<RobotAnimator
|
|
95
95
|
rapidlyChangingMotionState={rapidlyChangingMotionState}
|
|
96
|
-
|
|
96
|
+
jointCollector={jointCollector}
|
|
97
97
|
onRotationChanged={setRotation}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
98
|
+
>
|
|
99
|
+
<group {...props} name="Scene">
|
|
100
|
+
<mesh>
|
|
101
|
+
<sphereGeometry args={[0.01, 32, 32]} />
|
|
102
|
+
<meshStandardMaterial color={"black"} depthTest={true} />
|
|
103
|
+
</mesh>
|
|
104
|
+
{dhParameters!.map((param, index) => {
|
|
105
|
+
const { a, b } = getLinePoints(
|
|
106
|
+
param,
|
|
107
|
+
rapidlyChangingMotionState.state.joint_position.joints[index] ??
|
|
108
|
+
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
|
+
</RobotAnimator>
|
|
126
127
|
</>
|
|
127
128
|
)
|
|
128
129
|
}
|
|
@@ -1,33 +1,18 @@
|
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}:
|
|
5
|
+
FANUC_ARC_Mate_100iD.config = {
|
|
6
|
+
rotationOffsets: [0, Math.PI / 2, 0, 0, 0, 0],
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function FANUC_ARC_Mate_100iD({ modelURL, ...props }: RobotModelProps) {
|
|
12
10
|
const gltf = useGLTF(modelURL) as any
|
|
13
11
|
const nodes = gltf.nodes
|
|
14
12
|
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
13
|
|
|
24
14
|
return (
|
|
25
15
|
<>
|
|
26
|
-
<RobotAnimator
|
|
27
|
-
rapidlyChangingMotionState={rapidlyChangingMotionState}
|
|
28
|
-
robotRootObjectName="Scene"
|
|
29
|
-
onRotationChanged={setRotation}
|
|
30
|
-
/>
|
|
31
16
|
<group {...props} dispose={null}>
|
|
32
17
|
<group name="Scene">
|
|
33
18
|
<group name="M10iD" rotation={[Math.PI / 2, 0, 0]}>
|
|
@@ -1,33 +1,18 @@
|
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}:
|
|
5
|
+
FANUC_ARC_Mate_120iD.config = {
|
|
6
|
+
rotationOffsets: [0, Math.PI / 2, 0, 0, 0, 0],
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function FANUC_ARC_Mate_120iD({ modelURL, ...props }: RobotModelProps) {
|
|
12
10
|
const gltf = useGLTF(modelURL) as any
|
|
13
11
|
const nodes = gltf.nodes
|
|
14
12
|
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
13
|
|
|
24
14
|
return (
|
|
25
15
|
<>
|
|
26
|
-
<RobotAnimator
|
|
27
|
-
rapidlyChangingMotionState={rapidlyChangingMotionState}
|
|
28
|
-
robotRootObjectName="Scene"
|
|
29
|
-
onRotationChanged={setRotation}
|
|
30
|
-
/>
|
|
31
16
|
<group {...props} dispose={null}>
|
|
32
17
|
<group name="Scene">
|
|
33
18
|
<group name="M10iD" rotation={[0, 0, 0]}>
|
|
@@ -1,33 +1,18 @@
|
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}:
|
|
5
|
+
FANUC_CRX10iA.config = {
|
|
6
|
+
rotationOffsets: [0, Math.PI / 2, 0, 0, 0, 0],
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function FANUC_CRX10iA({ modelURL, ...props }: RobotModelProps) {
|
|
12
10
|
const gltf = useGLTF(modelURL) as any
|
|
13
11
|
const nodes = gltf.nodes
|
|
14
12
|
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
13
|
|
|
24
14
|
return (
|
|
25
15
|
<>
|
|
26
|
-
<RobotAnimator
|
|
27
|
-
rapidlyChangingMotionState={rapidlyChangingMotionState}
|
|
28
|
-
robotRootObjectName="Scene"
|
|
29
|
-
onRotationChanged={setRotation}
|
|
30
|
-
/>
|
|
31
16
|
<group {...props} dispose={null}>
|
|
32
17
|
<group name="Scene">
|
|
33
18
|
<animated.group name="CRX10iA_J00">
|
|
@@ -1,33 +1,18 @@
|
|
|
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
|
|
2
|
+
import { useGLTF } from "@react-three/drei"
|
|
3
|
+
import type { RobotModelProps } from "./types"
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}:
|
|
5
|
+
FANUC_CRX20iAL.config = {
|
|
6
|
+
rotationOffsets: [0, Math.PI / 2, 0, 0, 0, 0],
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function FANUC_CRX20iAL({ modelURL, ...props }: RobotModelProps) {
|
|
12
10
|
const gltf = useGLTF(modelURL) as any
|
|
13
11
|
const nodes = gltf.nodes
|
|
14
12
|
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
13
|
|
|
24
14
|
return (
|
|
25
15
|
<>
|
|
26
|
-
<RobotAnimator
|
|
27
|
-
rapidlyChangingMotionState={rapidlyChangingMotionState}
|
|
28
|
-
robotRootObjectName="Scene"
|
|
29
|
-
onRotationChanged={setRotation}
|
|
30
|
-
/>
|
|
31
16
|
<group {...props} dispose={null}>
|
|
32
17
|
<group name="Scene">
|
|
33
18
|
<mesh
|
|
@@ -1,33 +1,18 @@
|
|
|
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
|
|
2
|
+
import { useGLTF } from "@react-three/drei"
|
|
3
|
+
import type { RobotModelProps } from "./types"
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}:
|
|
5
|
+
FANUC_CRX25iA.config = {
|
|
6
|
+
rotationOffsets: [0, Math.PI / 2, 0, 0, 0, 0],
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function FANUC_CRX25iA({ modelURL, ...props }: RobotModelProps) {
|
|
12
10
|
const gltf = useGLTF(modelURL) as any
|
|
13
11
|
const nodes = gltf.nodes
|
|
14
12
|
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
13
|
|
|
24
14
|
return (
|
|
25
15
|
<>
|
|
26
|
-
<RobotAnimator
|
|
27
|
-
rapidlyChangingMotionState={rapidlyChangingMotionState}
|
|
28
|
-
robotRootObjectName="Scene"
|
|
29
|
-
onRotationChanged={setRotation}
|
|
30
|
-
/>
|
|
31
16
|
<group {...props} dispose={null}>
|
|
32
17
|
<group name="Scene" position={[0, -0.37, 0]}>
|
|
33
18
|
<group name="CRX25iA_L00">
|
|
@@ -1,33 +1,18 @@
|
|
|
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
|
|
2
|
+
import { useGLTF } from "@react-three/drei"
|
|
3
|
+
import type { RobotModelProps } from "./types"
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}:
|
|
5
|
+
FANUC_CRX25iAL.config = {
|
|
6
|
+
rotationOffsets: [0, Math.PI / 2, 0, 0, 0, 0],
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function FANUC_CRX25iAL({ modelURL, ...props }: RobotModelProps) {
|
|
12
10
|
const gltf = useGLTF(modelURL) as any
|
|
13
11
|
const nodes = gltf.nodes
|
|
14
12
|
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
13
|
|
|
24
14
|
return (
|
|
25
15
|
<>
|
|
26
|
-
<RobotAnimator
|
|
27
|
-
rapidlyChangingMotionState={rapidlyChangingMotionState}
|
|
28
|
-
robotRootObjectName="Scene"
|
|
29
|
-
onRotationChanged={setRotation}
|
|
30
|
-
/>
|
|
31
16
|
<group {...props} dispose={null}>
|
|
32
17
|
<group name="Scene">
|
|
33
18
|
<animated.group name="CRX10iA_J00">
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { animated } from "@react-spring/three"
|
|
1
2
|
import { useGLTF } from "@react-three/drei"
|
|
2
3
|
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
4
|
import type { GLTF } from "three-stdlib"
|
|
5
|
+
import type { RobotModelProps } from "./types"
|
|
7
6
|
|
|
8
7
|
type GLTFResult = GLTF & {
|
|
9
8
|
nodes: {
|
|
@@ -29,29 +28,15 @@ type GLTFResult = GLTF & {
|
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
...props
|
|
36
|
-
}: RobotProps) {
|
|
37
|
-
const { nodes, materials } = useGLTF(modelURL) as GLTFResult
|
|
38
|
-
|
|
39
|
-
const rotationOffsets = [0, 0, -Math.PI / 2, 0, 0, 0]
|
|
31
|
+
KUKA_KR16_R2010_2.config = {
|
|
32
|
+
rotationOffsets: [0, 0, -Math.PI / 2, 0, 0, 0],
|
|
33
|
+
}
|
|
40
34
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
(object, index) =>
|
|
44
|
-
(object.rotation.y = jointValues[index]! + rotationOffsets[index]!),
|
|
45
|
-
)
|
|
46
|
-
}
|
|
35
|
+
export function KUKA_KR16_R2010_2({ modelURL, ...props }: RobotModelProps) {
|
|
36
|
+
const { nodes, materials } = useGLTF(modelURL) as GLTFResult
|
|
47
37
|
|
|
48
38
|
return (
|
|
49
39
|
<>
|
|
50
|
-
<RobotAnimator
|
|
51
|
-
rapidlyChangingMotionState={rapidlyChangingMotionState}
|
|
52
|
-
robotRootObjectName="Scene"
|
|
53
|
-
onRotationChanged={setRotation}
|
|
54
|
-
/>
|
|
55
40
|
<group {...props} dispose={null}>
|
|
56
41
|
<group name="Scene">
|
|
57
42
|
<group name="link_0">
|
|
@@ -77,28 +62,28 @@ export function KUKA_KR16_R2010_2({
|
|
|
77
62
|
material={materials.material_Material_Metall}
|
|
78
63
|
/>
|
|
79
64
|
</group>
|
|
80
|
-
<group name="KUKA_KR16R2010_2_J00">
|
|
81
|
-
<group
|
|
65
|
+
<animated.group name="KUKA_KR16R2010_2_J00">
|
|
66
|
+
<animated.group
|
|
82
67
|
name="KUKA_KR16R2010_2_J01"
|
|
83
68
|
position={[0.16, 0.52, 0]}
|
|
84
69
|
rotation={[-Math.PI / 2, 0, 0]}
|
|
85
70
|
>
|
|
86
|
-
<group
|
|
71
|
+
<animated.group
|
|
87
72
|
name="KUKA_KR16R2010_2_J02"
|
|
88
73
|
position={[0.98, 0, 0]}
|
|
89
74
|
rotation={[0, -Math.PI / 2, 0]}
|
|
90
75
|
>
|
|
91
|
-
<group
|
|
76
|
+
<animated.group
|
|
92
77
|
name="KUKA_KR16R2010_2_J03"
|
|
93
78
|
position={[0.15, 0, 0]}
|
|
94
79
|
rotation={[Math.PI / 2, 0, 0]}
|
|
95
80
|
>
|
|
96
|
-
<group
|
|
81
|
+
<animated.group
|
|
97
82
|
name="KUKA_KR16R2010_2_J04"
|
|
98
83
|
position={[0, -0.86, 0]}
|
|
99
84
|
rotation={[-Math.PI / 2, 0, 0]}
|
|
100
85
|
>
|
|
101
|
-
<group
|
|
86
|
+
<animated.group
|
|
102
87
|
name="KUKA_KR16R2010_2_J05"
|
|
103
88
|
rotation={[-Math.PI / 2, 0, -Math.PI]}
|
|
104
89
|
>
|
|
@@ -111,7 +96,7 @@ export function KUKA_KR16_R2010_2({
|
|
|
111
96
|
position={[0.67, 2, 0]}
|
|
112
97
|
rotation={[-Math.PI, 0, Math.PI / 2]}
|
|
113
98
|
/>
|
|
114
|
-
</group>
|
|
99
|
+
</animated.group>
|
|
115
100
|
<mesh
|
|
116
101
|
name="link_5"
|
|
117
102
|
castShadow
|
|
@@ -121,7 +106,7 @@ export function KUKA_KR16_R2010_2({
|
|
|
121
106
|
position={[-0.67, 0, 2]}
|
|
122
107
|
rotation={[Math.PI / 2, 0, -Math.PI / 2]}
|
|
123
108
|
/>
|
|
124
|
-
</group>
|
|
109
|
+
</animated.group>
|
|
125
110
|
<mesh
|
|
126
111
|
name="link_4"
|
|
127
112
|
castShadow
|
|
@@ -131,7 +116,7 @@ export function KUKA_KR16_R2010_2({
|
|
|
131
116
|
position={[-0.67, 1.14, 0]}
|
|
132
117
|
rotation={[0, 0, -Math.PI / 2]}
|
|
133
118
|
/>
|
|
134
|
-
</group>
|
|
119
|
+
</animated.group>
|
|
135
120
|
<group
|
|
136
121
|
name="link_3"
|
|
137
122
|
position={[-0.52, 0, 1.14]}
|
|
@@ -159,7 +144,7 @@ export function KUKA_KR16_R2010_2({
|
|
|
159
144
|
material={materials.material_Material_Farbe__2_}
|
|
160
145
|
/>
|
|
161
146
|
</group>
|
|
162
|
-
</group>
|
|
147
|
+
</animated.group>
|
|
163
148
|
<group
|
|
164
149
|
name="link_2"
|
|
165
150
|
position={[-0.16, 0, -0.52]}
|
|
@@ -180,7 +165,7 @@ export function KUKA_KR16_R2010_2({
|
|
|
180
165
|
material={materials.material_Material_Metall}
|
|
181
166
|
/>
|
|
182
167
|
</group>
|
|
183
|
-
</group>
|
|
168
|
+
</animated.group>
|
|
184
169
|
<group name="link_1">
|
|
185
170
|
<mesh
|
|
186
171
|
name="visuals_1"
|
|
@@ -204,7 +189,7 @@ export function KUKA_KR16_R2010_2({
|
|
|
204
189
|
material={materials.material_Material_Metall}
|
|
205
190
|
/>
|
|
206
191
|
</group>
|
|
207
|
-
</group>
|
|
192
|
+
</animated.group>
|
|
208
193
|
</group>
|
|
209
194
|
</group>
|
|
210
195
|
</>
|
|
@@ -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
|
|
2
|
+
import { useGLTF } from "@react-three/drei"
|
|
3
|
+
import type { RobotModelProps } from "./types"
|
|
4
|
+
|
|
5
|
+
KUKA_KR210_R2700.config = {
|
|
6
|
+
rotationOffsets: [0, 0, -Math.PI / 2, 0, 0, 0],
|
|
7
|
+
}
|
|
6
8
|
|
|
7
|
-
export function KUKA_KR210_R2700({
|
|
8
|
-
modelURL,
|
|
9
|
-
rapidlyChangingMotionState,
|
|
10
|
-
...props
|
|
11
|
-
}: RobotProps) {
|
|
9
|
+
export function KUKA_KR210_R2700({ modelURL, ...props }: RobotModelProps) {
|
|
12
10
|
const gltf = useGLTF(modelURL) as any
|
|
13
11
|
|
|
14
12
|
const nodes = gltf.nodes
|
|
15
13
|
const materials = gltf.materials
|
|
16
14
|
|
|
17
|
-
const rotationOffsets = [0, 0, -Math.PI / 2, 0, 0, 0]
|
|
18
|
-
|
|
19
|
-
function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
|
|
20
|
-
jointObjects.forEach(
|
|
21
|
-
(object, index) =>
|
|
22
|
-
(object.rotation.y = jointValues[index]! + rotationOffsets[index]!),
|
|
23
|
-
)
|
|
24
|
-
}
|
|
25
|
-
|
|
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="kuka_kr210_2700">
|
|
@@ -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
|
|
2
|
+
import { useGLTF } from "@react-three/drei"
|
|
3
|
+
import type { RobotModelProps } from "./types"
|
|
4
|
+
|
|
5
|
+
KUKA_KR270_R2700.config = {
|
|
6
|
+
rotationOffsets: [0, 0, -Math.PI / 2, 0, 0, 0],
|
|
7
|
+
}
|
|
6
8
|
|
|
7
|
-
export function KUKA_KR270_R2700({
|
|
8
|
-
modelURL,
|
|
9
|
-
rapidlyChangingMotionState,
|
|
10
|
-
...props
|
|
11
|
-
}: RobotProps) {
|
|
9
|
+
export function KUKA_KR270_R2700({ modelURL, ...props }: RobotModelProps) {
|
|
12
10
|
const gltf = useGLTF(modelURL) as any
|
|
13
11
|
|
|
14
12
|
const nodes = gltf.nodes
|
|
15
13
|
const materials = gltf.materials
|
|
16
14
|
|
|
17
|
-
const rotationOffsets = [0, 0, -Math.PI / 2, 0, 0, 0]
|
|
18
|
-
|
|
19
|
-
function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
|
|
20
|
-
jointObjects.forEach(
|
|
21
|
-
(object, index) =>
|
|
22
|
-
(object.rotation.y = jointValues[index]! + rotationOffsets[index]!),
|
|
23
|
-
)
|
|
24
|
-
}
|
|
25
|
-
|
|
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
|
<animated.group name="joint_01">
|
|
@@ -3,7 +3,7 @@ import { type GroupProps } from "@react-three/fiber"
|
|
|
3
3
|
import type { ConnectedMotionGroup } from "@wandelbots/wandelbots-js"
|
|
4
4
|
import { defaultGetModel, SupportedRobot } from "./SupportedRobot"
|
|
5
5
|
|
|
6
|
-
export type
|
|
6
|
+
export type RobotProps = {
|
|
7
7
|
connectedMotionGroup: ConnectedMotionGroup
|
|
8
8
|
getModel?: (modelFromController: string) => string
|
|
9
9
|
isGhost?: boolean
|
|
@@ -13,7 +13,7 @@ export type ConnectecMotionGroupRobotProps = {
|
|
|
13
13
|
* The Robot component is a wrapper around the SupportedRobot component
|
|
14
14
|
* for usage with @wandelbots/wandelbots-js ConnectedMotionGroup object.
|
|
15
15
|
*
|
|
16
|
-
* @param {
|
|
16
|
+
* @param {RobotProps} props - The properties for the Robot component.
|
|
17
17
|
* @param {ConnectedMotionGroup} props.connectedMotionGroup - The connected motion group containing motion state and parameters.
|
|
18
18
|
* @param {Function} [props.getModel=defaultGetModel] - Optional function to get the model URL. Defaults to defaultGetModel.
|
|
19
19
|
* @param {Object} props - Additional properties passed to the SupportedRobot component.
|
|
@@ -25,7 +25,7 @@ export function Robot({
|
|
|
25
25
|
getModel = defaultGetModel,
|
|
26
26
|
isGhost = false,
|
|
27
27
|
...props
|
|
28
|
-
}:
|
|
28
|
+
}: RobotProps) {
|
|
29
29
|
if (!connectedMotionGroup.dhParameters) {
|
|
30
30
|
return null
|
|
31
31
|
}
|