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

Gazebo Launches Empty

asked 2020-01-26 18:11:03 -0500

CoachAllen gravatar image

updated 2022-01-22 16:10:17 -0500

Evgeny gravatar image

I've been following the URDF/XACRO tutorials and I've run into an issue. When I launch Gazebo the model never shows up.

  • Ubuntu 18.04
  • ROS Melodic

My gazebo.launch file:


    <!-- This will load Basic_Geometry_Pig as the URDF model -->
    <arg name="model" default="$(find little_pig_atv)/basic_geometry_pig.urdf.xacro"/>

    <!-- Setting some default args to start Gazebo with -->
    <arg name="paused" default="false"/>
    <arg name="use_sim_time" default="true"/>
    <arg name="gui" default="true"/>
    <arg name="headless" default="false"/>
    <arg name="debug" default="false"/>

    <!-- Load an empty Gazebo world with the args above -->
    <include file="$(find gazebo_ros)/launch/empty_world.launch">
        <arg name="debug" value="$(arg debug)" />
        <arg name="gui" value="$(arg gui)" />
        <arg name="paused" value="$(arg paused)"/>
        <arg name="use_sim_time" value="$(arg use_sim_time)"/>
        <arg name="headless" value="$(arg headless)"/>

    <!-- This is set with code from line 4 -->
    <param name="robot_description" command="$(find xacro)/ $(arg model)" />

    <!-- push robot_description to factory and spawn robot in gazebo -->
    <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model" args="-z 1.0 -unpause -urdf -model robot -param robot_description" respawn="false" output="screen" />

    <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher">
        <param name="publish_frequency" type="double" value="30.0" />


My basic_geometry_pig.urdf.xacro file:

<?xml version="1.0"?>

<robot xmlns:xacro="" name="basic_geometry_pig">

    <!-- Some color definitions for the URDF Robot -->
    <material name="blue">
        <color rgba="0 0 0.8 1"/>
    <material name="black">
        <color rgba="0 0 0 1"/>

    <!-- Basic Geometry of Body -->
    <xacro:property name="width" value="0.680618" />
    <xacro:property name="height" value="1.065022" />
    <xacro:property name="length" value="1.91" />

    <!-- The Ackerman Steering Hub -->
    <xacro:property name="ackerman_joint_diameter" value="0.09" />
    <xacro:property name="ackerman_joint_width" value="0.09" />

    <!-- Wheel Properties -->
    <xacro:property name="front_wheel_width" value=".254" />
    <xacro:property name="front_wheel_diameter" value="0.5588" />
    <xacro:property name="rear_wheel_width" value="0.2794" />
    <xacro:property name="rear_wheel_diameter" value="0.6096" />

    <link name="base_link">
            <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
            <mass value="49.8952"/>
            <inertia ixx="11.48" ixy="10.52" ixz="1.737" iyy="1.737" iyz="11.48" izz="10.52"/>
            <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
                <box size="${length} ${width} ${height}"/>
            <material name="blue"/>

        <gazebo reference="base_link">

    <!-- Ackerman Steering Macro -->
    <xacro:macro name="ackerman_steering" params="suffix reflect">
        <link name="${suffix}_ackerman_component">
                <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
                <mass value="0 ...
edit retag flag offensive close merge delete


Chirp Chirp

CoachAllen gravatar image CoachAllen  ( 2020-01-26 20:50:19 -0500 )edit

After examination in the Gazebo UI, I am seeing that the folder in which my urdf.xacro model is there. I see the base_link tree on the left. I am not seeing any robot pieces in the 3D world though.

CoachAllen gravatar image CoachAllen  ( 2020-01-26 20:59:21 -0500 )edit

Topic [//home/coach/catkin_ws/src/little_pig_atv/urdf/basic_geometry_pig.urdf.xacro/base_link/joint_cmd] is not valid.

CoachAllen gravatar image CoachAllen  ( 2020-01-26 21:00:21 -0500 )edit

None of the other links are showing in the tree.

CoachAllen gravatar image CoachAllen  ( 2020-01-26 21:00:41 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2020-01-27 02:42:23 -0500

Delb gravatar image

updated 2020-01-27 02:43:39 -0500

There are a few things you have to modify to get things working :

  1. In the link base_link you should have a tag collision because it's a required tag.
  2. Not sure if it's a typo but :

     <arg name="model" default="$(find little_pig_atv)/basic_geometry_pig.urdf.xacro"/>

    It looks like it's missing the folder /urdf/ as your comment suggest.

  3. I could reproduced the same issue with your urdf and changing the inertial data (I simply copied the inertial data from the base link and applied to all the other links but you should calculate the propper value for each link) and I got the robot in Gazebo.

edit flag offensive delete link more


Thank you Delb. I got it loaded in Gazebo last night. Only, now I have to figure this controller concept now. The model just sort of rocks back and forth...

My question for this controller is now waiting for approval on my newly minted account.


CoachAllen gravatar image CoachAllen  ( 2020-01-28 09:59:11 -0500 )edit

Question Tools



Asked: 2020-01-26 18:11:03 -0500

Seen: 1,025 times

Last updated: Jan 27 '20