<?xml version="1.0" encoding="UTF-8"?>
<!--This does not replace URDF, and is not an extension of URDF.
    This is a format for representing semantic information about the robot structure.
    A URDF file must exist for this robot as well, where the joints and the links that are referenced are defined
-->
<robot xmlns:xacro="http://ros.org/wiki/xacro">
    <xacro:macro name="arm_slider_srdf" params="device_name">
        <!--GROUPS: Representation of a set of joints and links. This can be useful for specifying DOF to plan for, defining arms, end effectors, etc-->
        <!--LINKS: When a link is specified, the parent joint of that link (if it exists) is automatically included-->
        <!--JOINTS: When a joint is specified, the child link of that joint (which will always exist) is automatically included-->
        <!--CHAINS: When a chain is specified, all the links along the chain (including endpoints) are included in the group. Additionally, all the joints that are parents to included links are also included. This means that joints along the chain and the parent joint of the base link are included in the group-->
        <!--SUBGROUPS: Groups can also be formed by referencing to already defined group names-->
        <group name="${device_name}arm">
            <chain base_link="${device_name}arm_slideway" tip_link="${device_name}gripper_base"/>
        </group>
        <group name="${device_name}arm_gripper">
            <joint name="${device_name}gripper_right_joint"/>
        </group>
        <!--DISABLE COLLISIONS: By default it is assumed that any link of the robot could potentially come into collision with any other link in the robot. This tag disables collision checking between a specified pair of links. -->
        <disable_collisions link1="${device_name}arm_base" link2="${device_name}arm_link_2" reason="Adjacent"/>
        <disable_collisions link1="${device_name}arm_base" link2="${device_name}arm_link_1" reason="Adjacent"/>
        <disable_collisions link1="${device_name}arm_base" link2="${device_name}arm_link_3" reason="Never"/>
        <disable_collisions link1="${device_name}arm_base" link2="${device_name}arm_slideway" reason="Adjacent"/>
        <disable_collisions link1="${device_name}arm_link_1" link2="${device_name}arm_link_2" reason="Adjacent"/>
        <disable_collisions link1="${device_name}arm_link_1" link2="${device_name}arm_link_3" reason="Never"/>
        <disable_collisions link1="${device_name}arm_link_1" link2="${device_name}arm_slideway" reason="Never"/>
        <disable_collisions link1="${device_name}arm_link_1" link2="${device_name}gripper_base" reason="Never"/>
        <disable_collisions link1="${device_name}arm_link_1" link2="${device_name}gripper_left" reason="Never"/>
        <disable_collisions link1="${device_name}arm_link_1" link2="${device_name}gripper_right" reason="Never"/>
        <disable_collisions link1="${device_name}arm_link_2" link2="${device_name}arm_link_3" reason="Adjacent"/>
        <disable_collisions link1="${device_name}arm_link_2" link2="${device_name}arm_slideway" reason="Never"/>
        <disable_collisions link1="${device_name}arm_link_2" link2="${device_name}gripper_base" reason="Never"/>
        <disable_collisions link1="${device_name}arm_link_2" link2="${device_name}gripper_left" reason="Never"/>
        <disable_collisions link1="${device_name}arm_link_2" link2="${device_name}gripper_right" reason="Never"/>
        <disable_collisions link1="${device_name}arm_link_3" link2="${device_name}arm_slideway" reason="Never"/>
        <disable_collisions link1="${device_name}arm_link_3" link2="${device_name}gripper_base" reason="Adjacent"/>
        <disable_collisions link1="${device_name}arm_link_3" link2="${device_name}gripper_left" reason="Never"/>
        <disable_collisions link1="${device_name}arm_link_3" link2="${device_name}gripper_right" reason="Never"/>
        <disable_collisions link1="${device_name}arm_slideway" link2="${device_name}gripper_base" reason="Never"/>
        <disable_collisions link1="${device_name}arm_slideway" link2="${device_name}gripper_left" reason="Never"/>
        <disable_collisions link1="${device_name}arm_slideway" link2="${device_name}gripper_right" reason="Never"/>
        <disable_collisions link1="${device_name}gripper_base" link2="${device_name}gripper_left" reason="Adjacent"/>
        <disable_collisions link1="${device_name}gripper_base" link2="${device_name}gripper_right" reason="Adjacent"/>
        <disable_collisions link1="${device_name}gripper_left" link2="${device_name}gripper_right" reason="Never"/>
    </xacro:macro>
</robot>
