Skip to content

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented Apr 28, 2025

🦟 Bug fix

Fixes gazebosim/gz-rendering#1122

Summary

Light visuals (green lines) were always created, even on server side where sensors are enabled. Looks like a regression introduced in #1818. This PR adds the if (!this->dataPtr->enableSensors) check back to make sure we only create light visuals if sensors are not enabled.

This was causing segmentation camera to crash if the light visual is in its view (see gazebosim/gz-rendering#1122).

To Test:

Apply this diff below to segmentation_camera.sdf to position the directional light in the view of the segmentation camera. With the changes in this PR, gz sim should no longer crash.

diff --git a/examples/worlds/segmentation_camera.sdf b/examples/worlds/segmentation_camera.sdf
index c5f4df7de..10cf19963 100644
--- a/examples/worlds/segmentation_camera.sdf
+++ b/examples/worlds/segmentation_camera.sdf
@@ -158,7 +158,8 @@
 
     <light type="directional" name="sun">
       <cast_shadows>true</cast_shadows>
-      <pose>0 0 10 0 0 0</pose>
+      <visualize>true</visualize>
+      <pose>0 0 2 0 0 0</pose>
       <diffuse>0.8 0.8 0.8 1</diffuse>
       <specular>0.2 0.2 0.2 1</specular>

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

Signed-off-by: Ian Chen <ichen@openrobotics.org>
@github-project-automation github-project-automation bot moved this from Inbox to In review in Core development Apr 28, 2025
@ahcorde ahcorde enabled auto-merge (squash) April 28, 2025 22:03
@iche033 iche033 disabled auto-merge April 28, 2025 23:01
@iche033 iche033 merged commit 6444e71 into main Apr 28, 2025
7 of 9 checks passed
@iche033 iche033 deleted the gui_light_visual branch April 28, 2025 23:01
@github-project-automation github-project-automation bot moved this from In review to Done in Core development Apr 28, 2025
@iche033
Copy link
Contributor Author

iche033 commented Apr 28, 2025

@Mergifyio backport gz-sim9 gz-sim8

@mergify
Copy link
Contributor

mergify bot commented Apr 28, 2025

backport gz-sim9 gz-sim8

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Apr 28, 2025
Signed-off-by: Ian Chen <ichen@openrobotics.org>
(cherry picked from commit 6444e71)
mergify bot pushed a commit that referenced this pull request Apr 28, 2025
Signed-off-by: Ian Chen <ichen@openrobotics.org>
(cherry picked from commit 6444e71)
iche033 added a commit that referenced this pull request Apr 29, 2025
Signed-off-by: Ian Chen <ichen@openrobotics.org>
(cherry picked from commit 6444e71)
iche033 added a commit that referenced this pull request Apr 29, 2025
Signed-off-by: Ian Chen <ichen@openrobotics.org>
(cherry picked from commit 6444e71)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🪵 jetty Gazebo Jetty

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants