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

Thermal Camera - Inconsistent Background Behavior #205

Closed
adlarkin opened this issue Jan 21, 2021 · 1 comment · Fixed by #189
Closed

Thermal Camera - Inconsistent Background Behavior #205

adlarkin opened this issue Jan 21, 2021 · 1 comment · Fixed by #189
Assignees

Comments

@adlarkin
Copy link
Contributor

Following the thermal camera tutorial results in a different background appearance between the ign-rendering3 and ign-rendering4 branches.

Here's the result of running ign gazebo thermal_camera.sdf with ign-rendering3:
rendering3

Here's the result of running ign gazebo thermal_camera.sdf with ign-rendering4:
rendering4

It appears that this behavior is caused by different visibility flags being assigned to non-temperature visuals. For example, if the following change is made to Ogre2ThermalCamera.cc, it shows that non-temperature visuals have a visibility flag of 0x3fffffff in ign-rendering4, but are 0x0fffffff in ign-rendering3:

diff --git a/ogre2/src/Ogre2ThermalCamera.cc b/ogre2/src/Ogre2ThermalCamera.cc
index 012e0f23..9fddf0ad 100644
--- a/ogre2/src/Ogre2ThermalCamera.cc
+++ b/ogre2/src/Ogre2ThermalCamera.cc
@@ -231,6 +231,11 @@ void Ogre2ThermalCameraMaterialSwitcher::preRenderTargetUpdate(
           }
         }
       }
+      else
+      {
+        ignerr << "non temp object, has the following visibility flags: " << std::hex
+          << item->getVisibilityFlags() << "\n";
+      }
     }
     itor.moveNext();
   }

Since the thermal camera's visibility flag is 0x10000000, this means that the background (which doesn't have a temperature visual) is visible in ign-rendering4, but not in ign-rendering3 (a visual can be seen by the thermal camera if the result of ANDing the visual's visibility flag with the thermal camera's visibility flag is a flag with non-zero bits).

@chapulina
Copy link
Contributor

Addressed in #189

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants