<?xml version="1.0" encoding="UTF-8"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">
    <xacro:macro name="dummy2_robot_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
            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
        -->
            <group name="${device_name}dummy2_arm">
                <joint name="${device_name}virtual_joint"/>
                <joint name="${device_name}Joint1"/>
                <joint name="${device_name}Joint2"/>
                <joint name="${device_name}Joint3"/>
                <joint name="${device_name}Joint4"/>
                <joint name="${device_name}Joint5"/>
                <joint name="${device_name}Joint6"/>
            </group>
            <!--GROUP STATES: Purpose: Define a named state for a particular group, in terms of joint values. This is useful to define states like 'folded arms'-->
            <group_state name="home" group="${device_name}dummy2_arm">
                <joint name="${device_name}Joint1" value="0"/>
                <joint name="${device_name}Joint2" value="0"/>
                <joint name="${device_name}Joint3" value="0"/>
                <joint name="${device_name}Joint4" value="0"/>
                <joint name="${device_name}Joint5" value="0"/>
                <joint name="${device_name}Joint6" value="0"/>
            </group_state>
            <!--VIRTUAL JOINT: Purpose: this element defines a virtual joint between a robot link and an external frame of reference (considered fixed with respect to the robot)-->
            <virtual_joint name="${device_name}virtual_joint" type="fixed" parent_frame="world" child_link="${device_name}base_link"/>
            <!--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}J1_1" link2="${device_name}J2_1" reason="Adjacent"/>
            <disable_collisions link1="${device_name}J1_1" link2="${device_name}J3_1" reason="Never"/>
            <disable_collisions link1="${device_name}J1_1" link2="${device_name}J4_1" reason="Never"/>
            <disable_collisions link1="${device_name}J1_1" link2="${device_name}base_link" reason="Adjacent"/>
            <disable_collisions link1="${device_name}J2_1" link2="${device_name}J3_1" reason="Adjacent"/>
            <disable_collisions link1="${device_name}J3_1" link2="${device_name}J4_1" reason="Adjacent"/>
            <disable_collisions link1="${device_name}J3_1" link2="${device_name}J5_1" reason="Never"/>
            <disable_collisions link1="${device_name}J3_1" link2="${device_name}J6_1" reason="Never"/>
            <disable_collisions link1="${device_name}J3_1" link2="${device_name}base_link" reason="Never"/>
            <disable_collisions link1="${device_name}J4_1" link2="${device_name}J5_1" reason="Adjacent"/>
            <disable_collisions link1="${device_name}J4_1" link2="${device_name}J6_1" reason="Never"/>
            <disable_collisions link1="${device_name}J5_1" link2="${device_name}J6_1" reason="Adjacent"/>

    </xacro:macro>

</robot>