URDF案例:SCARA

需求介绍

模拟建造一个类似于ABB的SCARA类似的产品。

实现需求

模型分析

两个可以旋转的轴,一个可以上下滑动的轴。

总共是3个joint,4个link.

建立模型

<?xml version="1.0"?>
<robot name="scara">
    <material name="red">
        <color rgba="1.0 0 0 1.0"/>
    </material>
    <material name="green">
        <color rgba="0 1.0 0 1.0"/>
    </material>
    <material name="blue">
        <color rgba="0 0 1.0 1.0"/>
    </material>
    <material name="white">
        <color rgba="1.0 1.0 1.0 1.0"/>
    </material>

    <!-- base link -->
    <link name="base_link">
        <visual>
            <origin xyz="0 0 0.3" rpy="0 0 0"/>
            <geometry>
                <box size="0.2 0.4 0.6"/>
            </geometry>
            <material name="white"/>
        </visual>
    </link>

    <!-- link1 -->
    <link name="link1">
        <visual>
            <origin xyz="0 -0.2 0.05" rpy="0 0 0"/>
            <geometry>
                <box size="0.2 0.6 0.1"/>
            </geometry>
            <material name="blue"/>
        </visual>
    </link>

    <!-- joint: toggle link -->
    <joint name="joint0" type="revolute">
        <origin xyz="0 -0.1 0.6" rpy="0 0 0"/>
        <axis xyz="0 0 1"/>
        <parent link="base_link"/>
        <child link="link1"/>

        <limit effort="30" velocity="1.0" lower="-2.5" upper="2.5"/>
    </joint>


    <!-- link2 -->
    <link name="link2">
        <visual>
            <origin xyz="0 -0.2 0.15" rpy="0 0 0"/>
            <geometry>
                <box size="0.2 0.6 0.3"/>
            </geometry>
            <material name="green"/>
        </visual>
    </link>

    <!-- joint: toggle link -->
    <joint name="joint1" type="revolute">
        <origin xyz="0 -0.4 0.1" rpy="0 0 0"/>
        <axis xyz="0 0 1"/>
        <parent link="link1"/>
        <child link="link2"/>

        <limit effort="30" velocity="1.0" lower="-2.5" upper="2.5"/>
    </joint>

    <!-- link3 -->
    <link name="link3">
        <visual>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <cylinder length="1" radius="0.01"/>
            </geometry>
            <material name="red"/>
        </visual>
    </link>

    <!-- joint: toggle link -->
    <joint name="joint2" type="prismatic">
        <origin xyz="0 -0.4 0.15" rpy="0 0 0"/>
        <axis xyz="0 0 1"/>
        <parent link="link2"/>
        <child link="link3"/>

        <limit effort="30" velocity="1.0" lower="-0.35" upper="0.35"/>
    </joint>

</robot>