<?xml version="1.0" ?>
<robot name="iai_student_robot" xmlns:xacro="http://www.ros.org/wiki/xacro">
    <material name="black">
        <color rgba="0.0 0.0 0.0 1.0"/>
    </material>
    <material name="blue">
        <color rgba="0 0 0.8 1"/>
    </material>
    <material name="green">
        <color rgba="0.0 0.8 0.0 1.0"/>
    </material>
    <material name="grey">
        <color rgba="0.2 0.2 0.2 1.0"/>
    </material>
    <material name="orange">
        <color rgba="1.0 0.423529411765 0.0392156862745 1.0"/>
    </material>
    <material name="brown">
        <color rgba="0.870588235294 0.811764705882 0.764705882353 1.0"/>
    </material>
    <material name="red">
        <color rgba="0.80078125 0.12890625 0.1328125 1.0"/>
    </material>
    <material name="white">
        <color rgba="1.0 1.0 1.0 1.0"/>
    </material>

    <xacro:property name="wheel_radius" value="0.08"/>
    <xacro:property name="pi" value="3.14"/>
    <xacro:property name="chassis_box_height" value="0.07"/>
    <xacro:property name="platform_cylinder_length" value="0.05"/>
    <xacro:property name="arm_cylinder_length" value="0.18"/>

    <link name="base_link">
        <!-- chassis box -->
        <visual>
            <origin rpy="0 0 0" xyz="0 0 0"/>
            <geometry>
                <box size="0.5 0.3 ${chassis_box_height}"/>
            </geometry>
            <material name="orange"/>
        </visual>

        <!-- caster front -->
        <visual name="caster_front_visual">
            <origin rpy=" 0 0 0" xyz="0.2 0 -0.03"/>
            <geometry>
                <sphere radius="0.05"/>
            </geometry>
        </visual>
    </link>

    <link name="right_wheel_link">
        <visual>
            <origin rpy="0 1.5707 1.5707" xyz="0 0 0"/>
            <geometry>
                <cylinder length="0.04" radius="${wheel_radius}"/>
            </geometry>
            <material name="black"/>
        </visual>
    </link>

    <joint name="right_wheel_joint" type="continuous">
        <origin rpy="0 0 0" xyz="-0.05 0.15 0"/>
        <child link="right_wheel_link"/>
        <parent link="base_link"/>
        <axis rpy="0 0 0" xyz="0 1 0"/>
        <limit effort="10000" velocity="10"/>
        <joint_properties damping="1.0" friction="1.0"/>
    </joint>

    <link name="left_wheel_link">
        <visual>
            <origin rpy="0 1.5707 1.5707" xyz="0 0 0"/>
            <geometry>
                <cylinder length="0.04" radius="${wheel_radius}"/>
            </geometry>
            <material name="black"/>
        </visual>
    </link>

    <joint name="left_wheel_joint" type="continuous">
        <origin rpy="0 0 0" xyz="-0.05 -0.15 0"/>
        <child link="left_wheel_link"/>
        <parent link="base_link"/>
        <axis rpy="0 0 0" xyz="0 1 0"/>
        <limit effort="10000" velocity="10"/>
        <joint_properties damping="1.0" friction="1.0"/>
    </joint>

    <link name="platform_link">
        <visual>
            <origin rpy="0 0 0" xyz="0 0 ${platform_cylinder_length/2}"/>
            <geometry>
                <cylinder length="${platform_cylinder_length}" radius="0.08"/>
            </geometry>
            <material name="blue"/>
        </visual>
    </link>

    <joint name="platform_joint" type="fixed">
        <origin rpy="0 0 0" xyz="0 0 0"/>
        <child link="platform_link"/>
        <parent link="base_link"/>
    </joint>
    <link name="torso">
        <visual>
            <geometry>
                <cylinder length="0.4" radius="0.04"/>
            </geometry>
            <material name="silver">
                <color rgba="0.75 0.75 0.75 1"/>
            </material>
            <origin rpy="0 0 0" xyz="0 0 0.25"/>
        </visual>
    </link>

    <joint name="hip" type="continuous">
        <axis xyz="0 0 1"/>
        <parent link="platform_link"/>
        <child link="torso"/>
        <origin rpy="0 0 0" xyz="0.0 0.0 0.000"/>
    </joint>

    <link name="upper_arm">
        <visual>
            <geometry>
                <cylinder length="0.2" radius="0.04"/>
            </geometry>
            <material name="silver"/>
            <origin rpy="0 0 0" xyz="0 0 0.1"/>
        </visual>
    </link>

    <joint name="shoulder" type="continuous">
        <axis xyz="0 1 0"/>
        <parent link="torso"/>
        <child link="upper_arm"/>
        <origin rpy="0 1.5708 0" xyz="0.0 -0.045 0.45"/>
    </joint>

    <link name="lower_arm">
        <visual>
            <geometry>
                <cylinder length="0.18" radius="0.04"/>
            </geometry>
            <material name="silver"/>
            <origin rpy="0 0 0" xyz="0.0 0.0 0.1"/>
        </visual>
    </link>

    <joint name="elbow" type="continuous">
        <axis xyz="0 1 0"/>
        <parent link="upper_arm"/>
        <child link="lower_arm"/>
        <origin rpy="0 0 0" xyz="0.0 -0.038 0.19"/>
    </joint>

    <link name="hand">
        <visual>
            <geometry>
                <box size="0.025 0.025 0.025"/>
            </geometry>
            <material name="silver"/>
        </visual>
    </link>

    <joint name="wrist" type="continuous">
        <axis xyz="0 1 0"/>
        <parent link="lower_arm"/>
        <child link="hand"/>
        <origin rpy="0 0 0" xyz="0.0 0.0 0.2"/>
    </joint>
</robot>
