@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.
Files changed (99) hide show
  1. package/dist/components/jogging/JoggingCartesianTab.d.ts.map +1 -1
  2. package/dist/components/jogging/JoggingJointLimitDetector.d.ts +1 -1
  3. package/dist/components/jogging/JoggingJointLimitDetector.d.ts.map +1 -1
  4. package/dist/components/jogging/JoggingPanel.d.ts +1 -1
  5. package/dist/components/jogging/JoggingPanel.d.ts.map +1 -1
  6. package/dist/components/jogging/JoggingVelocitySlider.d.ts.map +1 -1
  7. package/dist/components/robots/ABB_1200_07_7.d.ts +7 -2
  8. package/dist/components/robots/ABB_1200_07_7.d.ts.map +1 -1
  9. package/dist/components/robots/DHRobot.d.ts.map +1 -1
  10. package/dist/components/robots/FANUC_ARC_Mate_100iD.d.ts +7 -2
  11. package/dist/components/robots/FANUC_ARC_Mate_100iD.d.ts.map +1 -1
  12. package/dist/components/robots/FANUC_ARC_Mate_120iD.d.ts +7 -2
  13. package/dist/components/robots/FANUC_ARC_Mate_120iD.d.ts.map +1 -1
  14. package/dist/components/robots/FANUC_CRX10iA.d.ts +7 -2
  15. package/dist/components/robots/FANUC_CRX10iA.d.ts.map +1 -1
  16. package/dist/components/robots/FANUC_CRX20iAL.d.ts +7 -2
  17. package/dist/components/robots/FANUC_CRX20iAL.d.ts.map +1 -1
  18. package/dist/components/robots/FANUC_CRX25iA.d.ts +7 -2
  19. package/dist/components/robots/FANUC_CRX25iA.d.ts.map +1 -1
  20. package/dist/components/robots/FANUC_CRX25iAL.d.ts +7 -2
  21. package/dist/components/robots/FANUC_CRX25iAL.d.ts.map +1 -1
  22. package/dist/components/robots/KUKA_KR16_R2010_2.d.ts +7 -2
  23. package/dist/components/robots/KUKA_KR16_R2010_2.d.ts.map +1 -1
  24. package/dist/components/robots/KUKA_KR210_R2700.d.ts +7 -2
  25. package/dist/components/robots/KUKA_KR210_R2700.d.ts.map +1 -1
  26. package/dist/components/robots/KUKA_KR270_R2700.d.ts +7 -2
  27. package/dist/components/robots/KUKA_KR270_R2700.d.ts.map +1 -1
  28. package/dist/components/robots/Robot.d.ts +3 -3
  29. package/dist/components/robots/Robot.d.ts.map +1 -1
  30. package/dist/components/robots/RobotAnimator.d.ts +7 -4
  31. package/dist/components/robots/RobotAnimator.d.ts.map +1 -1
  32. package/dist/components/robots/SupportedRobot.d.ts +1 -5
  33. package/dist/components/robots/SupportedRobot.d.ts.map +1 -1
  34. package/dist/components/robots/UniversalRobots_UR10.d.ts +2 -2
  35. package/dist/components/robots/UniversalRobots_UR10.d.ts.map +1 -1
  36. package/dist/components/robots/UniversalRobots_UR10e.d.ts +2 -2
  37. package/dist/components/robots/UniversalRobots_UR10e.d.ts.map +1 -1
  38. package/dist/components/robots/UniversalRobots_UR3.d.ts +2 -2
  39. package/dist/components/robots/UniversalRobots_UR3.d.ts.map +1 -1
  40. package/dist/components/robots/UniversalRobots_UR3e.d.ts +2 -2
  41. package/dist/components/robots/UniversalRobots_UR3e.d.ts.map +1 -1
  42. package/dist/components/robots/UniversalRobots_UR5.d.ts +2 -2
  43. package/dist/components/robots/UniversalRobots_UR5.d.ts.map +1 -1
  44. package/dist/components/robots/UniversalRobots_UR5e.d.ts +2 -2
  45. package/dist/components/robots/UniversalRobots_UR5e.d.ts.map +1 -1
  46. package/dist/components/robots/Yaskawa_AR1440.d.ts +8 -2
  47. package/dist/components/robots/Yaskawa_AR1440.d.ts.map +1 -1
  48. package/dist/components/robots/Yaskawa_AR1730.d.ts +8 -2
  49. package/dist/components/robots/Yaskawa_AR1730.d.ts.map +1 -1
  50. package/dist/components/robots/Yaskawa_AR2010.d.ts +8 -2
  51. package/dist/components/robots/Yaskawa_AR2010.d.ts.map +1 -1
  52. package/dist/components/robots/Yaskawa_AR3120.d.ts +8 -2
  53. package/dist/components/robots/Yaskawa_AR3120.d.ts.map +1 -1
  54. package/dist/components/robots/Yaskawa_AR900.d.ts +7 -2
  55. package/dist/components/robots/Yaskawa_AR900.d.ts.map +1 -1
  56. package/dist/components/robots/Yaskawa_GP50.d.ts +7 -2
  57. package/dist/components/robots/Yaskawa_GP50.d.ts.map +1 -1
  58. package/dist/components/robots/types.d.ts +17 -0
  59. package/dist/components/robots/types.d.ts.map +1 -0
  60. package/dist/i18n/config.d.ts.map +1 -1
  61. package/dist/index.cjs +32 -32
  62. package/dist/index.cjs.map +1 -1
  63. package/dist/index.js +9706 -10063
  64. package/dist/index.js.map +1 -1
  65. package/package.json +1 -1
  66. package/src/components/jogging/JoggingCartesianTab.tsx +11 -11
  67. package/src/components/jogging/JoggingJointLimitDetector.tsx +9 -8
  68. package/src/components/jogging/JoggingPanel.tsx +8 -10
  69. package/src/components/jogging/JoggingVelocitySlider.tsx +4 -5
  70. package/src/components/robots/ABB_1200_07_7.tsx +7 -22
  71. package/src/components/robots/DHRobot.tsx +34 -33
  72. package/src/components/robots/FANUC_ARC_Mate_100iD.tsx +7 -22
  73. package/src/components/robots/FANUC_ARC_Mate_120iD.tsx +7 -22
  74. package/src/components/robots/FANUC_CRX10iA.tsx +7 -22
  75. package/src/components/robots/FANUC_CRX20iAL.tsx +7 -22
  76. package/src/components/robots/FANUC_CRX25iA.tsx +7 -22
  77. package/src/components/robots/FANUC_CRX25iAL.tsx +7 -22
  78. package/src/components/robots/KUKA_KR16_R2010_2.tsx +19 -34
  79. package/src/components/robots/KUKA_KR210_R2700.tsx +7 -23
  80. package/src/components/robots/KUKA_KR270_R2700.tsx +7 -23
  81. package/src/components/robots/Robot.tsx +3 -3
  82. package/src/components/robots/RobotAnimator.tsx +32 -21
  83. package/src/components/robots/SupportedRobot.tsx +93 -103
  84. package/src/components/robots/UniversalRobots_UR10.tsx +3 -20
  85. package/src/components/robots/UniversalRobots_UR10e.tsx +2 -19
  86. package/src/components/robots/UniversalRobots_UR3.tsx +2 -19
  87. package/src/components/robots/UniversalRobots_UR3e.tsx +3 -20
  88. package/src/components/robots/UniversalRobots_UR5.tsx +3 -20
  89. package/src/components/robots/UniversalRobots_UR5e.tsx +3 -20
  90. package/src/components/robots/Yaskawa_AR1440.tsx +8 -24
  91. package/src/components/robots/Yaskawa_AR1730.tsx +8 -24
  92. package/src/components/robots/Yaskawa_AR2010.tsx +8 -24
  93. package/src/components/robots/Yaskawa_AR3120.tsx +8 -24
  94. package/src/components/robots/Yaskawa_AR900.tsx +7 -22
  95. package/src/components/robots/Yaskawa_GP50.tsx +7 -24
  96. package/src/components/robots/types.ts +19 -0
  97. package/src/i18n/config.ts +15 -19
  98. package/src/i18n/locales/de/translations.json +2 -1
  99. package/src/i18n/locales/en/translations.json +2 -1
@@ -1,31 +1,14 @@
1
1
  import { animated } from "@react-spring/three"
2
2
  import { useGLTF } from "@react-three/drei"
3
- import type { RobotProps } from "./SupportedRobot"
4
- import RobotAnimator from "./RobotAnimator"
5
- import type * as THREE from "three"
3
+ import type { RobotModelProps } from "./types"
6
4
 
7
- export function UniversalRobots_UR10e({
8
- modelURL,
9
- rapidlyChangingMotionState,
10
- ...props
11
- }: RobotProps) {
5
+ export function UniversalRobots_UR10e({ modelURL, ...props }: RobotModelProps) {
12
6
  const gltf = useGLTF(modelURL) as any
13
7
  const nodes = gltf.nodes
14
8
  const materials = gltf.materials
15
9
 
16
- function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
17
- jointObjects.forEach(
18
- (object, index) => (object.rotation.y = jointValues[index]!),
19
- )
20
- }
21
-
22
10
  return (
23
11
  <>
24
- <RobotAnimator
25
- rapidlyChangingMotionState={rapidlyChangingMotionState}
26
- robotRootObjectName="Scene"
27
- onRotationChanged={setRotation}
28
- />
29
12
  <group {...props} dispose={null}>
30
13
  <group name="Scene">
31
14
  <group name="UR10e" rotation={[Math.PI / 2, 0, 0]}>
@@ -1,31 +1,14 @@
1
1
  import { animated } from "@react-spring/three"
2
2
  import { useGLTF } from "@react-three/drei"
3
- import type * as THREE from "three"
4
- import type { RobotProps } from "./SupportedRobot"
5
- import RobotAnimator from "./RobotAnimator"
3
+ import type { RobotModelProps } from "./types"
6
4
 
7
- export function UniversalRobots_UR3({
8
- modelURL,
9
- rapidlyChangingMotionState,
10
- ...props
11
- }: RobotProps) {
5
+ export function UniversalRobots_UR3({ modelURL, ...props }: RobotModelProps) {
12
6
  const gltf = useGLTF(modelURL) as any
13
7
  const nodes = gltf.nodes
14
8
  const materials = gltf.materials
15
9
 
16
- function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
17
- jointObjects.forEach(
18
- (object, index) => (object.rotation.y = jointValues[index]!),
19
- )
20
- }
21
-
22
10
  return (
23
11
  <>
24
- <RobotAnimator
25
- rapidlyChangingMotionState={rapidlyChangingMotionState}
26
- robotRootObjectName="Scene"
27
- onRotationChanged={setRotation}
28
- />
29
12
  <group {...props} dispose={null}>
30
13
  <group name="Scene">
31
14
  <group name="UR3" rotation={[Math.PI / 2, 0, 0]}>
@@ -1,31 +1,14 @@
1
- import { useGLTF } from "@react-three/drei"
2
- import type * as THREE from "three"
3
- import type { RobotProps } from "./SupportedRobot"
4
1
  import { animated } from "@react-spring/three"
5
- import RobotAnimator from "./RobotAnimator"
2
+ import { useGLTF } from "@react-three/drei"
3
+ import type { RobotModelProps } from "./types"
6
4
 
7
- export function UniversalRobots_UR3e({
8
- modelURL,
9
- rapidlyChangingMotionState,
10
- ...props
11
- }: RobotProps) {
5
+ export function UniversalRobots_UR3e({ modelURL, ...props }: RobotModelProps) {
12
6
  const gltf = useGLTF(modelURL) as any
13
7
  const nodes = gltf.nodes
14
8
  const materials = gltf.materials
15
9
 
16
- function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
17
- jointObjects.forEach(
18
- (object, index) => (object.rotation.y = jointValues[index]!),
19
- )
20
- }
21
-
22
10
  return (
23
11
  <>
24
- <RobotAnimator
25
- rapidlyChangingMotionState={rapidlyChangingMotionState}
26
- robotRootObjectName="Scene"
27
- onRotationChanged={setRotation}
28
- />
29
12
  <group {...props} dispose={null}>
30
13
  <group name="Scene">
31
14
  <animated.group name="UR3e" rotation={[Math.PI / 2, 0, 0]}>
@@ -1,31 +1,14 @@
1
- import { useGLTF } from "@react-three/drei"
2
- import type * as THREE from "three"
3
1
  import { animated } from "@react-spring/three"
4
- import type { RobotProps } from "./SupportedRobot"
5
- import RobotAnimator from "./RobotAnimator"
2
+ import { useGLTF } from "@react-three/drei"
3
+ import type { RobotModelProps } from "./types"
6
4
 
7
- export function UniversalRobots_UR5({
8
- modelURL,
9
- rapidlyChangingMotionState,
10
- ...props
11
- }: RobotProps) {
5
+ export function UniversalRobots_UR5({ modelURL, ...props }: RobotModelProps) {
12
6
  const gltf = useGLTF(modelURL) as any
13
7
  const nodes = gltf.nodes
14
8
  const materials = gltf.materials
15
9
 
16
- function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
17
- jointObjects.forEach(
18
- (object, index) => (object.rotation.y = jointValues[index]!),
19
- )
20
- }
21
-
22
10
  return (
23
11
  <>
24
- <RobotAnimator
25
- rapidlyChangingMotionState={rapidlyChangingMotionState}
26
- robotRootObjectName="Scene"
27
- onRotationChanged={setRotation}
28
- />
29
12
  <group {...props} dispose={null}>
30
13
  <group name="Scene">
31
14
  <animated.group name="UNIVERSALROBOTS_UR5CB3_J00">
@@ -1,31 +1,14 @@
1
- import { useGLTF } from "@react-three/drei"
2
- import type * as THREE from "three"
3
- import type { RobotProps } from "./SupportedRobot"
4
1
  import { animated } from "@react-spring/three"
5
- import RobotAnimator from "./RobotAnimator"
2
+ import { useGLTF } from "@react-three/drei"
3
+ import type { RobotModelProps } from "./types"
6
4
 
7
- export function UniversalRobots_UR5e({
8
- modelURL,
9
- rapidlyChangingMotionState,
10
- ...props
11
- }: RobotProps) {
5
+ export function UniversalRobots_UR5e({ modelURL, ...props }: RobotModelProps) {
12
6
  const gltf = useGLTF(modelURL) as any
13
7
  const nodes = gltf.nodes
14
8
  const materials = gltf.materials
15
9
 
16
- function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
17
- jointObjects.forEach(
18
- (object, index) => (object.rotation.y = jointValues[index]!),
19
- )
20
- }
21
-
22
10
  return (
23
11
  <>
24
- <RobotAnimator
25
- rapidlyChangingMotionState={rapidlyChangingMotionState}
26
- robotRootObjectName="Scene"
27
- onRotationChanged={setRotation}
28
- />
29
12
  <group {...props} dispose={null}>
30
13
  <group name="Scene">
31
14
  <group name="UR5e" rotation={[Math.PI / 2, 0, 0]}>
@@ -1,36 +1,20 @@
1
- import { useGLTF } from "@react-three/drei"
2
- import type * as THREE from "three"
3
- import type { RobotProps } from "./SupportedRobot"
4
1
  import { animated } from "@react-spring/three"
5
- import RobotAnimator from "./RobotAnimator"
2
+ import { useGLTF } from "@react-three/drei"
3
+ import type { RobotModelProps } from "./types"
6
4
 
7
- export function Yaskawa_AR1440({
8
- modelURL,
9
- rapidlyChangingMotionState,
10
- ...props
11
- }: RobotProps) {
5
+ Yaskawa_AR1440.config = {
6
+ rotationOffsets: [0, -Math.PI / 2, 0, 0, 0, 0],
7
+ rotationSign: [1, -1, 1, 1, 1, 1],
8
+ }
9
+
10
+ export function Yaskawa_AR1440({ modelURL, ...props }: RobotModelProps) {
12
11
  const gltf = useGLTF(modelURL) as any
13
12
 
14
13
  const nodes = gltf.nodes
15
14
  const materials = gltf.materials
16
- const rotationOffsets = [0, -Math.PI / 2, 0, 0, 0, 0]
17
- const rotationSign = [1, -1, 1, 1, 1, 1]
18
-
19
- function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
20
- jointObjects.forEach(
21
- (object, index) =>
22
- (object.rotation.y =
23
- rotationSign[index]! * jointValues[index]! + rotationOffsets[index]!),
24
- )
25
- }
26
15
 
27
16
  return (
28
17
  <>
29
- <RobotAnimator
30
- rapidlyChangingMotionState={rapidlyChangingMotionState}
31
- robotRootObjectName="Scene"
32
- onRotationChanged={setRotation}
33
- />
34
18
  <group {...props} dispose={null}>
35
19
  <group name="Scene">
36
20
  <group name="AR1440" rotation={[Math.PI / 2, 0, 0]}>
@@ -1,36 +1,20 @@
1
- import { useGLTF } from "@react-three/drei"
2
- import type * as THREE from "three"
3
- import type { RobotProps } from "./SupportedRobot"
4
1
  import { animated } from "@react-spring/three"
5
- import RobotAnimator from "./RobotAnimator"
2
+ import { useGLTF } from "@react-three/drei"
3
+ import type { RobotModelProps } from "./types"
6
4
 
7
- export function Yaskawa_AR1730({
8
- modelURL,
9
- rapidlyChangingMotionState,
10
- ...props
11
- }: RobotProps) {
5
+ Yaskawa_AR1730.config = {
6
+ rotationOffsets: [0, -Math.PI / 2, 0, 0, 0, 0],
7
+ rotationSign: [1, -1, 1, 1, 1, 1],
8
+ }
9
+
10
+ export function Yaskawa_AR1730({ modelURL, ...props }: RobotModelProps) {
12
11
  const gltf = useGLTF(modelURL) as any
13
12
 
14
13
  const nodes = gltf.nodes
15
14
  const materials = gltf.materials
16
- const rotationOffsets = [0, -Math.PI / 2, 0, 0, 0, 0]
17
- const rotationSign = [1, -1, 1, 1, 1, 1]
18
-
19
- function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
20
- jointObjects.forEach(
21
- (object, index) =>
22
- (object.rotation.y =
23
- rotationSign[index]! * jointValues[index]! + rotationOffsets[index]!),
24
- )
25
- }
26
15
 
27
16
  return (
28
17
  <>
29
- <RobotAnimator
30
- rapidlyChangingMotionState={rapidlyChangingMotionState}
31
- robotRootObjectName="Scene"
32
- onRotationChanged={setRotation}
33
- />
34
18
  <group {...props} dispose={null}>
35
19
  <group name="Scene">
36
20
  <animated.group name="AR1730_J00">
@@ -1,35 +1,19 @@
1
- import { useGLTF } from "@react-three/drei"
2
- import type * as THREE from "three"
3
- import type { RobotProps } from "./SupportedRobot"
4
1
  import { animated } from "@react-spring/three"
5
- import RobotAnimator from "./RobotAnimator"
2
+ import { useGLTF } from "@react-three/drei"
3
+ import type { RobotModelProps } from "./types"
6
4
 
7
- export function Yaskawa_AR2010({
8
- modelURL,
9
- rapidlyChangingMotionState,
10
- ...props
11
- }: RobotProps) {
5
+ Yaskawa_AR2010.config = {
6
+ rotationOffsets: [0, -Math.PI / 2, 0, 0, 0, 0],
7
+ rotationSign: [1, -1, 1, 1, 1, 1],
8
+ }
9
+
10
+ export function Yaskawa_AR2010({ modelURL, ...props }: RobotModelProps) {
12
11
  const gltf = useGLTF(modelURL) as any
13
12
  const nodes = gltf.nodes
14
13
  const materials = gltf.materials
15
- const rotationOffsets = [0, -Math.PI / 2, 0, 0, 0, 0]
16
- const rotationSign = [1, -1, 1, 1, 1, 1]
17
-
18
- function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
19
- jointObjects.forEach(
20
- (object, index) =>
21
- (object.rotation.y =
22
- rotationSign[index]! * jointValues[index]! + rotationOffsets[index]!),
23
- )
24
- }
25
14
 
26
15
  return (
27
16
  <>
28
- <RobotAnimator
29
- rapidlyChangingMotionState={rapidlyChangingMotionState}
30
- robotRootObjectName="Scene"
31
- onRotationChanged={setRotation}
32
- />
33
17
  <group {...props} dispose={null}>
34
18
  <group name="Scene">
35
19
  <group name="AR2010" rotation={[Math.PI / 2, 0, 0]}>
@@ -1,36 +1,20 @@
1
- import { useGLTF } from "@react-three/drei"
2
- import type * as THREE from "three"
3
- import type { RobotProps } from "./SupportedRobot"
4
- import RobotAnimator from "./RobotAnimator"
5
1
  import { animated } from "@react-spring/three"
2
+ import { useGLTF } from "@react-three/drei"
3
+ import type { RobotModelProps } from "./types"
6
4
 
7
- export function Yaskawa_AR3120({
8
- modelURL,
9
- rapidlyChangingMotionState,
10
- ...props
11
- }: RobotProps) {
5
+ Yaskawa_AR3120.config = {
6
+ rotationOffsets: [0, -Math.PI / 2, 0, 0, 0, 0],
7
+ rotationSign: [1, -1, 1, 1, 1, 1],
8
+ }
9
+
10
+ export function Yaskawa_AR3120({ modelURL, ...props }: RobotModelProps) {
12
11
  const gltf = useGLTF(modelURL) as any
13
12
 
14
13
  const nodes = gltf.nodes
15
14
  const materials = gltf.materials
16
- const rotationOffsets = [0, -Math.PI / 2, 0, 0, 0, 0]
17
- const rotationSign = [1, -1, 1, 1, 1, 1]
18
-
19
- function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
20
- jointObjects.forEach(
21
- (object, index) =>
22
- (object.rotation.y =
23
- rotationSign[index]! * jointValues[index]! + rotationOffsets[index]!),
24
- )
25
- }
26
15
 
27
16
  return (
28
17
  <>
29
- <RobotAnimator
30
- rapidlyChangingMotionState={rapidlyChangingMotionState}
31
- robotRootObjectName="Scene"
32
- onRotationChanged={setRotation}
33
- />
34
18
  <group {...props} dispose={null}>
35
19
  <group name="Scene">
36
20
  <animated.group name="AR3120_J00">
@@ -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 RobotAnimator from "./RobotAnimator"
2
+ import { useGLTF } from "@react-three/drei"
3
+ import type { RobotModelProps } from "./types"
6
4
 
7
- export function Yaskawa_AR900({
8
- modelURL,
9
- rapidlyChangingMotionState,
10
- ...props
11
- }: RobotProps) {
5
+ Yaskawa_AR900.config = {
6
+ rotationOffsets: [0, -Math.PI / 2, 0, 0, 0, 0],
7
+ }
8
+
9
+ export function Yaskawa_AR900({ 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="AR900" rotation={[Math.PI / 2, 0, 0]}>
@@ -1,36 +1,19 @@
1
- import { useGLTF } from "@react-three/drei"
2
- import type * as THREE from "three"
3
- import type { RobotProps } from "./SupportedRobot"
4
- import RobotAnimator from "./RobotAnimator"
5
1
  import { animated } from "@react-spring/three"
2
+ import { useGLTF } from "@react-three/drei"
3
+ import type { RobotModelProps } from "./types"
6
4
 
7
- export function Yaskawa_GP50({
8
- modelURL,
9
- rapidlyChangingMotionState,
10
- ...props
11
- }: RobotProps) {
5
+ Yaskawa_GP50.config = {
6
+ rotationOffsets: [0, -Math.PI / 2, 0, 0, 0, 0],
7
+ }
8
+
9
+ export function Yaskawa_GP50({ 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
- const rotationOffsets = [0, -Math.PI / 2, 0, 0, 0, 0]
17
- const rotationSign = [1, 1, 1, 1, 1, 1]
18
-
19
- function setRotation(jointObjects: THREE.Object3D[], jointValues: number[]) {
20
- jointObjects.forEach(
21
- (object, index) =>
22
- (object.rotation.y =
23
- rotationSign[index]! * jointValues[index]! + rotationOffsets[index]!),
24
- )
25
- }
26
14
 
27
15
  return (
28
16
  <>
29
- <RobotAnimator
30
- rapidlyChangingMotionState={rapidlyChangingMotionState}
31
- robotRootObjectName="Scene"
32
- onRotationChanged={setRotation}
33
- />
34
17
  <group {...props} dispose={null}>
35
18
  <group name="Scene">
36
19
  <group name="link_0">
@@ -0,0 +1,19 @@
1
+ import type { GroupProps } from "@react-three/fiber"
2
+
3
+ export type RobotModelProps = {
4
+ modelURL: string
5
+ } & GroupProps
6
+
7
+ /**
8
+ * Configuration needed to render a specific robot model that
9
+ * isn't already handled by the gltf => tsx export
10
+ */
11
+ export type RobotModelConfig = {
12
+ rotationOffsets?: number[]
13
+ rotationSign?: number[]
14
+ }
15
+
16
+ export type RobotModelComponent = {
17
+ (props: RobotModelProps): JSX.Element
18
+ config?: RobotModelConfig
19
+ }
@@ -1,27 +1,23 @@
1
- import deJSON from "./locales/de/translations.json"
2
- import enJSON from "./locales/en/translations.json"
3
- import i18next from "i18next"
4
1
  import type { i18n } from "i18next"
2
+ import i18next from "i18next"
5
3
  import LanguageDetector from "i18next-browser-languagedetector"
6
- import { initReactI18next } from "react-i18next"
4
+ import deJSON from "./locales/de/translations.json"
5
+ import enJSON from "./locales/en/translations.json"
7
6
 
8
7
  const i18n: i18n = i18next.createInstance()
9
8
 
10
- i18n
11
- .use(LanguageDetector)
12
- .use(initReactI18next)
13
- .init({
14
- supportedLngs: ["en", "de"],
15
- resources: {
16
- en: {
17
- translations: enJSON,
18
- },
19
- de: {
20
- translations: deJSON,
21
- },
9
+ i18n.use(LanguageDetector).init({
10
+ supportedLngs: ["en", "de"],
11
+ resources: {
12
+ en: {
13
+ translations: enJSON,
14
+ },
15
+ de: {
16
+ translations: deJSON,
22
17
  },
23
- ns: ["translations"],
24
- defaultNS: "translations",
25
- })
18
+ },
19
+ ns: ["translations"],
20
+ defaultNS: "translations",
21
+ })
26
22
 
27
23
  export default i18n
@@ -11,5 +11,6 @@
11
11
  "Jogging.Increment.Continuous.dd": "Fortlaufend",
12
12
  "Jogging.Cartesian.Orientation.lb": "Orientierung",
13
13
  "Jogging.Activate.bt": "Jogging activieren",
14
- "Jogging.Activating.lb": "Jogging wird aktivieren"
14
+ "Jogging.Activating.lb": "Jogging wird aktivieren",
15
+ "Jogging.JointLimitsReached.lb": "Joint-Limit für Joint {{jointNumbers}} erreicht"
15
16
  }
@@ -11,5 +11,6 @@
11
11
  "Jogging.Increment.Continuous.dd": "Continuous",
12
12
  "Jogging.Cartesian.Orientation.lb": "Orientation",
13
13
  "Jogging.Activate.bt": "Activate jogging",
14
- "Jogging.Activating.lb": "Activating jogging"
14
+ "Jogging.Activating.lb": "Activating jogging",
15
+ "Jogging.JointLimitsReached.lb": "Joint limit reached for joint {{jointNumbers}}"
15
16
  }