Ask Your Question
0

Gazebo Launches Empty

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

CoachAllen 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:

<launch>

    <!-- 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)"/>
    </include>

    <!-- This is set with code from line 4 -->
    <param name="robot_description" command="$(find xacro)/xacro.py $(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" />
    </node>

</launch>

My basic_geometry_pig.urdf.xacro file:

<?xml version="1.0"?>

<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="basic_geometry_pig">

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

    <!-- 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">
        <inertial>
            <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"/>
        </inertial>
        <visual>
            <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
            <geometry>
                <box size="${length} ${width} ${height}"/>
            </geometry>
            <material name="blue"/>
        </visual>

        <gazebo reference="base_link">
            <material>Gazebo/Black</material>
        </gazebo>
    </link>

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

Comments

Chirp Chirp

CoachAllen gravatar imageCoachAllen ( 2020-01-26 20:50:19 -0600 )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 imageCoachAllen ( 2020-01-26 20:59:21 -0600 )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 imageCoachAllen ( 2020-01-26 21:00:21 -0600 )edit

None of the other links are showing in the tree.

CoachAllen gravatar imageCoachAllen ( 2020-01-26 21:00:41 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

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

Delb gravatar image

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

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

Comments

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 answers.gazebosim.org account.

Cheers,

CoachAllen gravatar imageCoachAllen ( 2020-01-28 09:59:11 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

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

Seen: 23 times

Last updated: Jan 27