Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Light visuals do not honor SDF <visualize> tag value at startup with ogre renderer #1948

Closed
sea-bass opened this issue Mar 30, 2023 · 6 comments
Assignees
Labels
bug Something isn't working help wanted We accept pull requests!

Comments

@sea-bass
Copy link

sea-bass commented Mar 30, 2023

Environment

  • OS Version: Ubuntu 22.04
  • Source or binary build? Binary build of Fortress v6.14.0

Description

Building on #1387, when you create a world in SDF format, there is the option of not visualizing the light frames by setting the <visualize> tags to false.
However, these options do not take effect at startup when using the ogre renderer. The default of ogre2 is fine.
You have to toggle them in the GUI to get the setting correct.

Steps to reproduce

  • Create an SDF world with a light which has the <visualize>false</visualize> tag on it.
  • Launch Gazebo with that world, using the ogre render engine
  • You will find that the "View gizmo" option is off, but the gizmo still visualizes. If you turn it on and off again from the GUI, it will go away properly.

Output

Notice the "View gizmo" option is off but the visuals for the lights are still there:
image

@sea-bass sea-bass added the bug Something isn't working label Mar 30, 2023
@osrf-triage osrf-triage added this to Inbox in Core development Mar 30, 2023
@azeey azeey added the help wanted We accept pull requests! label Mar 30, 2023
@azeey azeey moved this from Inbox to To do in Core development Mar 30, 2023
@azeey azeey moved this from To do to Inbox in Core development Mar 30, 2023
@azeey azeey moved this from Inbox to To do in Core development Apr 3, 2023
@ahcorde
Copy link
Contributor

ahcorde commented May 11, 2023

Hi @sea-bass, I tried the examples/worlds/lights.sdf file provided and it's working for me.

The point visual is not visualized.

<visualize>false</visualize>

Can you check this?

@sea-bass
Copy link
Author

@ahcorde we were using spot lights in our case -- does that work for you?

@ahcorde
Copy link
Contributor

ahcorde commented May 11, 2023

I tried this world and it's working. Can you try this world? Point and spot gizmos are deactivated.

light.sdf 0.001 1.0
<scene>
  <ambient>0.4 0.4 0.4</ambient>
  <background>0.8 0.8 0.8</background>
  <grid>true</grid>
</scene>

<light type="directional" name="directional">
  <cast_shadows>true</cast_shadows>
  <pose>0 0 10 0 0 0</pose>
  <diffuse>0.8 0.8 0.8 1</diffuse>
  <specular>0.2 0.2 0.2 1</specular>
  <attenuation>
    <range>100</range>
    <constant>0.9</constant>
    <linear>0.01</linear>
    <quadratic>0.001</quadratic>
  </attenuation>
  <direction>0.5 0.2 -0.9</direction>
</light>

<light type="point" name="point">
  <pose>0 -1.5 3 0 0 0</pose>
  <diffuse>1 0 0 1</diffuse>
  <specular>.1 .1 .1 1</specular>
  <attenuation>
    <range>4</range>
    <linear>0.5</linear>
    <constant>0.2</constant>
    <quadratic>0.01</quadratic>
  </attenuation>
  <cast_shadows>false</cast_shadows>
  <visualize>false</visualize>
</light>

<light type="spot" name="spot">
  <pose>0 0.0 3 0 0 0</pose>
  <diffuse>0 1 0 1</diffuse>
  <specular>.2 .2 .2 1</specular>
  <attenuation>
    <range>4</range>
    <linear>0.5</linear>
    <constant>0.2</constant>
    <quadratic>0.01</quadratic>
  </attenuation>
  <direction>0 0 -1</direction>
  <spot>
    <inner_angle>0.1</inner_angle>
    <outer_angle>0.5</outer_angle>
    <falloff>0.8</falloff>
  </spot>
  <visualize>false</visualize>
  <cast_shadows>false</cast_shadows>
</light>

<model name="ground_plane">
  <static>true</static>
  <pose>0 0 0 0 0.02 0</pose>
  <link name="link">
    <collision name="collision">
      <geometry>
        <plane>
          <normal>0.0 0.0 1</normal>
          <size>100 100</size>
        </plane>
      </geometry>
    </collision>
    <visual name="visual">
      <geometry>
        <plane>
          <normal>0.0 0.0 1</normal>
          <size>100 100</size>
        </plane>
      </geometry>
      <material>
        <ambient>0.8 0.8 0.8 1</ambient>
        <diffuse>0.8 0.8 0.8 1</diffuse>
        <specular>0.8 0.8 0.8 1</specular>
      </material>
    </visual>
  </link>
</model>

<model name="box">
  <pose>0 0 0.5 0 0 0</pose>
  <link name="box_link">
    <inertial>
      <inertia>
        <ixx>1</ixx>
        <ixy>0</ixy>
        <ixz>0</ixz>
        <iyy>1</iyy>
        <iyz>0</iyz>
        <izz>1</izz>
      </inertia>
      <mass>1.0</mass>
    </inertial>
    <collision name="box_collision">
      <geometry>
        <box>
          <size>1 1 1</size>
        </box>
      </geometry>
    </collision>

    <visual name="box_visual">
      <geometry>
        <box>
          <size>1 1 1</size>
        </box>
      </geometry>
      <material>
        <ambient>0.3 0.3 0.3 1</ambient>
        <diffuse>0.3 0.3 0.3 1</diffuse>
        <specular>0.3 0.5 0.3 1</specular>
      </material>
    </visual>

  </link>
</model>

<model name="cylinder">
  <pose>0 -1.5 0.5 0 0 0</pose>
  <link name="cylinder_link">
    <inertial>
      <inertia>
        <ixx>2</ixx>
        <ixy>0</ixy>
        <ixz>0</ixz>
        <iyy>2</iyy>
        <iyz>0</iyz>
        <izz>2</izz>
      </inertia>
      <mass>2.0</mass>
    </inertial>
    <collision name="cylinder_collision">
      <geometry>
        <cylinder>
          <radius>0.5</radius>
          <length>1.0</length>
        </cylinder>
      </geometry>
    </collision>

    <visual name="cylinder_visual">
      <geometry>
        <cylinder>
          <radius>0.5</radius>
          <length>1.0</length>
        </cylinder>
      </geometry>
      <material>
        <ambient>0.3 0.3 0.3 1</ambient>
        <diffuse>0.3 0.3 0.3 1</diffuse>
        <specular>0.3 0.3 0.3 1</specular>
      </material>
    </visual>
  </link>
</model>

<model name="sphere">
  <pose>0 1.5 0.5 0 0 0</pose>
  <link name="sphere_link">
    <inertial>
      <inertia>
        <ixx>3</ixx>
        <ixy>0</ixy>
        <ixz>0</ixz>
        <iyy>3</iyy>
        <iyz>0</iyz>
        <izz>3</izz>
      </inertia>
      <mass>3.0</mass>
    </inertial>
    <collision name="sphere_collision">
      <geometry>
        <sphere>
          <radius>0.5</radius>
        </sphere>
      </geometry>
    </collision>

    <visual name="sphere_visual">
      <geometry>
        <sphere>
          <radius>0.5</radius>
        </sphere>
      </geometry>
      <material>
        <ambient>0.3 0.3 0.3 1</ambient>
        <diffuse>0.3 0.3 0.3 1</diffuse>
        <specular>0.3 0.3 0.3 1</specular>
      </material>
    </visual>

    <light type="point" name="link_light_point">
      <pose>0 0 0.8 0 0 0</pose>
      <diffuse>0 0 1 1</diffuse>
      <specular>.1 .1 .1 1</specular>
      <attenuation>
        <range>2</range>
        <linear>0.02</linear>
        <constant>0.05</constant>
        <quadratic>0.01</quadratic>
      </attenuation>
      <cast_shadows>false</cast_shadows>
    </light>
  </link>
</model>

@sea-bass
Copy link
Author

sea-bass commented Jun 6, 2023

Apologies for the delay here -- I somehow missed this.

I just did some investigating and it turns out the gizmos don't show up with the default render engine (ogre2), but when you switch to ogre, which is what my project was using, it is not hidden:

If you do gz sim your_world.sdf --render-engine ogre you'll see something like this:

image

Tested on both Fortress and Garden and this happens.

@sea-bass sea-bass changed the title Light visuals do not honor SDF <visualize> tag value at startup Light visuals do not honor SDF <visualize> tag value at startup with ogre renderer Jun 6, 2023
@ahcorde
Copy link
Contributor

ahcorde commented Jun 9, 2023

Hi @sea-bass,

can you try this gazebosim/gz-rendering#862 ?

@sea-bass
Copy link
Author

Hi @sea-bass,

can you try this gazebosim/gz-rendering#862 ?

Haha -- always the subtle things. PR LGTM, though I see it already was merged.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted We accept pull requests!
Projects
Archived in project
Development

No branches or pull requests

4 participants