Skip to content

ambient_params_tutorial

M1chaelM edited this page Jul 31, 2023 · 3 revisions

Adjusting Ambient light

  • The color of ambient light can be set in the scene element of individual world files, found in vrx_gz/worlds.
  • The color is stored as a vector of RBG values between 0 and 1.
  • In this tutorial we will use the sydney_regatta world as an example.

Steps

Step 1: Modify Parameters

Open vrx/vrx_gz/worlds/sydney_regatta.sdf and edit the RBG values specifying the color of ambient light:

    <scene>
      <sky></sky>
      <grid>false</grid>
      <ambient>1.0 1.0 1.0</ambient>
      <background>0.8 0.8 0.8</background>
    </scene>

For example, try changing all values to 0 to turn off ambient light: <ambient>0.0 0.0 0.0</ambient>

Note:

Be careful not to confuse the above parameter with the <ambient_light> parameter, which is not currently used in VRX.

Step 2: Rebuild

Recompile your workspace:

cd <VRX_WS>
colcon build --merge-install

Step 3: Test

Launch the simulation:

ros2 launch vrx_gz competition.launch.py world:=sydney_regatta

You should observe a sharpening of object shadows due to the absence of ambient light.

Before:

ambient111

This screenshot shows the shadows of the trees with <ambient>1.0 1.0 1.0</ambient>.

After:

ambient000

This screenshot shows the shadows of the trees with <ambient>0.0 0.0 0.0</ambient>.

Back: Adjusting Fog Parameters Top: VRX Tutorials
Clone this wiki locally