Gazebo | Ignition | Community
Ask Your Question
0

Definition of multiple light sources in a world file

asked 2015-12-09 11:34:43 -0500

Illuminatur gravatar image

updated 2015-12-09 11:38:49 -0500

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/recursive_mutex.hpp:101: boost::recursive_mutex::~recursive_mutex(): Assertion `!pthread_mutex_destroy(&m)' failed.

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

Best regards!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-12-09 12:14:08 -0500

chapulina gravatar image

updated 2015-12-09 12:15:38 -0500

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.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-12-09 11:34:43 -0500

Seen: 1,461 times

Last updated: Dec 09 '15