Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add new robot Fanuc LR Mate 200iD/4S #115

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/models/FANUC_LR_Mate_200iD4S.glb
Binary file not shown.
112 changes: 112 additions & 0 deletions src/components/robots/FANUC_LR_Mate_200iD4S.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
/*
Auto-generated by: https://github.com/pmndrs/gltfjsx
*/

import { animated } from "@react-spring/three"
import { useGLTF } from "@react-three/drei"
import type { RobotModelProps } from "./types"

FANUC_LR_Mate_200iD4S.config = {
rotationOffsets: [0, Math.PI / 2, 0, 0, 0, 0],
}

export function FANUC_LR_Mate_200iD4S({
modelURL,
flangeRef,
...props
}: RobotModelProps) {
const { nodes, materials } = useGLTF(modelURL) as any
return (
<group {...props} dispose={null}>
<group name="Empty">
<mesh
name="link_0"
geometry={nodes.link_0.geometry}
material={materials.fanuc_metal_black}
/>
<animated.group name="FANUC_LRMATE200ID4S_J00">
<animated.group
name="FANUC_LRMATE200ID4S_J01"
rotation={[Math.PI / 2, Math.PI / 2, 0]}
>
<animated.group
name="FANUC_LRMATE200ID4S_J02"
position={[0.26, 0, 0]}
>
<animated.group
name="FANUC_LRMATE200ID4S_J03"
position={[0.02, 0, 0]}
rotation={[-Math.PI / 2, 0, 0]}
>
<animated.group
name="FANUC_LRMATE200ID4S_J04"
position={[0, -0.29, 0]}
rotation={[Math.PI / 2, 0, 0]}
>
<animated.group
name="FANUC_LRMATE200ID4S_J05"
rotation={[-Math.PI / 2, 0, 0]}
>
<group
name="FANUC_LRMATE200ID4S_FLG"
position={[0, -0.07, 0]}
rotation={[-Math.PI, 0, 0]}
/>
<mesh
name="link_6"
geometry={nodes.link_6.geometry}
material={materials.fanuc_metal_black}
position={[-0.28, 0.29, 0]}
rotation={[0, 0, -Math.PI / 2]}
/>
</animated.group>
<mesh
name="link_5"
geometry={nodes.link_5.geometry}
material={materials.fanuc_yellow}
position={[-0.28, 0, -0.29]}
rotation={[-Math.PI / 2, 0, -Math.PI / 2]}
/>
</animated.group>
<group
name="link_4"
position={[-0.28, 0, 0]}
rotation={[0, 0, -Math.PI / 2]}
>
<mesh
name="J3ARM_UNIT"
geometry={nodes.J3ARM_UNIT.geometry}
material={materials.fanuc_yellow}
/>
<mesh
name="J3ARM_UNIT_1"
geometry={nodes.J3ARM_UNIT_1.geometry}
material={materials.fanuc_aluminium_black}
/>
</group>
</animated.group>
<mesh
name="link_3"
geometry={nodes.link_3.geometry}
material={materials.fanuc_yellow}
position={[-0.26, 0, 0]}
rotation={[-Math.PI / 2, 0, -Math.PI / 2]}
/>
</animated.group>
<mesh
name="link_2"
geometry={nodes.link_2.geometry}
material={materials.fanuc_yellow}
rotation={[-Math.PI / 2, 0, -Math.PI / 2]}
/>
</animated.group>
<mesh
name="link_1"
geometry={nodes.link_1.geometry}
material={materials.fanuc_yellow}
/>
</animated.group>
</group>
</group>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { animated } from "@react-spring/three"
import { useGLTF } from "@react-three/drei"
import type { RobotModelProps } from "./types"

FANUC_LR_MATE_200iD7L.config = {
FANUC_LR_Mate_200iD7L.config = {
rotationOffsets: [0, Math.PI / 2, 0, 0, 0, 0],
}

export function FANUC_LR_MATE_200iD7L({
export function FANUC_LR_Mate_200iD7L({
modelURL,
flangeRef,
...props
Expand Down
8 changes: 6 additions & 2 deletions src/components/robots/SupportedRobot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { FANUC_CRX20iAL } from "./FANUC_CRX20iAL"
import { FANUC_CRX25iA } from "./FANUC_CRX25iA"
import { FANUC_CRX25iAL } from "./FANUC_CRX25iAL"
import { FANUC_LR_Mate_200iD } from "./FANUC_LR_Mate_200iD"
import { FANUC_LR_MATE_200iD7L } from "./FANUC_LR_MATE_200iD7L"
import { FANUC_LR_Mate_200iD4S } from "./FANUC_LR_Mate_200iD4S"
import { FANUC_LR_Mate_200iD7L } from "./FANUC_LR_Mate_200iD7L"
import { KUKA_KR16_R2010_2 } from "./KUKA_KR16_R2010_2"
import { KUKA_KR210_R2700 } from "./KUKA_KR210_R2700"
import { KUKA_KR270_R2700 } from "./KUKA_KR270_R2700"
Expand Down Expand Up @@ -221,8 +222,11 @@ export const SupportedRobot = externalizeComponent(
case "FANUC_LR_Mate_200iD":
Robot = FANUC_LR_Mate_200iD
break
case "FANUC_LR_Mate_200iD4S":
Robot = FANUC_LR_Mate_200iD4S
break
case "FANUC_LR_Mate_200iD7L":
Robot = FANUC_LR_MATE_200iD7L
Robot = FANUC_LR_Mate_200iD7L
break
case "FANUC_ARC_Mate_120iD":
Robot = FANUC_ARC_Mate_120iD
Expand Down
73 changes: 73 additions & 0 deletions stories/robots/FANUC_LR_Mate_200iD4S.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import type { StoryObj } from "@storybook/react"
import { SupportedRobot } from "../../src"
import { rapidlyChangingMotionState } from "./motionState"
import { sharedStoryConfig } from "./robotStoryConfig"

export default {
...sharedStoryConfig,
tags: ["!autodocs"],
title: "3D View/Robot/Supported Models/FANUC_LR_Mate_200iD4S",
}

function SupportedRobotScene(
props: React.ComponentProps<typeof SupportedRobot>,
) {
return (
<SupportedRobot
{...props}
rapidlyChangingMotionState={rapidlyChangingMotionState}
dhParameters={[
{
a: 0,
d: 0,
alpha: 1.5707963267948966,
theta: 0,
reverse_rotation_direction: false,
},
{
a: 260,
d: 0,
alpha: 0,
theta: 1.5707963267948966,
reverse_rotation_direction: false,
},
{
a: 20,
d: 0,
alpha: -1.5707963267948966,
theta: 0,
reverse_rotation_direction: false,
},
{
a: 0,
d: -290,
alpha: 1.5707963267948966,
theta: 0,
reverse_rotation_direction: false,
},
{
a: 0,
d: 0,
alpha: -1.5707963267948966,
theta: 0,
reverse_rotation_direction: false,
},
{
a: 0,
d: -70,
alpha: 3.1415926535897931,
theta: 0,
reverse_rotation_direction: false,
},
]}
/>
)
}

export const RobotStory: StoryObj<typeof SupportedRobotScene> = {
args: {
modelFromController: "FANUC_LR_Mate_200iD4S",
},
render: (args) => <SupportedRobotScene {...args} />,
name: "FANUC_LR_Mate_200iD4S",
}