@wandelbots/wandelbots-js-react-components 1.17.2 → 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/jogging/JoggingCartesianTab.d.ts.map +1 -1
- package/dist/components/jogging/JoggingJointLimitDetector.d.ts +1 -1
- package/dist/components/jogging/JoggingJointLimitDetector.d.ts.map +1 -1
- package/dist/components/jogging/JoggingPanel.d.ts +1 -1
- package/dist/components/jogging/JoggingPanel.d.ts.map +1 -1
- package/dist/components/jogging/JoggingVelocitySlider.d.ts.map +1 -1
- 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/i18n/config.d.ts.map +1 -1
- package/dist/index.cjs +32 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9706 -10063
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/jogging/JoggingCartesianTab.tsx +11 -11
- package/src/components/jogging/JoggingJointLimitDetector.tsx +9 -8
- package/src/components/jogging/JoggingPanel.tsx +8 -10
- package/src/components/jogging/JoggingVelocitySlider.tsx +4 -5
- 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/src/i18n/config.ts +15 -19
- package/src/i18n/locales/de/translations.json +2 -1
- package/src/i18n/locales/en/translations.json +2 -1
package/package.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
|
-
ToggleButtonGroup,
|
|
3
|
-
ToggleButton,
|
|
4
2
|
Stack,
|
|
3
|
+
ToggleButton,
|
|
4
|
+
ToggleButtonGroup,
|
|
5
5
|
Typography,
|
|
6
6
|
} from "@mui/material"
|
|
7
|
-
import { observer } from "mobx-react-lite"
|
|
8
|
-
import { JoggingCartesianAxisControl } from "./JoggingCartesianAxisControl"
|
|
9
7
|
import { degreesToRadians, radiansToDegrees } from "@wandelbots/wandelbots-js"
|
|
8
|
+
import { observer } from "mobx-react-lite"
|
|
10
9
|
import { useTranslation } from "react-i18next"
|
|
11
|
-
import RotationIcon from "../../icons/rotation.svg"
|
|
12
10
|
import XAxisIcon from "../../icons/axis-x.svg"
|
|
13
11
|
import YAxisIcon from "../../icons/axis-y.svg"
|
|
14
12
|
import ZAxisIcon from "../../icons/axis-z.svg"
|
|
15
|
-
import
|
|
16
|
-
import { JoggingOptions } from "./JoggingOptions"
|
|
17
|
-
import { JoggingVelocitySlider } from "./JoggingVelocitySlider"
|
|
13
|
+
import RotationIcon from "../../icons/rotation.svg"
|
|
18
14
|
import { useReaction } from "../utils/hooks"
|
|
15
|
+
import { JoggingCartesianAxisControl } from "./JoggingCartesianAxisControl"
|
|
19
16
|
import { JoggingCartesianValues } from "./JoggingCartesianValues"
|
|
20
17
|
import { JoggingJointLimitDetector } from "./JoggingJointLimitDetector"
|
|
18
|
+
import { JoggingOptions } from "./JoggingOptions"
|
|
19
|
+
import type { DiscreteIncrementOption, JoggingStore } from "./JoggingStore"
|
|
20
|
+
import { JoggingVelocitySlider } from "./JoggingVelocitySlider"
|
|
21
21
|
|
|
22
22
|
type JoggingCartesianOpts = {
|
|
23
23
|
axis: "x" | "y" | "z"
|
|
@@ -247,11 +247,11 @@ export const JoggingCartesianTab = observer(
|
|
|
247
247
|
))}
|
|
248
248
|
</Stack>
|
|
249
249
|
|
|
250
|
-
{/* Velocity slider */}
|
|
251
|
-
<JoggingVelocitySlider store={store} />
|
|
252
|
-
|
|
253
250
|
{/* Show message if joint limits reached */}
|
|
254
251
|
<JoggingJointLimitDetector store={store} />
|
|
252
|
+
|
|
253
|
+
{/* Velocity slider */}
|
|
254
|
+
<JoggingVelocitySlider store={store} />
|
|
255
255
|
</Stack>
|
|
256
256
|
)
|
|
257
257
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Typography } from "@mui/material"
|
|
2
|
-
import { useTranslation } from "react-i18next"
|
|
3
|
-
import { useState } from "react"
|
|
4
2
|
import isEqual from "lodash-es/isEqual"
|
|
3
|
+
import { useRef, useState } from "react"
|
|
4
|
+
import { useTranslation } from "react-i18next"
|
|
5
5
|
import { useAnimationFrame } from "../utils/hooks"
|
|
6
6
|
import type { JoggingStore } from "./JoggingStore"
|
|
7
7
|
|
|
@@ -20,30 +20,31 @@ export const JoggingJointLimitDetector = ({
|
|
|
20
20
|
store.jogger.motionStream.rapidlyChangingMotionState.state
|
|
21
21
|
.joint_limit_reached.limit_reached,
|
|
22
22
|
)
|
|
23
|
+
const jointLimitsReachedRef = useRef(jointLimitsReached)
|
|
23
24
|
|
|
24
25
|
useAnimationFrame(() => {
|
|
25
26
|
const newLimitsReached =
|
|
26
27
|
store.jogger.motionStream.rapidlyChangingMotionState.state
|
|
27
28
|
.joint_limit_reached.limit_reached
|
|
28
29
|
|
|
29
|
-
if (!isEqual(
|
|
30
|
+
if (!isEqual(jointLimitsReachedRef.current, newLimitsReached)) {
|
|
31
|
+
jointLimitsReachedRef.current = newLimitsReached
|
|
30
32
|
setJointLimitsReached(newLimitsReached)
|
|
31
33
|
}
|
|
32
34
|
})
|
|
33
35
|
|
|
34
36
|
const jointLimitReachedIndices: number[] = []
|
|
35
|
-
jointLimitsReached.
|
|
37
|
+
for (const [index, limitReached] of jointLimitsReached.entries()) {
|
|
36
38
|
if (limitReached) jointLimitReachedIndices.push(index)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (!jointLimitReachedIndices.length) return null
|
|
39
|
+
}
|
|
40
40
|
|
|
41
41
|
return (
|
|
42
42
|
<Typography
|
|
43
43
|
color="error"
|
|
44
44
|
sx={{
|
|
45
|
-
|
|
45
|
+
margin: "0.5rem 1rem",
|
|
46
46
|
textAlign: "center",
|
|
47
|
+
visibility: jointLimitReachedIndices.length ? "visible" : "hidden",
|
|
47
48
|
}}
|
|
48
49
|
>
|
|
49
50
|
{t("Jogging.JointLimitsReached.lb", {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Button, Paper, Stack, Tab, Tabs } from "@mui/material"
|
|
2
|
+
import { NovaClient } from "@wandelbots/wandelbots-js"
|
|
3
|
+
import { isString } from "lodash-es"
|
|
4
|
+
import { runInAction } from "mobx"
|
|
2
5
|
import { observer, useLocalObservable } from "mobx-react-lite"
|
|
3
6
|
import { useEffect } from "react"
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { JoggingStore } from "./JoggingStore"
|
|
7
|
+
import { useTranslation } from "react-i18next"
|
|
8
|
+
import { externalizeComponent } from "../../externalizeComponent"
|
|
7
9
|
import { LoadingCover } from "../LoadingCover"
|
|
8
10
|
import { TransparentOverlay } from "../TransparentOverlay"
|
|
9
|
-
import { runInAction } from "mobx"
|
|
10
|
-
import { NovaClient } from "@wandelbots/wandelbots-js"
|
|
11
|
-
import { externalizeComponent } from "../../externalizeComponent"
|
|
12
|
-
import { isString } from "lodash-es"
|
|
13
11
|
import { useReaction } from "../utils/hooks"
|
|
14
|
-
import {
|
|
12
|
+
import { JoggingCartesianTab } from "./JoggingCartesianTab"
|
|
13
|
+
import { JoggingJointTab } from "./JoggingJointTab"
|
|
14
|
+
import { JoggingStore } from "./JoggingStore"
|
|
15
15
|
|
|
16
16
|
export type JoggingPanelProps = {
|
|
17
17
|
/** Either an existing NovaClient or the base url of a deployed Nova instance */
|
|
@@ -31,8 +31,6 @@ export type JoggingPanelProps = {
|
|
|
31
31
|
*/
|
|
32
32
|
export const JoggingPanel = externalizeComponent(
|
|
33
33
|
observer((props: JoggingPanelProps) => {
|
|
34
|
-
const { t } = useTranslation()
|
|
35
|
-
|
|
36
34
|
const nova = isString(props.nova)
|
|
37
35
|
? new NovaClient({ instanceUrl: props.nova })
|
|
38
36
|
: props.nova
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Stack
|
|
1
|
+
import { Stack } from "@mui/material"
|
|
2
2
|
import { observer, useLocalObservable } from "mobx-react-lite"
|
|
3
|
-
import type { JoggingStore } from "./JoggingStore"
|
|
4
|
-
import { VelocitySlider } from "../VelocitySlider"
|
|
5
3
|
import { useTranslation } from "react-i18next"
|
|
4
|
+
import { VelocitySlider } from "../VelocitySlider"
|
|
5
|
+
import type { JoggingStore } from "./JoggingStore"
|
|
6
6
|
|
|
7
7
|
export const JoggingVelocitySlider = observer(
|
|
8
8
|
({ store }: { store: JoggingStore }) => {
|
|
@@ -24,8 +24,7 @@ export const JoggingVelocitySlider = observer(
|
|
|
24
24
|
<Stack
|
|
25
25
|
sx={{
|
|
26
26
|
margin: "0px 20px",
|
|
27
|
-
|
|
28
|
-
marginBottom: "24px",
|
|
27
|
+
marginBottom: "12px",
|
|
29
28
|
}}
|
|
30
29
|
>
|
|
31
30
|
<Stack sx={{ width: "380px", maxWidth: "90%", margin: "auto" }}>
|
|
@@ -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">
|