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

Make Grid3D plugin more flexible #172

Merged
merged 2 commits into from
Feb 3, 2021
Merged

Make Grid3D plugin more flexible #172

merged 2 commits into from
Feb 3, 2021

Conversation

chapulina
Copy link
Contributor

This fixes gazebosim/gz-sim#312.

Trying to load ogre when ogre2 is already loaded explodes the whole application. With this change, when loading the plugin from the menu, it now defaults to the first loaded engine / scene instead ogre.

Signed-off-by: Louise Poubel <louise@openrobotics.org>
@chapulina chapulina added the bug Something isn't working label Feb 2, 2021
@github-actions github-actions bot added the 🏰 citadel Ignition Citadel label Feb 2, 2021
@codecov
Copy link

codecov bot commented Feb 2, 2021

Codecov Report

Merging #172 (2cad85a) into ign-gui3 (e09a4e3) will decrease coverage by 1.19%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##           ign-gui3     #172      +/-   ##
============================================
- Coverage     60.31%   59.12%   -1.20%     
============================================
  Files            20       21       +1     
  Lines          2510     2608      +98     
============================================
+ Hits           1514     1542      +28     
- Misses          996     1066      +70     
Impacted Files Coverage Δ
src/plugins/grid_3d/Grid3D.cc 28.57% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e09a4e3...2cad85a. Read the comment docs.

@ahcorde ahcorde self-requested a review February 2, 2021 22:12
@ahcorde
Copy link
Contributor

ahcorde commented Feb 3, 2021

One issue that I found appears when the gui.config file contains a 3DScene and a Grid3D

<!-- 3D scene -->
<plugin filename="Scene3D" 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.4 0.4 0.4</ambient_light>
  <background_color>0.8 0.8 0.8</background_color>
  <camera_pose>6 0 6 0 0.5 3.14</camera_pose>
</plugin>


<plugin filename="Grid3D" name="3D Grid">
  <engine>ogre2</engine>
  <scene>scene</scene>
</plugin>

This is the trace of ign-gui

[GUI] [Msg] Loading config [gui.config]
[GUI] [Dbg] [Application.cc:305] Loading plugin [Scene3D]
[GUI] [Msg] Added plugin [3D View] to main window
[GUI] [Msg] Loaded plugin [Scene3D] from path [/home/ahcorde/ignition_citadel/install/lib/ign-gui-3/plugins/libScene3D.so]
[GUI] [Dbg] [Application.cc:305] Loading plugin [Grid3D]
[GUI] [Msg] Added plugin [3D Grid] to main window
[GUI] [Msg] Loaded plugin [Grid3D] from path [/home/ahcorde/ignition_citadel/install/lib/ign-gui-3/plugins/libGrid3D.so]
[GUI] [Dbg] [Application.cc:266] Loading window config
[GUI] [Dbg] [Application.cc:421] Applying config
[GUI] [Msg] Loading plugin [ignition-rendering-ogre2]
[GUI] [Wrn] [Grid3D.cc:233] Engine "ogre2" has no scene, Grid plugin won't work.
[GUI] [Msg] Loading plugin [ignition-rendering-ogre2]
[GUI] [Dbg] [Scene3D.cc:941] Create scene [scene]

The Scene created by the 3DScene is create after the Grid3D is trying to access it. I'm getting a segfault. Is there any way to wait to other plugin to be loaded?

If I add to the config file only the 3DScene and then manually a added with the interface the Grid 3D I'm not getting the segfault

Signed-off-by: Louise Poubel <louise@openrobotics.org>
@chapulina
Copy link
Contributor Author

Is there any way to wait to other plugin to be loaded?

Nice catch, addressed in 2cad85a. Also added the grid to the example scene.

@chapulina chapulina merged commit 7863c80 into ign-gui3 Feb 3, 2021
@chapulina chapulina deleted the chapulina/3/grid3d branch February 3, 2021 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🏰 citadel Ignition Citadel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants