Robotics StackExchange | Archived questions

Definition of multiple light sources in a world file

Hi guys,

i need to include multiple light sources in my world file. By adding the default sun model in .gazebo/models as well as a manual defined directional light gazebo (v 2.2.3) crashes (for code see below).

<!-- global light source -->
<include>
  <uri>model://sun</uri>
</include>
<!-- Additional light -->
<light type="directional" name="my_light">
    <origin pose="0 0 30 0 0 0"/>
    <diffuse rgba=".9 .9 .9 1"/>
    <specular rgba=".1 .1 .1 1"/>
    <attenuation range="20"/>
    <direction xyz="0 0 -1"/>
</light>

This snippet causes the following error:

gzserver: /usr/include/boost/thread/pthread/recursivemutex.hpp:101: boost::recursivemutex::~recursivemutex(): Assertion `!pthreadmutex_destroy(&m)' failed.

Are there any example worlds with (different) multiple light sources available?

Best regards!

Asked by Illuminatur on 2015-12-09 12:34:43 UTC

Comments

Answers

There's an example world from gazebo 3 which contains many lights, but only one of them is directional.

Have you run gazebo in verbose mode to see if you get any errors? The <origin> tag for example seems not to be part of SDF, so you should see a warning like:

XML Element[origin], child of element[light] not defined in SDF. Ignoring[origin]. You may have an incorrect SDF file, or an sdformat version that doesn't support this element.

Another thing you can look at are the previous versions of the sun model.

In any case, if the problem is wrong SDF, Gazebo shouldn't crash. I suggest ticketing an issue for that.

Asked by chapulina on 2015-12-09 13:14:08 UTC

Comments