Robotics StackExchange | Archived questions

Gazebo not loading certain links

The urdf was loading just fine before, but I am trying to add an arm and those links will not load. All parts load in rviz, but not in gazebo. I have tripple checked the syntax, but I can not find an issue. This is the urdf for those parts

<joint name="arm_joint" type="continuous">
    <parent link="base_link"/>
    <child link="arm_link"/>
    <origin xyz="${base_length/2} 0 ${base_height/2}" rpy="0 0 0"/>
    <dynamics damping="0.5" friction="0.1"/> <!-- get real later-->
    <limit effort="1000" velocity="10"/> <!-- simmulate motors, max velocity and max joint effort -->
    <axis xyz="0 1 0"/> <!-- will rotate for y axis -->
</joint>

<link name="arm_link">
    <visual>
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <geometry>
            <box size="${arm_length} ${arm_width} ${arm_height}"/>
        </geometry>
        <material name="orange"/>
    </visual>

    <collision>
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <geometry>
            <box size="${arm_length} ${arm_width} ${arm_height}"/>
        </geometry>
    </collision>

    <inertia>
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <mass value="${arm_mass}"/>
        <box_inertial_matrix m="${arm_mass}" h="${arm_height}" l="${arm_length}" w="${arm_width}" />
    </inertia>
</link>

<joint name="digr_joint" type="continuous">
    <parent link="arm_link"/>
    <child link="digr_link"/>
    <origin xyz="${arm_length/2} 0 0" rpy="0 0 0"/>
    <dynamics damping="0.5" friction="0.1"/> <!-- get real later-->
    <limit effort="1000" velocity="10"/> <!-- simmulate motors, max velocity and max joint effort -->
    <axis xyz="0 1 0"/> <!-- will rotate for y axis -->
</joint>

<link name="digr_link">
    <visual>
        <origin xyz="0 0 0" rpy="${PI/2} 0 0"/>
        <geometry>
            <cylinder length="${digr_height}" radius="${digr_radius}" />
        </geometry>
        <material name="purple"/>
    </visual>

    <collision>
        <origin xyz="0 0 0" rpy="${PI/2} 0 0"/>
        <geometry>
                <cylinder length="${digr_height}" radius="${digr_radius}" />
        </geometry>
    </collision>

    <inertia>
        <origin xyz="0 0 0" rpy="${PI/2} 0 0"/>
        <mass value="${digr_mass}"/>
        <cylinder_inertia m="${digr_mass}" h="${digr_height}" r="${digr_radius}"/>
    </inertia>
</link>

and this is the .gazebo

    <gazebo reference="arm_link">
    <material>Gazebo/Orange</material>
    <mu1>0.3</mu1>
    <mu2>0.3</mu2>
</gazebo>

<gazebo reference="digr_link">
    <material>Gazebo/Purple</material>
    <mu1>0.3</mu1>
    <mu2>0.3</mu2>
</gazebo>

Asked by Robot00 on 2019-02-08 19:29:30 UTC

Comments

Answers

You need the inertial tag to properly load a model in Gazebo (but not for rivz, that's why you are able to visulaize the urdf with rviz), there is typos in your code : instead of inertial you wrote inertia. Also the cylinder_inertia or box_inertial_matrix don't exist, check the wiki to see the elements inside the inertial tag.

Asked by Delb on 2019-02-11 06:30:48 UTC

Comments

I'm pretty sure he has those defined as macros somewhere

Asked by Mehdi. on 2019-02-11 07:17:05 UTC

I have macros for those

    <xacro:macro name="box_inertial_matrix" params="m l w h">
    <inertia ixx="${(m*(w*w+h*h))/12.0}" ixy = "0.0" ixz = "0.0"
             iyy="${(m*(l*l+h*h))/12.0}" iyz = "0.0"
             izz="${(m*(l*l+w*w))/12.0}" />
</xacro:macro>

Asked by Robot00 on 2019-02-15 18:23:48 UTC

Okay so your macros are correct. Is it working now after replacing inertia by inertial ? (not in the macros)

Asked by Delb on 2019-02-18 02:05:25 UTC