Gazebo 7 launching error

asked 2017-05-22 09:40:40 -0500

SorinV gravatar image

updated 2017-05-24 02:12:54 -0500

Almost every time I run gazebo I get this error.

 terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::lock_error> >'
  what():  boost: mutex lock failed in pthread_mutex_lock: Invalid argument
Aborted (core dumped)

I have to run it multiple times to get it working. To note that I run it with an empty world, and I spawn a robot in it.

Code for reference:


  <!-- 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="gui" default="true"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>
  <arg name="model" default="$(find my_package)/urdf/atlas.xacro"/>

  <!-- We resume the logic in empty_world.launch, changing only the name of the world to be launched -->
  <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)"/>

  <param name="robot_description" command="$(find xacro)/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" />


UPDATE 1 The problem appears when I launch with control parameters. I am using a diff controller to control 2 wheels just for testing and a prism joint that I control also.

UPDATE 2 When spawning without control also. Regards

edit retag flag offensive close merge delete


So when you launch the empty world it doesn't crash, but it crashes after the robot is spawned?

chapulina gravatar imagechapulina ( 2017-05-22 09:53:59 -0500 )edit

Thank you for the reply. The error does not have a measurable recurrency. But yes, sometimes it crashes like so at startup. For roslaunch gazebo_ros empty_world.launch it works fine. But stil get libGL error: failed to create drawable libGL error: failed to create drawable but this may just be a driver problem. To respond to your question, It crashes while launching Gazebo, waiting indefinitely for the mutex.

SorinV gravatar imageSorinV ( 2017-05-23 04:06:20 -0500 )edit