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

Fixed light entity number #1818

Merged
merged 2 commits into from
Nov 29, 2022
Merged

Fixed light entity number #1818

merged 2 commits into from
Nov 29, 2022

Conversation

ahcorde
Copy link
Contributor

@ahcorde ahcorde commented Nov 28, 2022

Signed-off-by: Alejandro Hernández Cordero [email protected]

🦟 Bug fix

Fixes #1816

Summary

When a light was created we also created a new visual, but this visual was not registered in the ECM which means that might conflict with other new entities in the world. The solution it's to create a visual entity with the light entity to register both things at the same time.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

Signed-off-by: Alejandro Hernández Cordero <[email protected]>
@ahcorde ahcorde self-assigned this Nov 28, 2022
@ahcorde ahcorde marked this pull request as ready for review November 28, 2022 17:07
@github-actions github-actions bot added the 🏯 fortress Ignition Fortress label Nov 28, 2022
@luca-della-vedova
Copy link
Member

This seems to help when lights are spawned only through the GUI but not when lights are embedded in a SDF file.
For example when using the following sdf:

<sdf version="1.9">
  <world name="sim_world">
    <physics name="10ms" type="ode">
      <max_step_size>0.01</max_step_size>
      <real_time_factor>1.0</real_time_factor>
    </physics>
    <plugin filename="libignition-gazebo-physics-system.so" name="ignition::gazebo::systems::Physics">
    </plugin>
    <plugin filename="libignition-gazebo-user-commands-system.so" name="ignition::gazebo::systems::UserCommands">
    </plugin>
    <plugin filename="libignition-gazebo-scene-broadcaster-system.so" name="ignition::gazebo::systems::SceneBroadcaster">
    </plugin>
    <scene>
      <grid>false</grid>
    </scene>
    <gui fullscreen="0">
      <plugin filename="GzScene3D" name="3D View">
        <ignition-gui>
          <title>3D View</title>
          <property type="bool" key="showTitleBar">false</property>
          <property type="string" key="state">docked</property>
        </ignition-gui>
        <engine>ogre2</engine>
        <scene>scene</scene>
        <ambient_light>0.01 0.01 0.01</ambient_light>
        <background_color>0.0 0.0 0.0</background_color>
        <camera_pose>6 0 6 0 0.5 3.14</camera_pose>
      </plugin>
      <plugin filename="WorldControl" name="World control">
        <ignition-gui>
          <title>World control</title>
          <property type="bool" key="showTitleBar">false</property>
          <property type="bool" key="resizable">false</property>
          <property type="double" key="height">72</property>
          <property type="double" key="width">121</property>
          <property type="double" key="z">1</property>
          <property type="string" key="state">floating</property>
          <anchors target="3D View">
            <line own="left" target="left" />
            <line own="bottom" target="bottom" />
          </anchors>
        </ignition-gui>
        <play_pause>true</play_pause>
        <step>true</step>
        <start_paused>true</start_paused>
      </plugin>
      <plugin filename="WorldStats" name="World stats">
        <ignition-gui>
          <title>World stats</title>
          <property type="bool" key="showTitleBar">false</property>
          <property type="bool" key="resizable">false</property>
          <property type="double" key="height">110</property>
          <property type="double" key="width">290</property>
          <property type="double" key="z">1</property>
          <property type="string" key="state">floating</property>
          <anchors target="3D View">
            <line own="right" target="right" />
            <line own="bottom" target="bottom" />
          </anchors>
        </ignition-gui>
        <sim_time>true</sim_time>
        <real_time>true</real_time>
        <real_time_factor>true</real_time_factor>
        <iterations>true</iterations>
      </plugin>
      <plugin filename="TransformControl" name="Transform control">
        <ignition-gui>
          <title>Transform control</title>
          <anchors target="3D View">
            <line own="left" target="left" />
            <line own="top" target="top" />
          </anchors>
          <property key="resizable" type="bool">false</property>
          <property key="width" type="double">230</property>
          <property key="height" type="double">50</property>
          <property key="state" type="string">floating</property>
          <property key="showTitleBar" type="bool">false</property>
          <property key="cardBackground" type="string">#666666</property>
        </ignition-gui>
      </plugin>
      <plugin filename="Shapes" name="Shapes">
        <ignition-gui>
          <anchors target="Transform control">
            <line own="left" target="right" />
            <line own="top" target="top" />
          </anchors>
          <property key="resizable" type="bool">false</property>
          <property key="width" type="double">200</property>
          <property key="height" type="double">50</property>
          <property key="state" type="string">floating</property>
          <property key="showTitleBar" type="bool">false</property>
          <property key="cardBackground" type="string">#666666</property>
        </ignition-gui>
      </plugin>
      <plugin filename="ComponentInspector" name="Component inspector">
        <ignition-gui>
          <property type="bool" key="showTitleBar">false</property>
          <property type="string" key="state">docked</property>
        </ignition-gui>
      </plugin>
      <plugin filename="EntityTree" name="Entity tree">
        <ignition-gui>
          <property type="bool" key="showTitleBar">false</property>
          <property type="string" key="state">docked</property>
        </ignition-gui>
      </plugin>
    </gui>
    <light type="point" name="light0">
      <pose>-26.0 -10.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light1">
      <pose>-26.0 -5.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light2">
      <pose>-26.0 0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light3">
      <pose>-26.0 5.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light4">
      <pose>-26.0 10.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light5">
      <pose>-21.0 -10.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light6">
      <pose>-21.0 -5.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light7">
      <pose>-21.0 0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light8">
      <pose>-21.0 5.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light9">
      <pose>-21.0 10.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light10">
      <pose>-16.0 -10.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light11">
      <pose>-16.0 -5.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light12">
      <pose>-16.0 0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light13">
      <pose>-16.0 5.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light14">
      <pose>-16.0 10.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light15">
      <pose>-11.0 -10.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light16">
      <pose>-11.0 -5.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light17">
      <pose>-11.0 0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light18">
      <pose>-11.0 5.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light19">
      <pose>-11.0 10.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light20">
      <pose>-6.0 -10.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light21">
      <pose>-6.0 -5.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light22">
      <pose>-6.0 0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light23">
      <pose>-6.0 5.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light24">
      <pose>-6.0 10.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light25">
      <pose>-1.0 -10.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light26">
      <pose>-1.0 -5.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light27">
      <pose>-1.0 0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light28">
      <pose>-1.0 5.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light29">
      <pose>-1.0 10.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light30">
      <pose>4.0 -10.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light31">
      <pose>4.0 -5.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light32">
      <pose>4.0 0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light33">
      <pose>4.0 5.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light34">
      <pose>4.0 10.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light35">
      <pose>9.0 -10.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light36">
      <pose>9.0 -5.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light37">
      <pose>9.0 0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light38">
      <pose>9.0 5.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light39">
      <pose>9.0 10.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light40">
      <pose>14.0 -10.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light41">
      <pose>14.0 -5.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light42">
      <pose>14.0 0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light43">
      <pose>14.0 5.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light44">
      <pose>14.0 10.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light45">
      <pose>19.0 -10.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light46">
      <pose>19.0 -5.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light47">
      <pose>19.0 0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light48">
      <pose>19.0 5.0 1.0 0 0 0</pose>
    </light>
    <light type="point" name="light49">
      <pose>19.0 10.0 1.0 0 0 0</pose>
    </light>
  </world>
</sdf>

The lights went from being spawned in wrong places to not being spawned at all, I noticed that there are two entities per light now, a light and light_visual, while there is only one when they are being spawned through the GUI plugin.
Any idea what might be happening?

Signed-off-by: Alejandro Hernández Cordero <[email protected]>
@ahcorde ahcorde merged commit 678b985 into ign-gazebo6 Nov 29, 2022
@ahcorde ahcorde deleted the ahcorde/fix/lights branch November 29, 2022 16:04
@ahcorde
Copy link
Contributor Author

ahcorde commented Dec 1, 2022

@Crola1702 on it

@ahcorde
Copy link
Contributor Author

ahcorde commented Dec 1, 2022

@Crola1702 PR #1827

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏯 fortress Ignition Fortress
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants