gazebo not opening when using model:// [closed]

asked 2021-05-21 04:41:15 -0500

orensaldanha gravatar image

updated 2021-05-28 07:40:17 -0500

ROS Noetic Gazebo doesnt open when I use the sdf:

<?xml version="1.0"?>
<sdf version="1.4">
    <world name="myworld">
        <include>
            <uri> model://sun </uri>
        </include>

        <include>
            <uri> model://ground_plane </uri>
        </include>


        <include>
            <uri> model://cabinet </uri>
            <pose>12 13 0 0 0 0</pose>
            <static>true</static>
        </include>

        <include>
            <uri> model://postbox </uri>
            <pose>15 -10 0 0 0 0 </pose>
            <static>true</static>
        </include>

    </world>
</sdf>

It works when I comment the cabinet and postbox model

<?xml version="1.0"?>
<sdf version="1.4">
    <world name="myworld">
        <include>
            <uri> model://sun </uri>
        </include>

        <include>
            <uri> model://ground_plane </uri>
        </include>

    <!--
        <include>
            <uri> model://cabinet </uri>
            <pose>12 13 0 0 0 0</pose>
            <static>true</static>
        </include>

        <include>
            <uri> model://postbox </uri>
            <pose>15 -10 0 0 0 0 </pose>
            <static>true</static>
        </include>
    -->
    </world>
</sdf>

Launch file:

<launch>

    <arg name="world" default="empty" />
    <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" />

    <include file="$(find gazebo_ros)/launch/empty_world.launch">
        <arg name="world_name" value="$(find obot_gazebo)/worlds/obot.world"/>
        <arg name="paused" value="$(arg paused)" />
        <arg name="use_sim_time" value="$(arg use_sim_time)" />
        <arg name="gui" value="$(arg gui)" />
        <arg name="headless" value="$(arg headless)" />
        <arg name="debug" value="$(arg debug)" />
    </include>

    <param name="robot_description" command="$(find xacro)/xacro '$(find obot_description)/urdf/obot.xacro'" />

    <node name="obot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen" args="-urdf -param robot_description -model obot" />

    <include file="$(find obot_control)/launch/obot_control.launch" />

</launch>

Command line output:

[ WARN] [1621663016.642603789]: link 'caster_wheel' material 'red' undefined.
[ WARN] [1621663016.643914257]: link 'caster_wheel' material 'red' undefined.
[ WARN] [1621663016.644428765]: The root link chassis has an inertia specified in the URDF, but KDL does not support a root link with an inertia.  As a workaround, you can add an extra dummy link to your URDF.
[INFO] [1621663016.927299, 0.000000]: Controller Spawner: Waiting for service controller_manager/load_controller
[INFO] [1621663016.950044, 0.000000]: Loading model XML from ros parameter robot_description
[INFO] [1621663016.954453, 0.000000]: Waiting for service /gazebo/spawn_urdf_model
[ INFO] [1621663017.083933641]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1621663017.086121922]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[ INFO] [1621663017.188760220]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1621663017.190537705]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting...
^C[robot_state_publisher-6] killing on exit
[obot/controller_spawner-5] killing on exit
[obot_spawn-4] killing on exit
[gazebo_gui-3] killing on exit
[gazebo-2] killing on exit
[WARN] [1621663045.381504, 0.000000]: Controller Spawner couldn't find the expected controller_manager ROS interface.
Traceback (most recent call last):
  File "/opt/ros/noetic/lib/gazebo_ros/spawn_model", line 239, in <module>
    exit_code = sm.run()
  File "/opt/ros/noetic/lib/gazebo_ros/spawn_model", line 183, in run
    success = gazebo_interface.spawn_urdf_model_client(self.args.model, model_xml, self.args.robot_namespace,
  File "/opt/ros/noetic/lib/python3/dist-packages/gazebo_ros/gazebo_interface.py", line 28, in spawn_urdf_model_client
    rospy.wait_for_service(gazebo_namespace+'/spawn_urdf_model')
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_service.py", line 166, in wait_for_service
    raise ROSInterruptException("rospy shutdown ...
(more)
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by orensaldanha
close date 2021-06-02 11:24:02.065673

Comments

Any useful output from the command?

Jose Luis Rivero gravatar imageJose Luis Rivero ( 2021-05-21 10:15:51 -0500 )edit

I have added the command line output to the question

orensaldanha gravatar imageorensaldanha ( 2021-05-22 01:00:33 -0500 )edit

don't see anything useful. What happen if your run gazebo --verbose <your_world_file> ?

Jose Luis Rivero gravatar imageJose Luis Rivero ( 2021-05-25 14:15:41 -0500 )edit

Same issue when I run gazebo with just the world file

orensaldanha gravatar imageorensaldanha ( 2021-05-25 19:55:17 -0500 )edit

could you please add the output of plain gazebo --verbose <world> to the issue?

Jose Luis Rivero gravatar imageJose Luis Rivero ( 2021-05-28 07:09:53 -0500 )edit

I have added the output

orensaldanha gravatar imageorensaldanha ( 2021-05-28 07:40:48 -0500 )edit
1

I checked the turtlebot3 simulations, I couldnt launch the turtlebot3_house as well. So I decided to reinstall ros and gazebo. Its working now.

orensaldanha gravatar imageorensaldanha ( 2021-06-02 11:23:21 -0500 )edit