ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Gazebo not loading certain links

asked 2019-02-08 18:29:30 -0500

Robot00 gravatar image

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>
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-02-11 05:30:48 -0500

Delb gravatar image

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.

edit flag offensive delete link more

Comments

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

Mehdi. gravatar image Mehdi.  ( 2019-02-11 06:17:05 -0500 )edit

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>
Robot00 gravatar image Robot00  ( 2019-02-15 17:23:48 -0500 )edit

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

Delb gravatar image Delb  ( 2019-02-18 01:05:25 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2019-02-08 18:29:30 -0500

Seen: 1,694 times

Last updated: Feb 11 '19