1
$\begingroup$

I'm launching empty_world copied into my package with the command roslaunch my_package empty_world.launch.

Here is empty_world.launch:

<launch>

  <!-- these are the arguments you can pass this launch file, for example paused:=true -->
  <arg name="paused" default="false"/>
  <arg name="use_sim_time" default="true"/>
  <arg name="extra_gazebo_args" default=""/>
  <arg name="gui" default="true"/>
  <arg name="recording" default="false"/>
  <!-- Note that 'headless' is currently non-functional.  See gazebo_ros_pkgs issue #491 (-r arg does not disable
       rendering, but instead enables recording). The arg definition has been left here to prevent breaking downstream
       launch files, but it does nothing. -->
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>
  <arg name="physics" default="ode"/>
  <arg name="verbose" default="false"/>
  <arg name="world_name" default="worlds/empty.world"/> <!-- Note: the world_name is with respect to GAZEBO_RESOURCE_PATH environmental variable -->
  <arg name="respawn_gazebo" default="false"/>
  <arg name="use_clock_frequency" default="false"/>
  <arg name="pub_clock_frequency" default="100"/>
  <arg name="enable_ros_network" default="true" />

  <!-- set use_sim_time flag -->
  <param name="/use_sim_time" value="$(arg use_sim_time)"/>

  <!-- set command arguments -->
  <arg unless="$(arg paused)" name="command_arg1" value=""/>
  <arg     if="$(arg paused)" name="command_arg1" value="-u"/>
  <arg unless="$(arg recording)" name="command_arg2" value=""/>
  <arg     if="$(arg recording)" name="command_arg2" value="-r"/>
  <arg unless="$(arg verbose)" name="command_arg3" value=""/>
  <arg     if="$(arg verbose)" name="command_arg3" value="--verbose"/>
  <arg unless="$(arg debug)" name="script_type" value="gzserver"/>
  <arg     if="$(arg debug)" name="script_type" value="debug"/>

  <!-- start gazebo server-->
  <group if="$(arg use_clock_frequency)">
    <param name="gazebo/pub_clock_frequency" value="$(arg pub_clock_frequency)" />
  </group>
  <group>
    <param name="gazebo/enable_ros_network" value="$(arg enable_ros_network)" />
  </group>
  <node name="gazebo" pkg="gazebo_ros" type="$(arg script_type)" respawn="$(arg respawn_gazebo)" output="screen"
	args="$(arg command_arg1) $(arg command_arg2) $(arg command_arg3) -e $(arg physics) $(arg extra_gazebo_args) $(arg world_name)" />

  <!-- start gazebo client -->
  <group if="$(arg gui)">
    <node name="gazebo_gui" pkg="gazebo_ros" type="gzclient" respawn="false" output="screen" args="$(arg command_arg3)"/>
  </group>

</launch>

Here is empty.world:

<?xml version="1.0" ?>
<sdf version="1.5">
  <world name="default">
    <!-- A global light source -->
    <include>
      <uri>model://sun</uri>
    </include>
    <!-- A ground plane -->
    <include>
      <uri>model://ground_plane</uri>
    </include>
  </world>
</sdf>

The error message it gives:

[gazebo-1] process has died [pid 32294, exit code 255, cmd /opt/ros/melodic/lib/gazebo_ros/gzserver -e ode worlds/empty.world __name:=gazebo __log:=/home/me/.ros/log/9b2ef8a4-5652-11e9-90dd-fcaa1429a868/gazebo-1.log].
log file: /home/me/.ros/log/9b2ef8a4-5652-11e9-90dd-fcaa1429a868/gazebo-1*.log

This is based on my StackOverflow thread but hopefully more useful by removing my specific code from the question, making it clear that it is a configuration issue of some sort.

$\endgroup$

closed as off-topic by Mark Booth Apr 5 at 11:24

If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    $\begingroup$ @MarkBooth It's actually not the same question -- it's two different world files and two different launch files. I think this is the more useful of the two questions, personally. $\endgroup$ – Charles Apr 5 at 12:03
  • $\begingroup$ A question is considered a duplicate if the answer to one would be the same as the answer to the other, so I think in this case, even though you are asking a slightly different question, they are duplicates. I would suggest adding the extra information to your other question, which is now on robotics. $\endgroup$ – Mark Booth Apr 8 at 10:11

Browse other questions tagged or ask your own question.