<?xml version="1.0"?>
<!--

  Copyright (c) 2021 PAL Robotics S.L. All rights reserved.
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
      http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<robot xmlns:xacro="http://ros.org/wiki/xacro">

  <!--File includes-->
  <xacro:include filename="$(find pmb2_description)/urdf/deg_to_rad.xacro" />

  <xacro:macro name="cameras_add_on" params="name parent">
    <link name="${name}_link">
      <inertial>
        <origin xyz="-0.00001132 0.04392363 0.06783541" rpy="0.0 0.0 0.0"/>
        <mass value="3.057"/>
        <inertia ixx="0.08241443" ixy="-0.00000558" ixz="-0.00001319"
          iyy="0.05540468" iyz="0.01732357"
          izz="0.07634613"/>
        </inertial>
        <visual>
          <origin xyz="0 0 0" rpy="0 0 0"/>
          <geometry>
            <mesh filename="package://pmb2_description/meshes/cameras_add_on/cameras_add_on.stl" scale="1 1 1"/>
          </geometry>
          <material name="White" />
        </visual>
        <collision>
          <origin xyz="0 0 0" rpy="0 0 0" />
          <geometry>
            <mesh filename="package://pmb2_description/meshes/cameras_add_on/cameras_add_on_collision.stl" scale="1 1 1"/>
          </geometry>
          <material name="White" />
        </collision>
      </link>
      <joint name="${name}_joint" type="fixed">
        <parent link="${parent}"/>
        <child link="${name}_link"/>
        <origin xyz="0.0 0.0 0.0"  rpy="0 0 0" />
        <axis xyz="0 0 1" />
      </joint>
    </xacro:macro>

    <xacro:include filename="$(find pmb2_description)/urdf/sensors/courier.urdf.xacro" />

  </robot>

