Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I've already solved this problem. I think the problem was inertial elements which I didn't specified any for the base link and link_0. I didn't specify their inertial properties at first. However when I specify inertial elements like mass and inertia, I successfully converted the exact urdf model to sdf.

I've already solved this problem. I think the problem was inertial elements which I didn't specified specify any for the base link and link_0. I didn't specify their inertial properties at first. However when I specify inertial elements like mass and inertia, I successfully converted the exact urdf model to sdf.

I've already solved this problem. I think the problem was inertial elements which I didn't specify any for the base link and link_0. I didn't specify their inertial properties at first. However when I specify inertial elements like mass and inertia, I successfully converted the exact urdf model to sdf.

Here is the new urdf file that the problem is solved in;

<?xml version="1.0" ?>
<robot name="testbot">

    <!--platform-->

    <link name="pform">

        <inertial>
                <mass value="1"/>
            <inertia ixx="0.13" iyy="0.524" izz="0.539" ixy="0" ixz="0" iyz="0" />
            </inertial>

        <visual>
                <geometry>
                    <cylinder length="0.125" radius="0.08"/>
                </geometry>
                <material name="Orange">
                    <color rgba="1 0.4 0 1"/>
                </material>
                <origin rpy="0 0 0" xyz="0 0 0"/>
            </visual>

            <collision>
                <geometry>
                    <cylinder length="0.125" radius="0.08"/>
                </geometry>
            </collision>   

    </link>


    <!--base cylinder-->

    <link name="base">

        <inertial>
                <mass value="1"/>
            <inertia ixx="0.13" iyy="0.524" izz="0.539" ixy="0" ixz="0" iyz="0" />
            </inertial>

        <visual>
                <geometry>
                    <cylinder length="0.025" radius="0.08"/>
                </geometry>
                <material name="Orange">
                    <color rgba="1 0.4 0 1"/>
                </material>
                <origin rpy="0 0 0" xyz="0 0 0"/>
            </visual>

            <collision>
                <geometry>
                    <cylinder length="0.025" radius="0.08"/>
                </geometry>
            </collision>   

    </link>


    <!--joint between pform and base-->

    <joint name="pform_to_base" type="fixed">
        <origin xyz="0 0 0.075" rpy="0 0 0" />
        <axis xyz="0 0 0" />
            <parent link="pform"/>
            <child link="base"/>
    </joint>


    <!--link_0-->

    <link name="link_0">

        <inertial>
                <mass value="25" />
            <inertia ixx="0.13" iyy="0.524" izz="0.539" ixy="0" ixz="0" iyz="0" />
            </inertial>

            <visual>
                <geometry>
                    <cylinder length="0.2385" radius="0.0295"/>
                </geometry>
                <material name="Orange">
                    <color rgba="1 0.4 0 1"/>
                </material>
                <origin rpy="0 0 0" xyz="0 0 0.13175"/>
            </visual>

            <collision>
                <geometry>
                    <cylinder length="0.2385" radius="0.0295"/>
                </geometry>
                <origin rpy="0 0 0" xyz="0 0 0.13175"/>
            </collision>   

    </link>


    <!--joint between base and link0-->

    <joint name="base_to_link0" type="fixed">
        <origin xyz="0 0 0" rpy="0 0 0" />
        <axis xyz="0 0 0" />
            <parent link="base"/>
            <child link="link_0"/>
    </joint>


    <!--link_1-->

    <link name="link_1">

        <inertial>
                <mass value="10" />
            <inertia ixx="0.13" iyy="0.524" izz="0.539" ixy="0" ixz="0" iyz="0" />
            </inertial>

            <visual>
                <geometry>
                    <cylinder length="0.103" radius="0.0295"/>
                </geometry>
                <material name="Black">
                    <color rgba="0 0 0 1"/>
                </material>
                <origin rpy="0 -1.57079 1.57079" xyz="0 0.022 0.2805"/>
            </visual>

            <collision>
                <geometry>
                    <cylinder length="0.103" radius="0.0295"/>
                </geometry>
                <origin rpy="0 -1.57079 1.57079" xyz="0 0.022 0.2805"/>
            </collision>  

    </link>


    <!--joint between link0 and link1-->

    <joint name="link0_to_link1" type="revolute">
            <limit effort="30" velocity="1.0" lower="-2.792526" upper="2.792526"/>
            <axis xyz="0 0 1"/>
            <parent link="link_0"/>
            <child link="link_1"/>
    </joint>


    <!--link_2-->

    <link name="link_2">

            <inertial>
                <mass value="17.4" />
                <inertia ixx="0.13" iyy="0.524" izz="0.539" ixy="0" ixz="0" iyz="0" />
            </inertial>

            <visual>
                <geometry>
                    <box size="0.059 0.209 0.079"/>
                </geometry>
                <material name="Orange">
                    <color rgba="1 0.4 0 1"/>
                </material>
                <origin rpy="0 0 -1.57079" xyz="0.054 0 0"/>
            </visual>

            <collision>
                <geometry>
                    <box size="0.059 0.209 0.079"/>
                </geometry>
                <origin rpy="0 0 -1.57079" xyz="0.054 0 0"/>
            </collision>    

    </link>


    <!--joint between link1 and link2-->

    <joint name="link1_to_link2" type="revolute">
            <limit effort="30" velocity="1.0" lower="-3.906056" upper="0.79"/>
            <axis xyz="0 1 0"/>
            <origin xyz="0 0.092 0.2805"/>
            <parent link="link_1"/>
            <child link="link_2"/>
    </joint>


    <!--link_3-->

    <link name="link_3">

            <inertial>
                <mass value="4.8" />
                <inertia ixx="0.066" iyy="0.0125" izz="0.086" ixy="0" ixz="0" iyz="0" />
            </inertial>

            <visual>
                <geometry>
                    <box size="0.032 0.184 0.032"/>
                </geometry>
                <material name="Black">
                    <color rgba="0 0 0 1"/>
                </material>
                <origin rpy="0 0 -1.57079" xyz="0.0425 0 0"/>
            </visual>

            <collision>
                <geometry>
                    <box size="0.032 0.184 0.032"/>
                </geometry>
                <origin rpy="0 0 -1.57079" xyz="0.0425 0 0"/>
            </collision>    

    </link>


    <!--joint between link2 and link3-->

    <joint name="link2_to_link3" type="revolute">
            <limit effort="30" velocity="1.0" lower="-2.79" upper="0.79"/>
            <axis xyz="0 1 0"/>
            <origin xyz="0.1725 -0.045 0"/>
            <parent link="link_2"/>
            <child link="link_3"/>
    </joint>


    <!--link_4-->

    <link name="link_4">

            <inertial>
                <mass value="0.82" />
                <inertia ixx="0.0018" iyy="0.0018" izz="0.0013" ixy="0" ixz="0" iyz="0" />
            </inertial>

            <visual>
                <geometry>
                    <box size="0.032 0.007 0.032"/>
                </geometry>
                <material name="Orange">
                    <color rgba="1 0.4 0 1"/>
                </material>
                <origin rpy="0 0 -1.57079" xyz="0.019 0 0"/>
            </visual>

            <collision>
                <geometry>
                    <box size="0.032 0.007 0.032"/>
                </geometry>
                <origin rpy="0 0 -1.57079" xyz="0.019 0 0"/>
            </collision>  

    </link>


    <!--joint between link3 and link4-->

    <joint name="link3_to_link4" type="revolute">
            <limit effort="30" velocity="1.0" lower="-1.919862" upper="2.96705"/>
            <axis xyz="1 0 0"/>
            <origin xyz="0.119 0 0"/>
            <parent link="link_3"/>
            <child link="link_4"/>
    </joint>


    <!--link_5-->

    <link name="link_5">

            <inertial>
                <mass value="0.34" />
                <inertia ixx="0.0003" iyy="0.0003" izz="0.0004" ixy="0" ixz="0" iyz="0" />
            </inertial>

            <visual>
                <geometry>
                    <cylinder length="0.032" radius="0.0095"/>
                </geometry>
                <material name="Black">
                    <color rgba="0 0 0 1"/>
                </material>
                <origin rpy="1.57079 0 0" xyz="-0.00015 0 0"/>
            </visual>

            <collision>
                <geometry>
                    <cylinder length="0.032" radius="0.0095"/>
                </geometry>
                <origin rpy="1.57079 0 0" xyz="-0.00015 0 0"/>
            </collision>    

    </link>


    <!--joint between link4 and link5-->

    <joint name="link4_to_link5" type="revolute">
            <limit effort="30" velocity="1.0" lower="-1.195329" upper="1.195329"/>
            <axis xyz="0 1 0"/>
            <origin xyz="0.0323 0 0"/>
            <parent link="link_4"/>
            <child link="link_5"/>
    </joint>


    <!--link_6-->

    <link name="link_6">

            <inertial>
                <mass value="0.09" />
                <inertia ixx="0.00015" iyy="0.00015" izz="0.00004" ixy="0" ixz="0" iyz="0" />
            </inertial>

            <visual>
                <geometry>
                    <box size="0.0055 0.032 0.0155"/>
                </geometry>
                <material name="Orange">
                    <color rgba="1 0.4 0 1"/>
                </material>
                <origin rpy="1.57079 0 0" xyz="0.0043 0 0"/>
            </visual>

            <collision>
                <geometry>
                    <box size="0.0055 0.032 0.0155"/>
                </geometry>
                <origin rpy="1.57079 0 0" xyz="0.0043 0 0"/>
            </collision>    

    </link>


    <!--joint between link5 and link6-->

    <joint name="link5_to_link6" type="revolute">
            <limit effort="30" velocity="1.0" lower="-0.6" upper="0.6"/>
            <axis xyz="1 0 0"/>
            <origin xyz="0.0076 0 0"/>
            <parent link="link_5"/>
            <child link="link_6"/>
    </joint>


    <!--ext1_link_6-->

    <link name="ext1_link_6">

            <inertial>
                <mass value="0.09" />
                <inertia ixx="0.00015" iyy="0.00015" izz="0.00004" ixy="0" ixz="0" iyz="0" />
            </inertial>

            <visual>
                <geometry>
                    <box size="0.012 0.005 0.0155"/>
                </geometry>
                <material name="Orange">
                    <color rgba="1 0.4 0 1"/>
                </material>
                <origin rpy="1.57079 0 0" xyz="0.0043 0 0"/>
            </visual>

            <collision>
                <geometry>
                    <box size="0.012 0.005 0.0155"/>
                </geometry>
                <origin rpy="1.57079 0 0" xyz="0.0043 0 0"/>
            </collision>    

    </link>


    <!--joint between link6 and ext1link6-->

    <joint name="link6_to_ext1link6" type="fixed">
            <axis xyz="1 0 0"/>
            <origin xyz="0.0087 0 -0.01375"/>
            <parent link="link_6"/>
            <child link="ext1_link_6"/>
    </joint>


    <!--ext2_link_6-->

    <link name="ext2_link_6">

            <inertial>
                <mass value="0.09" />
                <inertia ixx="0.00015" iyy="0.00015" izz="0.00004" ixy="0" ixz="0" iyz="0" />
            </inertial>

            <visual>
                <geometry>
                    <box size="0.012 0.005 0.0155"/>
                </geometry>
                <material name="Orange">
                    <color rgba="1 0.4 0 1"/>
                </material>
                <origin rpy="1.57079 0 0" xyz="0.0043 0 0"/>
            </visual>

            <collision>
                <geometry>
                    <box size="0.012 0.005 0.0155"/>
                </geometry>
                <origin rpy="1.57079 0 0" xyz="0.0043 0 0"/>
            </collision>    

    </link>


    <!--joint between link6 and ext2link6-->

    <joint name="link6_to_ext2link6" type="fixed">
            <axis xyz="1 0 0"/>
            <origin xyz="0.0087 0 0.01375"/>
            <parent link="link_6"/>
            <child link="ext2_link_6"/>
    </joint>


    <!--transmission elements for each joint-->

    <transmission name="tran1">
            <type>transmission_interface/SimpleTransmission</type>
            <joint name="link0_to_link1"/>
            <actuator name="motor1">
                <hardwareInterface>EffortJointInterface</hardwareInterface>
                <mechanicalReduction>1</mechanicalReduction>
            </actuator>
    </transmission>

    <transmission name="tran2">
            <type>transmission_interface/SimpleTransmission</type>
            <joint name="link1_to_link2"/>
            <actuator name="motor2">
                <hardwareInterface>EffortJointInterface</hardwareInterface>
                <mechanicalReduction>10000</mechanicalReduction>
            </actuator>
    </transmission>

    <transmission name="tran3">
            <type>transmission_interface/SimpleTransmission</type>
            <joint name="link2_to_link3"/>
            <actuator name="motor3">
                <hardwareInterface>EffortJointInterface</hardwareInterface>
                <mechanicalReduction>1</mechanicalReduction>
            </actuator>
    </transmission>

    <transmission name="tran4">
            <type>transmission_interface/SimpleTransmission</type>
            <joint name="link3_to_link4"/>
            <actuator name="motor4">
                <hardwareInterface>EffortJointInterface</hardwareInterface>
                <mechanicalReduction>1</mechanicalReduction>
            </actuator>
    </transmission>

    <transmission name="tran5">
            <type>transmission_interface/SimpleTransmission</type>
            <joint name="link4_to_link5"/>
            <actuator name="motor5">
                <hardwareInterface>EffortJointInterface</hardwareInterface>
                <mechanicalReduction>1</mechanicalReduction>
            </actuator>
    </transmission>

    <transmission name="tran6">
            <type>transmission_interface/SimpleTransmission</type>
            <joint name="link5_to_link6"/>
            <actuator name="motor6">
                <hardwareInterface>EffortJointInterface</hardwareInterface>
                <mechanicalReduction>0.01</mechanicalReduction>
            </actuator>
    </transmission>


    <!--gazebo plugin for gazebo_ros_control-->

    <gazebo>
        <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
                <robotNamespace>/testbot</robotNamespace>
        </plugin>
    </gazebo>

    <gazebo>
        <plugin name="gazebo_ros_joint_trajectory" filename="libgazebo_ros_joint_trajectory.so">
<topicName>joint_trajectory</topicName>
                <robotNamespace>/testbot</robotNamespace>
        </plugin>
    </gazebo>



    <gazebo reference="pform">
            <material>Gazebo/Orange</material>
    </gazebo>

    <gazebo reference="base">
            <material>Gazebo/Black</material>
    </gazebo>

    <gazebo reference="link_0">
            <material>Gazebo/Orange</material>
    </gazebo>

    <gazebo reference="link_1">
            <material>Gazebo/Black</material>
    </gazebo>

    <gazebo reference="link_2">
            <material>Gazebo/Orange</material>
    </gazebo>

    <gazebo reference="link_3">
            <material>Gazebo/Black</material>
    </gazebo>

    <gazebo reference="link_4">
            <material>Gazebo/Orange</material>
    </gazebo>

    <gazebo reference="link_5">
            <material>Gazebo/Black</material>
    </gazebo>

    <gazebo reference="link_6">
            <material>Gazebo/Orange</material>
    </gazebo>


</robot>