Skip to content

fix(thermal_camera): Fixed Gaussian noise for thermal camera.#597

Merged
iche033 merged 4 commits intogazebosim:gz-sensors8from
peci1:patch-3
Mar 18, 2026
Merged

fix(thermal_camera): Fixed Gaussian noise for thermal camera.#597
iche033 merged 4 commits intogazebosim:gz-sensors8from
peci1:patch-3

Conversation

@peci1
Copy link
Copy Markdown
Contributor

@peci1 peci1 commented Mar 17, 2026

🦟 Bug fix

Summary

Thermal camera with Gaussian noise segfaults like this:

(2026-03-17 14:28:15.239) [error] [Noise.cc:63] Image noise requested. Please use ImageNoiseFactory::NoiseModel instead
Stack trace (most recent call last) in thread 685223:
#9    Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in 
#8    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x76f339322c6b, in 
#7    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x76f339295aa3, in 
#6    Object "/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x76f33423ddb3, in 
#5    Object "/opt/ros/kilted/opt/gz_sim_vendor/lib/gz-sim-9/plugins/libgz-sim-sensors-system.so", at 0x76f311be23ce, in 
#4    Object "/opt/ros/kilted/opt/gz_sim_vendor/lib/libgz-sim9-rendering.so.9", at 0x76f311b451eb, in gz::sim::v9::RenderUtil::Update()
#3    Object "/opt/ros/kilted/opt/gz_sim_vendor/lib/gz-sim-9/plugins/libgz-sim-sensors-system.so", at 0x76f311beabed, in 
#2    Object "/opt/ros/kilted/opt/gz_sim_vendor/lib/gz-sim-9/plugins/libgz-sim-sensors-system.so", at 0x76f311bed4c0, in 
#1    Object "/opt/ros/kilted/opt/gz_sensors_vendor/lib/libgz-sensors9-thermal_camera.so.9", at 0x76f311a83607, in gz::sensors::v9::ThermalCameraSensor::SetScene(std::shared_ptr<gz::rendering::v9::Scene>)
#0    Object "/opt/ros/kilted/opt/gz_sensors_vendor/lib/libgz-sensors9-thermal_camera.so.9", at 0x76f311a7d146, in 
Segmentation fault (Address not mapped to object [(nil)])

This PR fixes it by correctly using ImageNoiseFactory instead of NoiseFactory. This was probably forgotten in 6a00a58 .

This PR also adds the skipping of noise in case it is zero, as was done in #450 for other camera types.

Checklist

  • Signed all commits for DCO
  • Added a screen capture or video to the PR description that demonstrates the fix (as needed)
  • 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)
  • Updated Bazel files (if adding new files). Created an issue otherwise.
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers
  • Was GenAI used to generate this PR? If so, make sure to add "Generated-by" to your commits. (See this policy for more info.)

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

Backports: If this is a backport, please use Rebase and Merge instead.

Signed-off-by: Martin Pecka <peci1@seznam.cz>
@peci1 peci1 requested a review from iche033 as a code owner March 17, 2026 15:53
@github-actions github-actions bot added the 🎵 harmonic Gazebo Harmonic label Mar 17, 2026
peci1 added 2 commits March 17, 2026 17:05
Signed-off-by: Martin Pecka <peci1@seznam.cz>
Signed-off-by: Martin Pecka <peci1@seznam.cz>
Copy link
Copy Markdown
Contributor

@iche033 iche033 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes here look good, thanks for the fix! Not sure if the noise will actually be applied to the thermal cameras though. We may need to extend gz-rendering with a custom render pass that adds gaussian noise to kelvin values instead of RGB values. Similar to special handling done by the ogre2 depth camera in gz-rendering

@github-project-automation github-project-automation bot moved this from Inbox to In review in Core development Mar 17, 2026
Signed-off-by: Martin Pecka <peci1@seznam.cz>
@iche033 iche033 merged commit 0e561e3 into gazebosim:gz-sensors8 Mar 18, 2026
9 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in Core development Mar 18, 2026
@iche033
Copy link
Copy Markdown
Contributor

iche033 commented Mar 18, 2026

@Mergifyio backport gz-sensors9 gz-sensors10 main

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Mar 18, 2026

backport gz-sensors9 gz-sensors10 main

✅ Backports have been created

Details

mergify bot pushed a commit that referenced this pull request Mar 18, 2026
Signed-off-by: Martin Pecka <peci1@seznam.cz>
(cherry picked from commit 0e561e3)
mergify bot pushed a commit that referenced this pull request Mar 18, 2026
Signed-off-by: Martin Pecka <peci1@seznam.cz>
(cherry picked from commit 0e561e3)
mergify bot pushed a commit that referenced this pull request Mar 18, 2026
Signed-off-by: Martin Pecka <peci1@seznam.cz>
(cherry picked from commit 0e561e3)
iche033 pushed a commit that referenced this pull request Mar 18, 2026
Signed-off-by: Martin Pecka <peci1@seznam.cz>
(cherry picked from commit 0e561e3)
iche033 pushed a commit that referenced this pull request Mar 18, 2026
Signed-off-by: Martin Pecka <peci1@seznam.cz>
(cherry picked from commit 0e561e3)
iche033 pushed a commit that referenced this pull request Mar 18, 2026
Signed-off-by: Martin Pecka <peci1@seznam.cz>
(cherry picked from commit 0e561e3)
@iche033
Copy link
Copy Markdown
Contributor

iche033 commented Mar 18, 2026

@Mergifyio backport ign-sensors6

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Mar 18, 2026

backport ign-sensors6

✅ Backports have been created

Details

mergify bot pushed a commit that referenced this pull request Mar 18, 2026
Signed-off-by: Martin Pecka <peci1@seznam.cz>
(cherry picked from commit 0e561e3)
iche033 pushed a commit that referenced this pull request Mar 19, 2026
Signed-off-by: Martin Pecka <peci1@seznam.cz>
(cherry picked from commit 0e561e3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🎵 harmonic Gazebo Harmonic

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants