Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Addiing light models in ros-fuerte

I was working for sometime in electric and I used the following light.urdf to spawn the model of light in gazebo.

<?xml version="1.0" ?>

<robot name="light_livingroom" xmlns:xi=""
  <link name="bulb_livingroom">
    <mass value="1" />
            <com xyz="7.6 4.2 1.5" />
            <inertia ixx="1" ixy="0.0" ixz="0.0" iyy="1" iyz="0.0" izz="1" />

            <origin xyz="7.6 4.2 1.5" rpy="0 0 0" />  <!--   definition of the visual postion of the object!! -->
                <sphere radius="0.0001" />
            <origin xyz="7.6 4.2 1.5" rpy="0 0 0" />
                <sphere radius="0.0001" />

    <gazebo reference="bulb_livingroom">
        <model:renderable name="light_livingroom">
            <xyz>7.6 4.2 1.5</xyz>
                <diffuseColor>0.1 0.1 0.1</diffuseColor>
                <specularColor>.01 .01 .01</specularColor>
                <attenuation>0.1 0.1 0.0001</attenuation>

When I try to spawn the same file in gazebo fuerte. The bulb model seens to oscillate under the ground. I tried replacing the content replacing model content with this

<gazebo reference="bulb_livingroom">
            <light type="directional" name="light_livingroom" cast_shadows="false">
                                <origin pose="7.6 4.2 1.5 0 0 0"/>
                                <diffuse rgba=".9 .9 .9 1"/>
                                <specular rgba=".1 .1 .1 1"/>
                                <attenuation range="20"/>
                                <direction xyz="0 0 -1"/>

Now, the bulb goes to (7.6, 4.2, 1.5) but no light comes out. Is my code wrong ? and is there a way to spawn custom light models in gazebo-fuerte ? Could someone give me a sample snippet if possible ?