Skip to content

Commit

Permalink
Add extra model in test world
Browse files Browse the repository at this point in the history
The pre-existing model in the test world exhibits
the lens flare rendering bug without the fix in
this branch, so I added an extra model at a different
pose that does not exhibit the bug. It makes it
easier to confirm that the bug is fixed.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
  • Loading branch information
scpeters committed Jan 11, 2023
1 parent d4616e9 commit 7be87db
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/integration/camera_sensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,7 @@ TEST_F(CameraSensor, LensFlareWideAngleCamera)
}

// Get the lens flare wide angle camera model.
std::string modelNameLensFlare = "wide_angle_camera_lensflare";
std::string modelNameLensFlare = "wide_angle_cameras_near_heightmap";
std::string cameraNameLensFlare = "camera_sensor_lensflare";

physics::WorldPtr world = physics::get_world();
Expand All @@ -1440,7 +1440,7 @@ TEST_F(CameraSensor, LensFlareWideAngleCamera)
ASSERT_TRUE(camSensorLensFlare != nullptr);

// Get the wide angle camera without the lens flare.
std::string modelNameWithoutLensFlare = "wide_angle_camera_lensflare";
std::string modelNameWithoutLensFlare = "wide_angle_cameras_near_heightmap";
std::string cameraNameWithoutLensFlare = "camera_sensor_without_lensflare";

model = world->ModelByName(modelNameWithoutLensFlare);
Expand Down
64 changes: 62 additions & 2 deletions worlds/lensflare_wideangle_cam.world
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
</link>
</model>

<!-- wide-angle camera model with lens flare plugin -->
<model name="wide_angle_camera_lensflare">
<!-- model with two wide-angle cameras, with and without lens flare plugin -->
<model name="wide_angle_cameras_near_heightmap">
<static>true</static>
<pose>0 2 5.2 0 0 0</pose>
<link name="link">
Expand Down Expand Up @@ -124,5 +124,65 @@
</link>
</model>

<!-- model with two wide-angle cameras, with and without lens flare plugin -->
<model name="wide_angle_cameras_above_heightmap">
<static>true</static>
<pose>0 2 11.0 0 0 0</pose>
<link name="link">
<visual name="visual">
<geometry>
<box>
<size>0.1 0.1 0.1</size>
</box>
</geometry>
</visual>
<sensor name="camera_sensor_lensflare" type="wideanglecamera">
<camera>
<horizontal_fov>1.047</horizontal_fov>
<image>
<width>320</width>
<height>240</height>
</image>
<clip>
<near>0.1</near>
<far>100</far>
</clip>
<lens>
<type>gnomonical</type>
<scale_to_hfov>true</scale_to_hfov>
<cutoff_angle>1.5707</cutoff_angle>
<env_texture_size>512</env_texture_size>
</lens>
</camera>
<always_on>1</always_on>
<update_rate>25</update_rate>
<visualize>true</visualize>
<plugin name="lensflare" filename="libLensFlareSensorPlugin.so"/>
</sensor>
<sensor name="camera_sensor_without_lensflare" type="wideanglecamera">
<camera>
<horizontal_fov>1.047</horizontal_fov>
<image>
<width>320</width>
<height>240</height>
</image>
<clip>
<near>0.1</near>
<far>100</far>
</clip>
<lens>
<type>gnomonical</type>
<scale_to_hfov>true</scale_to_hfov>
<cutoff_angle>1.5707</cutoff_angle>
<env_texture_size>512</env_texture_size>
</lens>
</camera>
<always_on>1</always_on>
<update_rate>25</update_rate>
<visualize>true</visualize>
</sensor>
</link>
</model>

</world>
</sdf>

0 comments on commit 7be87db

Please sign in to comment.