<?xml version="1.0"?>
<robot name="zed_camera" xmlns:xacro="http://ros.org/wiki/xacro">
 
   <!-- Parameterised in part by the values in turtlebot_properties.urdf.xacro -->
   <xacro:macro name="sensor_zed_camera" params="parent">

<!--link name='base_link'/-->

    <link name="zed_left_camera">
        <visual>
            <origin xyz="0 0 0" rpy="0 1.57 0"/>
            <geometry>
                <cylinder radius="0.007" length=".031"/>
            </geometry>
            <material name="dark_grey">
                <color rgba="0.1 0.1 0.1 1"/>
            </material>
        </visual>
    </link>
    <link name="zed_center">
        <visual>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <mesh filename="package://zed_wrapper/urdf/ZED.stl" />
            </geometry>
            <material name="light_grey">
                <color rgba="0.8 0.8 0.8 0.8"/>
            </material>
        </visual>
    </link>
    <link name="zed_right_camera">
        <visual>
            <origin xyz="0 0 0" rpy="0 1.57 0"/>
            <geometry>
                <cylinder radius="0.007" length=".031"/>
            </geometry>
            <material name="dark_grey">
                <color rgba="0.1 0.1 0.1 1"/>
            </material>
        </visual>
    </link>
    <link name="zed_depth_camera" />
    <!--link name="fcu" /-->

<joint name="base_zed" type="fixed">
        <parent link="${parent}"/>
        <child link="zed_center"/>
        <origin xyz="0.15 0 -0.06" rpy="0 0 0" />
     </joint>

    <joint name="zed_left_camera_joint" type="fixed">
        <parent link="zed_center"/>
        <child link="zed_left_camera"/>
        <origin xyz="0 0.06 0" rpy="0 0 0" />
    </joint>
    <joint name="zed_depth_camera_joint" type="fixed">
        <parent link="zed_left_camera"/>
        <child link="zed_depth_camera"/>
        <origin xyz="0 0 0" rpy="-1.5707963267948966 0 -1.5707963267948966" />
    </joint>

    <!--joint name="imu_left_camera" type="fixed">
        <parent link="base_link"/>
        <child link="fcu"/>
        <origin xyz="-0.15 0 0.06" rpy="-3.069276 -1.477121 -1.661299" />
    </joint-->

   <joint name="   zed_right_camera_joint" type="fixed">
        <parent link="zed_center"/>
        <child link="zed_right_camera"/>
        <origin xyz="0 -0.06 0" rpy="0 0 0" />
    </joint>

    <!--joint name="zed_center_base_joint" type="fixed">
        <parent link="zed_center"/>
        <child link="base_link"/>
        <origin xyz="0.02 -0.06 0" rpy="0 0 0" />
    </joint-->
</xacro:macro>

</robot>
