Skip to content

Commit

Permalink
Use MinimalScene by default (#1014)
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: ahcorde <ahcorde@gmail.com>
Signed-off-by: Jenn Nguyen <jenn@openrobotics.org>

Co-authored-by: ahcorde <ahcorde@gmail.com>
Co-authored-by: Michael Carroll <michael@openrobotics.org>
Co-authored-by: Jenn Nguyen <jenn@openrobotics.org>
  • Loading branch information
4 people authored Sep 22, 2021
1 parent 2b141ac commit 2c2605f
Show file tree
Hide file tree
Showing 13 changed files with 875 additions and 136 deletions.
18 changes: 18 additions & 0 deletions Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,24 @@ since pose information is being logged in the `changed_state` topic.
this type is discouraged (see the **Deprecated** section above for more
information about how to replace usage of `ComponentKey`).

* The `GzScene3D` GUI plugin is being deprecated in favor of `MinimalScene`. In
order to get the same functionality as `GzScene3D`, users need to add the
following plugins:
+ `MinimalScene`: base rendering functionality
+ `GzSceneManager`: adds / removes / moves entities in the scene
+ `EntityContextMenuPlugin`: right-click menu
+ `InteractiveViewControl`: orbit controls
+ `CameraTracking`: Move to, follow, set camera pose
+ `MarkerManager`: Enables the use of markers
+ `SelectEntities`: Select entities clicking on the scene
+ `Spawn`: Functionality to spawn entities into the scene via GUI
+ `VisualizationCapabilities`: View collisions, inertial, CoM, joints, etc.

Moreover, legacy mode needs to be turned off for the following plugins
for them to work with `MinimalScene` (set `<legacy>false</legacy>`):
+ `TransformControl`: Translate and rotate
+ `ViewAndle`: Move camera to preset angles

## Ignition Gazebo 4.x to 5.x

* Use `cli` component of `ignition-utils1`.
Expand Down
8 changes: 8 additions & 0 deletions examples/worlds/minimal_scene.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ Missing for parity with GzScene3D:
</plugin>

<!-- Plugins that add functionality to the scene -->
<plugin filename="EntityContextMenuPlugin" name="Entity context menu">
<ignition-gui>
<property key="state" type="string">floating</property>
<property key="width" type="double">5</property>
<property key="height" type="double">5</property>
<property key="showTitleBar" type="bool">false</property>
</ignition-gui>
</plugin>
<plugin filename="GzSceneManager" name="Scene Manager">
<ignition-gui>
<anchors target="3D View">
Expand Down
125 changes: 120 additions & 5 deletions src/gui/gui.config
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<!-- GUI plugins -->

<!-- 3D scene -->
<plugin filename="GzScene3D" name="3D View">
<plugin filename="MinimalScene" name="3D View">
<ignition-gui>
<title>3D View</title>
<property type="bool" key="showTitleBar">false</property>
Expand All @@ -38,10 +38,113 @@
<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>
<camera_pose>-6 0 6 0 0.5 0</camera_pose>
</plugin>

<!-- Play / pause / step -->
<!-- Plugins that add functionality to the scene -->
<plugin filename="EntityContextMenuPlugin" name="Entity context menu">
<ignition-gui>
<property key="state" type="string">floating</property>
<property key="width" type="double">5</property>
<property key="height" type="double">5</property>
<property key="showTitleBar" type="bool">false</property>
</ignition-gui>
</plugin>
<plugin filename="GzSceneManager" name="Scene Manager">
<ignition-gui>
<anchors target="3D View">
<line own="right" target="right"/>
<line own="top" target="top"/>
</anchors>
<property key="resizable" type="bool">false</property>
<property key="width" type="double">5</property>
<property key="height" type="double">5</property>
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
</ignition-gui>
</plugin>
<plugin filename="InteractiveViewControl" name="Interactive view control">
<ignition-gui>
<anchors target="3D View">
<line own="right" target="right"/>
<line own="top" target="top"/>
</anchors>
<property key="resizable" type="bool">false</property>
<property key="width" type="double">5</property>
<property key="height" type="double">5</property>
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
</ignition-gui>
</plugin>
<plugin filename="CameraTracking" name="Camera Tracking">
<ignition-gui>
<anchors target="3D View">
<line own="right" target="right"/>
<line own="top" target="top"/>
</anchors>
<property key="resizable" type="bool">false</property>
<property key="width" type="double">5</property>
<property key="height" type="double">5</property>
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
</ignition-gui>
</plugin>
<plugin filename="MarkerManager" name="Marker manager">
<ignition-gui>
<anchors target="3D View">
<line own="right" target="right"/>
<line own="top" target="top"/>
</anchors>
<property key="resizable" type="bool">false</property>
<property key="width" type="double">5</property>
<property key="height" type="double">5</property>
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
</ignition-gui>
</plugin>
<plugin filename="SelectEntities" name="Select Entities">
<ignition-gui>
<anchors target="Select entities">
<line own="right" target="right"/>
<line own="top" target="top"/>
</anchors>
<property key="resizable" type="bool">false</property>
<property key="width" type="double">5</property>
<property key="height" type="double">5</property>
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
</ignition-gui>
</plugin>

<plugin filename="Spawn" name="Spawn Entities">
<ignition-gui>
<anchors target="Select entities">
<line own="right" target="right"/>
<line own="top" target="top"/>
</anchors>
<property key="resizable" type="bool">false</property>
<property key="width" type="double">5</property>
<property key="height" type="double">5</property>
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
</ignition-gui>
</plugin>

<plugin filename="VisualizationCapabilities" name="Visualization Capabilities">
<ignition-gui>
<anchors target="Select entities">
<line own="right" target="right"/>
<line own="top" target="top"/>
</anchors>
<property key="resizable" type="bool">false</property>
<property key="width" type="double">5</property>
<property key="height" type="double">5</property>
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
</ignition-gui>
</plugin>

<!-- World control -->
<plugin filename="WorldControl" name="World control">
<ignition-gui>
<title>World control</title>
Expand All @@ -64,7 +167,7 @@

</plugin>

<!-- Time / RTF -->
<!-- World statistics -->
<plugin filename="WorldStats" name="World stats">
<ignition-gui>
<title>World stats</title>
Expand All @@ -85,7 +188,6 @@
<real_time>true</real_time>
<real_time_factor>true</real_time_factor>
<iterations>true</iterations>

</plugin>

<!-- Insert simple shapes -->
Expand Down Expand Up @@ -128,6 +230,9 @@
<property key="showTitleBar" type="bool">false</property>
<property key="cardBackground" type="string">#777777</property>
</ignition-gui>

<!-- disable legacy features used to connect this plugin to GzScene3D -->
<legacy>false</legacy>
</plugin>

<!-- Screenshot -->
Expand Down Expand Up @@ -159,3 +264,13 @@
<property type="string" key="state">docked</property>
</ignition-gui>
</plugin>

<!-- View angle -->
<plugin filename="ViewAngle" name="View angle">
<ignition-gui>
<property type="string" key="state">docked</property>
</ignition-gui>

<!-- disable legacy features used to connect this plugin to GzScene3D -->
<legacy>false</legacy>
</plugin>
1 change: 1 addition & 0 deletions src/gui/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ add_subdirectory(modules)
add_subdirectory(align_tool)
add_subdirectory(banana_for_scale)
add_subdirectory(component_inspector)
add_subdirectory(entity_context_menu)
add_subdirectory(entity_tree)
add_subdirectory(joint_position_controller)
add_subdirectory(lights)
Expand Down
8 changes: 8 additions & 0 deletions src/gui/plugins/entity_context_menu/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
gz_add_gui_plugin(EntityContextMenuPlugin
SOURCES
EntityContextMenuPlugin.cc
QT_HEADERS
EntityContextMenuPlugin.hh
PUBLIC_LINK_LIBS
${PROJECT_LIBRARY_TARGET_NAME}-rendering
)
Loading

0 comments on commit 2c2605f

Please sign in to comment.