0
$\begingroup$

Rosanswers logo

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!


Originally posted by prasanna.kumar on ROS Answers with karma: 1363 on 2012-07-11

Post score: 2

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by JonW with karma: 586 on 2012-07-12

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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