Adding lights in Gazebo world
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="http://playerstage.sourceforge.net/gazebo/xmlschema/#gz" xmlns:model="http://playerstage.sourceforge.net/gazebo/xmlschema/#model" xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor" xmlns:body="http://playerstage.sourceforge.net/gazebo/xmlschema/#body" xmlns:geom="http://playerstage.sourceforge.net/gazebo/xmlschema/#geom" xmlns:joint="http://playerstage.sourceforge.net/gazebo/xmlschema/#joint" xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller" xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface" xmlns:rendering="http://playerstage.sourceforge.net/gazebo/xmlschema/#rendering" xmlns:physics="http://playerstage.sourceforge.net/gazebo/xmlschema/#physics" xmlns:renderable="http://playerstage.sourceforge.net/gazebo/xmlschema/#renderable" name="light_model">
<xyz>10 10 2</xyz>
<enableGravity>false</enableGravity>
<light>
<type>point</type>
<diffuseColor>0.8 0.8 0.8</diffuseColor>
<specularColor>.4 .4 .4</specularColor>
<attenuation>0.2 0.1 0</attenuation>
<range>2</range>
</light>
</model:renderable>
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!