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

Map rendering fails #453

Closed
rotu opened this issue Aug 26, 2019 · 8 comments · Fixed by #459
Closed

Map rendering fails #453

rotu opened this issue Aug 26, 2019 · 8 comments · Fixed by #459

Comments

@rotu
Copy link
Contributor

rotu commented Aug 26, 2019

RViz is failing to display a map and is spitting out OpenGL errors "GL_INVALID_OPERATION" (see log below). I'm using ROS2 Eloquent master and the latest RViz built from source.

The map is size 567 x 329 and the map data is indeed the correct size for the dimensions.

Notice the map is black in the RViz display:
Screenshot from 2019-08-26 15-01-13

[rviz2-1] [INFO] [rviz]: [signalFailure] Drop message: frame 'lidar_link' at time 1566847715.955 for reason(0)
[rviz2-1] [INFO] [rviz2]: Trying to create a map of size 202 x 161 using 1 swatches
[rviz2-1] [ERROR] [rviz2]: Vertex Program:rviz/glsl120/indexed_8bit_image.vert Fragment Program:rviz/glsl120/indexed_8bit_image.frag GLSL link result : 
[rviz2-1] active samplers with a different type refer to the same texture image unit
[rviz2-1] [ERROR] [rviz2]: Error prior to using GLSL Program Object : GL_INVALID_OPERATION
[rviz2-1] active samplers with a different type refer to the same texture image unit
[rviz2-1] [ERROR] [rviz2]: Error prior to using GLSL Program Object : GL_INVALID_OPERATION
[rviz2-1] active samplers with a different type refer to the same texture image unit
[rviz2-1] [ERROR] [rviz2]: Error prior to using GLSL Program Object : GL_INVALID_OPERATION
[rviz2-1] active samplers with a different type refer to the same texture image unit
[rviz2-1] [ERROR] [rviz2]: Error prior to using GLSL Program Object : GL_INVALID_OPERATION
[rviz2-1] active samplers with a different type refer to the same texture image unit
[rviz2-1] [ERROR] [rviz2]: Error prior to using GLSL Program Object : GL_INVALID_OPERATION
[rviz2-1] active samplers with a different type refer to the same texture image unit
[rviz2-1] [ERROR] [rviz2]: Error prior to using GLSL Program Object : GL_INVALID_OPERATION
@bpwilcox
Copy link

I was just about to file an issue for this. I am not receiving the same OpenGL errors, however the map is not rendered properly. Like your example, the map shows up with proper dimensions however it is all black:
initialtb3world

After adding the map topic to be visualized a second time (so there are now two duplicate map topics being visualized), the map renders however it is inverted (black should be free space (white), white should be unknown (gray), and gray should be occupied (black))
aftertb3world

I checked out the branch before and after PR #394 went in and saw that the map rendered fine, so it appears there is some bug introduced in the changes to upgrade to Ogre 1.12.1

@Martin-Idel
Copy link
Contributor

This is definitely the upgrade. It's reproducible via the visual test (map_display_visual_test). I ran the visual tests and I thought I caught all failures manually (see #454 for why there are failures in the first place...), but rechecking shows that the map display indeed fails.

Since there were no changes to the map display, this seems to be an Ogre-internal issue or a problem with the shader since the shader doesn't link correctly. Since I proposed the upgrade I'll do a bisect on the Ogre code.

@Martin-Idel
Copy link
Contributor

Martin-Idel commented Aug 28, 2019

So I did the bisect as promised. The problem seems to be this commit (very early - it's before 1.11.0 and just after 1.10.12): OGRECave/ogre@17800a4.

If you like, you can confirm this yourself by changing the two lines in

URL https://github.com/OGRECave/ogre/archive/v1.12.1.zip
URL_MD5 cdbea4006d223c173e0a93864111b936

to

   URL https://github.com/OGRECave/ogre/archive/b8eafb9c5044f0526461bb8fa3bdef034620ba33.zip
   URL_MD5 925171bb3f910233d34ae0e04cb086f5

No other changes are required on Ubuntu (on Windows you'll have to disable the special patch introduced in the upgrade commit) - fortunately the problem occurs in a region where all the new API was already introduced. With this change, the map_display_visual_test runs as it should (and the map display should hopefully function as before), while if I change it to the next commit

    URL https://github.com/OGRECave/ogre/archive/17800a4d1887d3498e7862328d2d731d44262a78.zip
    URL_MD5 c9b341dffe2bd851c2a3bc0804bb483a

the visual test fails with the pattern reported here.

I thought it was an upstream bug (reported here: OGRECave/ogre#1252), but it's probably a usage error, so I'll see what we can do.

@lbegani
Copy link

lbegani commented Aug 30, 2019

    URL https://github.com/OGRECave/ogre/archive/17800a4d1887d3498e7862328d2d731d44262a78.zip
    URL_MD5 c9b341dffe2bd851c2a3bc0804bb483a

I get following compilation errors after making above changes -

--- stderr: rviz_ogre_vendor
CMake Error at OgreMain/CMakeLists.txt:76 (include_directories):
  include_directories given empty-string as include directory.
make[2]: *** [ogre-v1.12.1-prefix/src/ogre-v1.12.1-stamp/ogre-v1.12.1-configure] Error 1
make[1]: *** [CMakeFiles/ogre-v1.12.1.dir/all] Error 2
make: *** [all] Error 2
---

@Martin-Idel
Copy link
Contributor

Ah, that's a missing dependency that was (mistakenly) a required dependency for some time: zzib (libzzib-dev on Ubuntu). I forgot that I had it installed for quite some time.

@Martin-Idel
Copy link
Contributor

@rotu @bpwilcox I have a PR fixing the issue on my machine, maybe you can confirm?

@bpwilcox
Copy link

bpwilcox commented Sep 4, 2019

@Martin-Idel I tried your fix on my machine today, it is working :)

@Martin-Idel
Copy link
Contributor

@bpwilcox Thanks, then I'm really confident I found the issue and the visual test does what it should!

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.

4 participants