-
Notifications
You must be signed in to change notification settings - Fork 822
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
ROS Gazebo black screen #3368
Comments
Hmmm, Sunil did say that, didn't he. "This tutorial" is a pretty big ask, given that it demonstrably does work out of the box and this isn't a WSL bug or even feature request. You are probably way better off asking your question wherever it is that ROS Gazebo people hang out. As a first step before I bite, see if you able to run
In VcXsrv choose multi-window and "Native opengl" unchecked (sic). If |
@IceSentry windows\ |
@therealkenc it was asked on gazebo answer http://answers.gazebosim.org/question/16888/gazebo-on-wsl-bash-for-windows/ which is actually how I came to the original issue on github. I did manage to see some gears with glxgears, unfortunately gazebo still shows a black screen. Although on my version of vcxsrv I don't see a native opengl checkbox. I use vcxsrv 1.20.0.0 from sourceforge @voskrese I have no idea what you want me to do |
glxgears gives me about 650 fps on vcxsrv 1.20 in native OpenGL mode on a comparatively slow Intel HD 4000 laptop GPU, about 1500 fps on an Intel HD 620 (two slow generations later) You can enable OpenGL mode on the vcxsrv side by running XLaunch; this will take you through a wizard which on its last page refers to the LIBGL_ALWAYS_INDIRECT environment variable ( Generally speaking, it would be nice to understand whether ROS gazebo actually does run with a native Linux and vcxsrv as the remote X server. |
With export LIBGL_ALWAYS_INDIRECT=1 gazebo simply doesn't launch. Also I made a mistake in my other comment, I was using an old version of xming. I tried it again with vcxsrv with native opengl and I had the same result. |
@IceSentry You wrote that you see a black screen, instead of anything, I assumed that you installed Xming\vcxsrv, just do not set it on the desired display, by default -1, and you need 0, if of course you passed the same settings in UNIX environment In general, you will get your own \Google translation )) |
Do not do that.
This is generally the prerequisite for posting here. Even then, monsters like ROS make for terrible use-cases for tracking down WSL bugs or feature gaps; since those bugs won't have to do with drawing pixels. An exception is being made since it was suggested to open an issue.
Start VcXsrv with XLaunch. You will see the checkbox on the third page of the wizard. In any case, against my better judgement I installed ROS (a short part of my life I'll never get back). Worked here out of the box with Ubuntu 16.04 and VcXsrv 1.20. Which is pretty much what I feared. n.b. I don't want to imply unchecking native gl is your magic bullet. I only know it lit up without incident for me. I am not sure the thing is actually usable, mind. I suspect Gazebo falls much into the same category as Blender on that front. |
I only just clicked though the gazebosim forum question. It is useful as an illustration (and future link target):
"It" was the wrong question, and went sideways in the first sentence. Like shoffmeister suggests, the procedure would be to run Gazebo in a Real Linux VM talking to a "remote" VcXsrv first, and if it doesn't work, that is the question you'd be asking on the Gazebo list (or any other list). "I'm running Gazebo in the cloud using VcXsrv as my remote X Server, and I get a black screen. Please help." Instead what the poster said was "I am surprised to how RPi is able render the visualization window, whereas WSL is unable to!" Which is going to get basically zero help from anyone unless you are lucky enough to find someone exceedingly patient. Because WSL, just like any headless box, doesn't render anything. |
I'm sorry if I wasted your time, I'm very new to all of this and since it was suggested in the other thread and I had a similar issue I made this thread. I know WSL isn't supposed to be used for GUI apps, but I've seen a few issues here talking about running gui apps through an xserver so I assumed it was in a kind of grey area. I will try to do a fresh wsl and gazebo install and see if it works. I'll also look into running gazebo on a But if I understand correctly you don't believe this is an issue with WSL and it is most likely with gazebo and/or the x server? |
Don't be. This isn't on you. It wasn't a waste. Yes it's a grey area.
Dunno, precisely, or I'd tell ya. I was kind of hoping We do know "WSL" (namely the kernel emulation layer that makes this whole thing go) is fine. Because it works, demonstrably. WSL doesn't even know you are talking to VcXsrv. All WSL knows is you are writing some bytes down a socket on localhost port 6000. It might be firewall related. I got quite a few popups to open ports. Try disabling your Windows firewall entirely and see if that helps. But we're grasping here. You might try XMing just to switch things up. That at least purturbs a variable (the X Server). You can also try running it remotely from inside a VM as an experiment, if you are feeling motivated or are looking for a time sink. But trying a given scenario (like Gazebo) in a VM is more valuable in the case where you know it doesn't work in WSL, and thus can start tracking down a diverge from the Real Thing. Here we know it does, so there is no diverge to discover. The possible outcomes of the experiment for you aren't pretty. Either it doesn't work in the VM, which leaves you exactly where you are right now (wondering why). Or it does work, which puts you in the unenviable position of trying to find out precisely what bits of your Real Linux userspace (Ubuntu + everything) differ from your WSL userspace (Ubuntu + everything). Which is "not easy", to put it mildly. One "last" shot: what does
If it's the same just say 'same' no need to paste the output. I'm just trying to guess variables. |
On the subject of using Fundamentally, using native OpenGL forces all OpenGL commands to be rendered on the remote server (i.e. the "box" which eventually shows the bits and bytes). One of the side-effects of that is that the OpenGL command stream forces use of the GLX protocol - and that only supports OpenGL 1.4 (see http://x.cygwin.com/docs/ug/using-glx.html) So, some experiments after
At no time am I able to see a black screen; something must be seriously broken elsewhere for that to happen (in case "black screen" is exactly what is visible) |
The probability of this being a WSL problem is very, very low, given the above. |
I have the same black screen problem, with a "preparing world" window on the front. I run it in xfce4. And the origin ubuntu commander output like this: (xfwm4:6656): xfwm4-WARNING **: Unmanaged net_wm_state (window 0xd00004, atom "_NET_WM_STATE_STAYS_ON_TOP") I also try the last shot glxinfo | grep OpenGL, and it returns the same. |
That warning is a window manager thing (xfce4) and won't be related. [Also, running a window manager serves no purpose, but I digress.] I think this one has about run its course. There are reports of the same behaviour on Real Linux. Try disabling the Windows firewall (there was no response to that suggestion), but that is mostly pissing on a spark plug. If |
@therealkenc thanks for spending time on this. I encountered the same issue that @IceSentry is seeing, and there's an easy solution:
I tried running this out of the box, and also saw a black render window, so I started with your suggestion:
With the firewall completely disabled, I still saw a black render window when following the normal gazebo bringup. This did appear to be related to the network configuration, though, as the gazebo server emits warnings about outgoing message queues filling up (nobody is receiving them). I also had the same issue when running as admin. Below is the repro that shows and then fixes the bug: From vanilla Windows 10 Pro x64 with Intel graphics:
linux$ sudo apt install xubuntu-desktop
linux$ sudo apt install mesa-utils`
linux$ export DISPLAY=:0
linux$ glxgears
linux$ curl -sSL http://get.gazebosim.org | sh
linux$ gazebo --verbose
What stands out here is the So, killing gazebo and exporting
I still see a lot of message errors, but this is unlikely a WSL-specific issue beyond networking config:
@therealkenc, as you said, it runs, but usability is still yet to be seen. |
OMG! I have had just tried this, and it really worked! In fact I launched it succeessfully before, with waiting for it about 20min, which made me thoroughly and finally give up. However, using your solution to launch seems much more normal and save me another 19min.
THANKS! A LOT!
|
Glad you got it working. 👍
Minor observation, setting aside Mentioning it mostly because I didn't personally set |
Ah, that's good clarification.
Gazebo looks like it's using
Yeah, I already had a ROS installation in my WSL (but not the machine I used for vanilla repro/debug), and it still failed in the same way. I don't think any package in |
The other, correct, IP addresses are listed in |
That's excellent information to add, thanks. Since it did "work" for me out of the box (possibly due to differences in my network rig) and, more practically, because I've long since wiped ROS/Gazebo, I |
Here you go (no shiny stars needed): This works on my native xubuntu 16.04 machine, fails on WSL with extra phantom interfaces that don't show up in
|
Okay. Unfortunately (?) your test doesn't repro for me here. I get " I can't think of a dupe off the cuff that would explain a fix since 17134 (usually I can if one exists, but that doesn't mean it doesn't exist). I don't have a 17134 handy to try. First step would be to try Insiders (fast ring not skip-ahead will do) and see if it reproduces there. Note also your |
OK. I don't think this is an issue with WSL. The issue seems to be that See here: https://github.com/jbohren-hbr/ifaddrs_test/blob/master/print_ifaddrs.cpp#L92 Test now passing, this can be put to rest. Need to create a PR on gazebo though... |
For completeness, Gazebo PR with fix is here: https://bitbucket.org/osrf/gazebo/pull-requests/3009/adding-check-to-make-sure-automatic/diff |
🌟 |
I have encountered same issue on Ubuntu Bionic, ROS Melodic and Gazebo 9 (running on virtual machine). I have 'solved' it by killing previously previously launched instance of gzserver. |
The same here. I've installed ROS-Melodic (full desktop) with Gazebo 9 on 3 different machines: 2 of them are with Ubuntu 18.04 and third one with WSL Ubuntu 18.04 (Windows 10). After a fresh install I get I've also noticed that it happens only when I open VPN connection |
It seems that a similar issue related to |
If I understand correctly (see ms-iot/ROSOnWindows#47 (comment)) the |
You are now caught up to above. |
Thanks! Sorry for noise due to skipping over the last comments. |
For me, setting DISPLAY to 0, 0.0, localhost:0 or 127.0.0.1 on a ubuntu windows linux sub system (WLS2) did all not work, I had to use the public IP and the following command helped me:
|
I use ROS Gazebo in WSL docker. For me, the network settings are correct, but I still see the blank screen. The reason is, Gazebo is downloading data silently in background, and I just need to wait for it to finish. I use this tutorial to setup ROS Gazebo in WSL docker. Gazebo is downloading data silently in background, see discussion in the forum.
Rerun |
For me the 'black screen in gazebo' fix was to install latest Intel driver |
For me follow the solution of @jbohren-hbr works only when I uninstall Xming and install vcxrv. |
Following this tutorial I managed to run ros on wsl with ubuntu 16.04 and Microsoft Windows [Version 10.0.17134.112]. However when launching gazebo with VcXsrv it gives a black screen where you should see the 3d model of the robot, but the rest of the UI is there and there is no error in the console.
I know WSL is supposed to be for command line tools, but there have been a few issues related to using gui apps through x server that have been resolved here.
I created this issue after reading #1450 where it was suggested to create a new issue for this.
The text was updated successfully, but these errors were encountered: