-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Load and run visual plugin (system) on GUI side (#1275)
* load and run visual plugins on gui end Signed-off-by: Ian Chen <[email protected]> * scene update event emitted on both server and gui side Signed-off-by: Ian Chen <[email protected]> * shader param update working Signed-off-by: Ian Chen <[email protected]> * sim time, constants, full example working Signed-off-by: Ian Chen <[email protected]> * add integration test Signed-off-by: Ian Chen <[email protected]> * code cleanup Signed-off-by: Ian Chen <[email protected]> * more code cleanup Signed-off-by: Ian Chen <[email protected]> * style fixes and add some comments Signed-off-by: Ian Chen <[email protected]> * review changes Signed-off-by: Ian Chen <[email protected]> * require display for shader param test Signed-off-by: Ian Chen <[email protected]> * style and comment Signed-off-by: Ian Chen <[email protected]>
- Loading branch information
Showing
24 changed files
with
1,371 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,268 @@ | ||
<?xml version="1.0" ?> | ||
<!-- | ||
This world contains a sphere model whose visual appearance is altered by the | ||
ShaderParam visual plugin over time. | ||
--> | ||
<sdf version="1.6"> | ||
<world name="deformable_sphere"> | ||
|
||
<plugin | ||
filename="ignition-gazebo-physics-system" | ||
name="ignition::gazebo::systems::Physics"> | ||
</plugin> | ||
<plugin | ||
filename="ignition-gazebo-sensors-system" | ||
name="ignition::gazebo::systems::Sensors"> | ||
<render_engine>ogre2</render_engine> | ||
<background_color>0.8 0.8 0.8</background_color> | ||
</plugin> | ||
<plugin | ||
filename="ignition-gazebo-scene-broadcaster-system" | ||
name="ignition::gazebo::systems::SceneBroadcaster"> | ||
</plugin> | ||
<plugin | ||
filename="ignition-gazebo-user-commands-system" | ||
name="ignition::gazebo::systems::UserCommands"> | ||
</plugin> | ||
|
||
<gui fullscreen="0"> | ||
|
||
<!-- 3D scene --> | ||
<plugin filename="MinimalScene" 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 0</camera_pose> | ||
</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> | ||
<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> | ||
<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> | ||
<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> | ||
<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> | ||
<use_event>true</use_event> | ||
|
||
</plugin> | ||
|
||
<!-- World statistics --> | ||
<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> | ||
|
||
<!-- Inspector --> | ||
<plugin filename="ComponentInspector" name="Component inspector"> | ||
<ignition-gui> | ||
<property type="string" key="state">docked</property> | ||
</ignition-gui> | ||
</plugin> | ||
|
||
<!-- Entity tree --> | ||
<plugin filename="EntityTree" name="Entity tree"> | ||
<ignition-gui> | ||
<property type="string" key="state">docked</property> | ||
</ignition-gui> | ||
</plugin> | ||
|
||
<plugin filename="ImageDisplay" name="Image Display"> | ||
<ignition-gui> | ||
<title>RGB camera</title> | ||
<property key="state" type="string">floating</property> | ||
<property type="double" key="width">350</property> | ||
<property type="double" key="height">315</property> | ||
</ignition-gui> | ||
<topic>camera</topic> | ||
<topic_picker>false</topic_picker> | ||
</plugin> | ||
<plugin filename="ImageDisplay" name="Image Display 2"> | ||
<ignition-gui> | ||
<title>Depth camera</title> | ||
<property key="state" type="string">floating</property> | ||
<property type="double" key="width">350</property> | ||
<property type="double" key="height">315</property> | ||
<property type="double" key="x">500</property> | ||
</ignition-gui> | ||
<topic>depth_camera</topic> | ||
<topic_picker>false</topic_picker> | ||
</plugin> | ||
</gui> | ||
|
||
<scene> | ||
<ambient>1.0 1.0 1.0</ambient> | ||
<background>0.8 0.8 0.8</background> | ||
</scene> | ||
|
||
<light type="directional" name="sun"> | ||
<cast_shadows>true</cast_shadows> | ||
<pose>0 0 10 0 0 0</pose> | ||
<diffuse>0.8 0.8 0.8 1</diffuse> | ||
<specular>0.6 0.6 0.6 1</specular> | ||
<direction>-0.5 0.1 -0.9</direction> | ||
</light> | ||
|
||
<model name="ground_plane"> | ||
<static>true</static> | ||
<link name="link"> | ||
<collision name="collision"> | ||
<geometry> | ||
<plane> | ||
<normal>0 0 1</normal> | ||
<size>100 100</size> | ||
</plane> | ||
</geometry> | ||
</collision> | ||
<visual name="visual"> | ||
<geometry> | ||
<plane> | ||
<normal>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> | ||
|
||
<include> | ||
<pose>0 0.0 0.5 0 0 0</pose> | ||
<name>deformable_sphere</name> | ||
<pose>3 0 0 0 0 0</pose> | ||
<uri>https://fuel.ignitionrobotics.org/1.0/openrobotics/models/deformable_sphere</uri> | ||
</include> | ||
|
||
<model name="camera"> | ||
<static>true</static> | ||
<pose>2.5 0 0.5 0 0.0 3.14</pose> | ||
<link name="link"> | ||
<pose>0.05 0.05 0.05 0 0 0</pose> | ||
<collision name="collision"> | ||
<geometry> | ||
<box> | ||
<size>0.1 0.1 0.1</size> | ||
</box> | ||
</geometry> | ||
</collision> | ||
<visual name="visual"> | ||
<geometry> | ||
<box> | ||
<size>0.1 0.1 0.1</size> | ||
</box> | ||
</geometry> | ||
</visual> | ||
<sensor name="camera" type="camera"> | ||
<camera> | ||
<horizontal_fov>1.047</horizontal_fov> | ||
<image> | ||
<width>320</width> | ||
<height>240</height> | ||
</image> | ||
<clip> | ||
<near>0.1</near> | ||
<far>100</far> | ||
</clip> | ||
</camera> | ||
<always_on>1</always_on> | ||
<update_rate>30</update_rate> | ||
<topic>camera</topic> | ||
</sensor> | ||
<sensor name="depth_camera" type="depth_camera"> | ||
<update_rate>10</update_rate> | ||
<topic>depth_camera</topic> | ||
<camera> | ||
<horizontal_fov>1.05</horizontal_fov> | ||
<image> | ||
<width>320</width> | ||
<height>240</height> | ||
</image> | ||
<clip> | ||
<near>0.1</near> | ||
<far>10.0</far> | ||
</clip> | ||
</camera> | ||
</sensor> | ||
</link> | ||
</model> | ||
|
||
</world> | ||
</sdf> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.