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

Enabling Global Illumination (GI VCT) for sensors in SDF #2550

Merged
merged 25 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4afb41b
Hack to enable GI for sensors
athenaz2 Aug 21, 2024
e36edfd
Parse and set SDF parameters for GI VCT
athenaz2 Aug 26, 2024
bd93e33
Add doxygen comments and cleaned up code a bit
athenaz2 Aug 27, 2024
f401172
Update src/systems/sensors/Sensors.cc
athenaz2 Aug 27, 2024
f82c68e
Add comments documenting helper funcs as well as clarifying comments;…
athenaz2 Aug 28, 2024
5a1d4ee
Add GI demo SDF as example
athenaz2 Aug 28, 2024
bb70589
Add test scene SDFs and test file
athenaz2 Aug 29, 2024
f725194
Minor codecheck modification
athenaz2 Aug 29, 2024
843c0c8
Minor var rename
athenaz2 Aug 29, 2024
407ab1c
Merge branch 'gz-sim8' into athenaz/gi_for_sensors
azeey Aug 29, 2024
0ab686a
Add surrounding box in SDF, set test expectations to be more stark
athenaz2 Aug 30, 2024
8738398
Minor codecheck modification for SDF, disable GIEnabled test for macO…
athenaz2 Aug 30, 2024
56b841b
Comment out GINotEnabled test to check segfault issue
athenaz2 Aug 30, 2024
0293b5f
Disable test if MESA_GL_VERSION_OVERRIDE env var is set
athenaz2 Aug 31, 2024
db226c2
Add GI tutorial
athenaz2 Sep 3, 2024
e310454
At end of RenderThread, reset giVct shared ptr
athenaz2 Sep 4, 2024
420231d
Merge branch 'gz-sim8' into athenaz/gi_for_sensors
athenaz2 Sep 4, 2024
3f64dd0
Trim trailing whitespace
athenaz2 Sep 5, 2024
6a7a6c2
Merge branch 'athenaz/gi_for_sensors' of https:/athenaz2/…
athenaz2 Sep 5, 2024
10f1b37
Merge branch 'gz-sim8' into athenaz/gi_for_sensors
athenaz2 Sep 6, 2024
7f49293
Apply suggestions from code review
athenaz2 Sep 6, 2024
f04599f
Apply suggestions from code review
athenaz2 Sep 6, 2024
95530a6
Remove commented out sections in SDFs, remove GUI plugins from SDF be…
athenaz2 Sep 7, 2024
f03476b
remove whitespace
iche033 Sep 9, 2024
966f48c
hide scene manager and view control gui plugins
iche033 Sep 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
328 changes: 328 additions & 0 deletions examples/worlds/global_illumination.sdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,328 @@
<?xml version="1.0" ?>
<!--
A demo showcasing global illumination (using VCT method) enabled for the camera sensor view.
-->
<sdf version="1.10">
<world name="gi_demo">
<!--sensor plugins-->
<plugin
filename="gz-sim-physics-system"
name="gz::sim::systems::Physics">
</plugin>
<plugin
filename="gz-sim-sensors-system"
name="gz::sim::systems::Sensors">
<render_engine>ogre2</render_engine>
<global_illumination type="vct">
<enabled>true</enabled>
<resolution>16 16 16</resolution>
<octant_count>1 1 1</octant_count>
<bounce_count>6</bounce_count>
<high_quality>true</high_quality>
<anisotropic>true</anisotropic>
<thin_wall_counter>1.0</thin_wall_counter>
<conserve_memory>false</conserve_memory>
<debug_vis_mode>none</debug_vis_mode>
</global_illumination>
</plugin>
<plugin
filename="gz-sim-user-commands-system"
name="gz::sim::systems::UserCommands">
</plugin>
<plugin
filename="gz-sim-scene-broadcaster-system"
name="gz::sim::systems::SceneBroadcaster">
</plugin>

<!--scene description for system view-->
<scene>
<ambient>0.1 0.1 0.1</ambient>
<background>0 0 0</background>
</scene>

<!--GUI plugins-->
<gui>
<plugin filename="MinimalScene" name="3D View">
<gz-gui>
<title>Cornell box GI demo</title>
<property type="bool" key="showTitleBar">true</property>
<property type="string" key="state">docked</property>
</gz-gui>
<engine>ogre2</engine>
<camera_pose>-12 0 4 0 0 0</camera_pose>
</plugin>

<plugin filename="ImageDisplay" name="Image Display">
<topic>camera</topic>
</plugin>

<!-- <plugin filename="GlobalIlluminationVct" name="Global Illumination Vct">
</plugin> -->

<plugin filename="GzSceneManager" name="Scene Manager">
<gz-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>
</gz-gui>
</plugin>

<plugin filename="InteractiveViewControl" name="Interactive view control">
<gz-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>
</gz-gui>
</plugin>

<plugin filename="TransformControl" name="Transform control">
<gz-gui>
<property key="resizable" type="bool">false</property>
<property key="x" type="double">0</property>
<property key="y" type="double">50</property>
<property key="width" type="double">250</property>
<property key="height" type="double">50</property>
<property key="state" type="string">docked</property>
<property key="showTitleBar" type="bool">true</property>
<property key="cardBackground" type="string">#777777</property>
</gz-gui>
</plugin>
<plugin filename="SelectEntities" name="Select Entities">
<gz-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>
</gz-gui>
</plugin>
</gui>

<!--lighting-->
<light type="point" name="ceiling_light">
<pose>0 0 7.5 0 0 0</pose>
<diffuse>1 1 1 1</diffuse>
<specular>0.0 0.0 0.0 0</specular>
<attenuation>
<range>50</range>
<linear>0</linear>
<constant>0</constant>
<quadratic>0.02</quadratic>
</attenuation>
<cast_shadows>true</cast_shadows>
<visualize>false</visualize>
<intensity>1.0</intensity>
</light>

<!--wall models-->
<model name="wall_left">
<pose>0 5 4 0 0 0</pose>
<static>true</static>
<link name="link">
<collision name="collision">
<geometry>
<box>
<size>10 1 10</size>
</box>
</geometry>
</collision>
<visual name="visual">
<geometry>
<box>
<size>10 1 10</size>
</box>
</geometry>
<material>
<ambient>1 0 0 1</ambient>
<diffuse>1 0 0 1</diffuse>
<specular>1 0 0 1</specular>
</material>
</visual>
</link>
</model>

<model name="wall_right">
<pose>0 -5 4 0 0 0</pose>
<static>true</static>
<link name="link">
<collision name="collision">
<geometry>
<box>
<size>10 1 10</size>
</box>
</geometry>
</collision>
<visual name="visual">
<geometry>
<box>
<size>10 1 10</size>
</box>
</geometry>
<material>
<ambient>0 1 0 1</ambient>
<diffuse>0 1 0 1</diffuse>
<specular>0 1 0 1</specular>
</material>
</visual>
</link>
</model>

<model name="floor">
<pose>0 0 -0.5 0 0 0</pose>
<static>true</static>
<link name="link">
<collision name="collision">
<geometry>
<box>
<size>10 10 1</size>
</box>
</geometry>
</collision>
<visual name="visual">
<geometry>
<box>
<size>10 10 1</size>
</box>
</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>

<model name="ceiling">
<pose>0 0 8.5 0 0 0</pose>
<static>true</static>
<link name="link">
<collision name="collision">
<geometry>
<box>
<size>10 10 1</size>
</box>
</geometry>
</collision>
<visual name="visual">
<geometry>
<box>
<size>10 10 1</size>
</box>
</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>

<model name="wall_back">
<pose>4.5 0 4 0 0 0</pose>
<static>true</static>
<link name="link">
<collision name="collision">
<geometry>
<box>
<size>1 10 10</size>
</box>
</geometry>
</collision>
<visual name="visual">
<geometry>
<box>
<size>1 10 10</size>
</box>
</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>

<!--scene objects-->
<model name="pump">
<pose>-1.5 0 0 0 0 0</pose>
<link name="pump_link">
<collision name="pump_collision">
<geometry>
<mesh>
<uri>https://fuel.gazebosim.org/1.0/openrobotics/models/pump/1/files/meshes/pump.dae</uri>
<scale>3 3 3</scale>
</mesh>
</geometry>
</collision>

<visual name="pump_visual">
<geometry>
<mesh>
<uri>https://fuel.gazebosim.org/1.0/openrobotics/models/pump/1/files/meshes/pump.dae</uri>
<scale>3 3 3</scale>
</mesh>
</geometry>
<material>
<diffuse>1.0 1.0 1.0</diffuse>
<specular>1.0 1.0 1.0</specular>
<pbr>
<metal>
<albedo_map>https://fuel.gazebosim.org/1.0/openrobotics/models/pump/1/files/materials/textures/pump_albedo.png</albedo_map>
<roughness_map>https://fuel.gazebosim.org/1.0/openrobotics/models/pump/1/files/materials/textures/pump_roughness.png</roughness_map>
<metalness_map>https://fuel.gazebosim.org/1.0/openrobotics/models/pump/1/files/materials/textures/pump_metallic.png</metalness_map>
<normal_map>https://fuel.gazebosim.org/1.0/openrobotics/models/pump/1/files/materials/textures/pump_normal.png</normal_map>
</metal>
</pbr>
</material>
</visual>
</link>
</model>

<!--camera sensor-->
<model name="camera">
<pose>-15 0 4 0 0.0 0</pose>
<static>true</static>
<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>2560</width>
<height>1920</height>
</image>
<clip>
<near>0.1</near>
<far>100</far>
</clip>
</camera>
<always_on>1</always_on>
<update_rate>30</update_rate>
<visualize>true</visualize>
<topic>camera</topic>
</sensor>
</link>
</model>
</world>
</sdf>
Loading
Loading