ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
3

Need spooky lighting in gazebo

asked 2011-07-19 09:56:28 -0600

andrew-unit gravatar image

updated 2011-07-19 10:15:19 -0600

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/br... , 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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2011-09-07 05:46:28 -0600

nkoenig gravatar image

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"/>
</light>

if you are using Diamondback or Electric:

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

  <light>
    <type>spot</type>
    <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>
    <range>5</range>
    <spotCone>8.0 10.0 2.0</spotCone> 
  </light>
</model:renderable>
edit flag offensive delete link more

Question Tools

Stats

Asked: 2011-07-19 09:56:28 -0600

Seen: 731 times

Last updated: Sep 07 '11