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

Customizable layouts - fully functional #278

Merged
merged 3 commits into from
Aug 13, 2020
Merged

Conversation

chapulina
Copy link
Contributor

@chapulina chapulina commented Aug 8, 2020

Related to #207

Since this PR we've been able to load GUI configs from the command line with --gui-config and default to ~/.ignition/gazebo/gui.config when no <gui> was specified on SDF.

But because of issue #207, we couldn't really reuse configuration files across worlds that have different names. Which meant that the 2 features above couldn't really be used.

This PR, together with gazebosim/gz-gui#104, allow us to remove custom topics and services from SDF files. This means we can rely on the default gui.config all the time!

More advantages:

  • This lowers the bar for using Gazebo-classic SDF worlds with Ignition, because it's one less thing for them to set.
  • 3,069 deleted lines!

See the new tutorial for more info.

⚠️ Delete your existing default file to see the effects of this PR: rm ~/.ignition/gazebo/gui.config


👇 that's what loading ign gazebo shapes.sdf looks like now.

shapes_default

Fix

The fix is based on setting the worldNames on the MainWindow so that any plugin can find them. This means that even pure ign-gui plugins like WorldControl and WorldStats can access world names if they want.

This is not a solution to #207, but it makes it easier to write GUI plugins that will work with whatever world is currently loaded.

New layout

I tweaked a bit the default gui.config file so it includes more plugins. I used a gray background for shapes and transform control because it needs to look ok on both light and dark themes.

Deleted lines

I went over all SDF files and:

  • Deleted the <topic>s and <service> from WorldControl and WorldStats
  • If the world was using the default camera pose -6 0 6 0 0.5 0 and wasn't loading any plugin that's not on gui.config, I deleted the entire <gui> block so the default is used.
  • For a couple of worlds, like rolling_shapes, I moved things so that they work well with the default camera angle.

@chapulina chapulina added documentation Improvements or additions to documentation GUI Gazebo's graphical interface (not pure Ignition GUI) migration Helps with migration from Gazebo classic to Ignition labels Aug 8, 2020
@github-actions github-actions bot added the 📜 blueprint Ignition Blueprint label Aug 8, 2020
Signed-off-by: Louise Poubel <[email protected]>
@codecov
Copy link

codecov bot commented Aug 8, 2020

Codecov Report

Merging #278 into ign-gazebo2 will decrease coverage by 4.16%.
The diff coverage is 80.00%.

Impacted file tree graph

@@               Coverage Diff               @@
##           ign-gazebo2     #278      +/-   ##
===============================================
- Coverage        82.33%   78.16%   -4.17%     
===============================================
  Files              172      183      +11     
  Lines             9304     9917     +613     
===============================================
+ Hits              7660     7752      +92     
- Misses            1644     2165     +521     
Impacted Files Coverage Δ
src/gui/GuiRunner.cc 55.00% <66.66%> (+3.57%) ⬆️
src/gui/Gui.cc 65.25% <100.00%> (ø)
.../plugins/component_inspector/ComponentInspector.hh 28.57% <0.00%> (ø)
src/gui/plugins/modules/EntityContextMenu.cc 19.14% <0.00%> (ø)
src/gui/plugins/modules/EntityContextMenu.hh 100.00% <0.00%> (ø)
.../gui/plugins/transform_control/TransformControl.hh 100.00% <0.00%> (ø)
src/gui/plugins/shapes/Shapes.hh 100.00% <0.00%> (ø)
src/gui/plugins/entity_tree/EntityTree.hh 100.00% <0.00%> (ø)
.../plugins/component_inspector/ComponentInspector.cc 9.41% <0.00%> (ø)
include/ignition/gazebo/gui/GuiEvents.hh 0.00% <0.00%> (ø)
... and 6 more

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 e1b9812...2cd4b10. Read the comment docs.

@chapulina chapulina self-assigned this Aug 10, 2020
@chapulina chapulina requested review from caguero and nkoenig August 10, 2020 18:30
Copy link
Contributor

@caguero caguero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great change! @chapulina and I were already talking about how to propagate the default gui.config to the users that have an existing file already. I can't think of a perfect way to do it. Maybe my only suggestion is to tweak the tutorial adding a note in this section:

If you ever want to restore default settings, just delete that file, and the
next time Gazebo is started a new file will be created with default values:

rm $HOME/.ignition/gazebo/gui.config

to reflect that another reason for removing this file might be to receive the updated version of the default configuration.

Signed-off-by: Louise Poubel <[email protected]>
@chapulina
Copy link
Contributor Author

reflect that another reason for removing this file might be to receive the updated version of the default configuration.

Thanks, @caguero . Updated the tutorial in 2cd4b10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📜 blueprint Ignition Blueprint documentation Improvements or additions to documentation GUI Gazebo's graphical interface (not pure Ignition GUI) migration Helps with migration from Gazebo classic to Ignition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants