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

Adding lights in Gazebo world

asked 2012-07-11 02:21:48 -0500

prasanna.kumar gravatar image

updated 2012-07-11 02:27:17 -0500

Hi, I have created the model of a house in gazebo with furniture and doors. Now I would like to add lights to the environment. That is by calling a service I want to switch on and off the light. Going by the tutorials I created a model file

<?xml version="1.0" ?>
<model:renderable xmlns:gazebo="" xmlns:model="" xmlns:sensor="" xmlns:body="" xmlns:geom="" xmlns:joint="" xmlns:controller="" xmlns:interface="" xmlns:rendering="" xmlns:physics="" xmlns:renderable="" name="light_model">
  <xyz>10 10 2</xyz>
      <diffuseColor>0.8 0.8 0.8</diffuseColor>
      <specularColor>.4 .4 .4</specularColor>
      <attenuation>0.2 0.1 0</attenuation>

I saved this as light.model and I tried to spawn this light model by using

rosrun gazebo spawn_model -file `rospack find angen_gazebo`/objects/light.model -gazebo -model light -x 1 -y 1 -z 2

but I get the following error

[ERROR] [1342008109.535068231, 576.982000000]: GazeboROSNode SpawnModel Failure: input model_xml not Gazebo XML, or cannot be converted to Gazebo XML

I am not able to understand the error. Please help me with this or Is there any other way to control the lights in a gazebo environment ? Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-07-12 20:34:29 -0500

JonW gravatar image

Are you using gazebo 1.0 or later? This looks like the pre-1.0 gazebo format.

A description of the current format can be found on the gazebo website here.

edit flag offensive delete link more

Question Tools


Asked: 2012-07-11 02:21:48 -0500

Seen: 2,644 times

Last updated: Jul 12 '12