Rosanswers logo

Hello, I'm trying to make a spooky scene in gazebo, but I can't figure out how to add spot lights in gazebo world files. I can't seem to find a good example. I see some old examples from, for example, https://kforge.ros.org/gazebo/trac/browser/worlds/lights.world , but all of the spot light examples are commented out. I'm trying to build a spot light that is about 3 meters off the ground and ends up casting a cone of light that is about 1 meter or less in diameter on the floor. Any suggestions would be appreciated.

Originally posted by andrew-unit on ROS Answers with karma: 283 on 2011-07-19

Post score: 3


1 Answer 1


Rosanswers logo

If you are using the unstable version of gazebo:

<light type="spot" name="spot" cast_shadows="false">
  <origin pose="0 0 3 0 0 0"/>
  <diffuse rgba="0 1 0 1"/>
  <specular rgba=".2 .2 .2 1"/>
  <attenuation range="10" constant="0.2" linear="0.01" quadratic="0.0"/>
  <direction xyz="0 0 -1"/>
  <spot inner_angle="0.1" outer_angle="0.5" falloff="1.2"/>

if you are using Diamondback or Electric:

<model:renderable name="spot">
  <xyz>0.0 0 3</xyz>

    <direction>0 0 -1</direction>
    <diffuseColor>0.0 0.0 1.0</diffuseColor>
    <specularColor>0.0 0.0 0.1</specularColor>
    <attenuation>.1 0.0 0.0</attenuation>
    <spotCone>8.0 10.0 2.0</spotCone> 

Originally posted by nkoenig with karma: 431 on 2011-09-07

This answer was ACCEPTED on the original site

Post score: 2


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.