WSL rviz display error when launching application (qt.qpa.screen) - ubuntu-18.04

I am using ROS Melodic on Ubuntu 18.04 with gazebo9 and Xlaunch. I have been able to launch an empty workspace of gazebo but for some reason when I run rosrun rviz rviz, I get this error message:
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
qt.qpa.screen: QXcbConnection: Could not connect to display
Could not connect to any X display.
I have roscore running with no errors, so I dont believe its that which is causing the problem
This is the full script:
Gazebo
root#DESKTOP-GFT05HU:/mnt/c/Users/Frank# export GAZEBO_IP=127.0.0.1
root#DESKTOP-GFT05HU:/mnt/c/Users/Frank# export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0
root#DESKTOP-GFT05HU:/mnt/c/Users/Frank# export LIBGL_ALWAYS_INDIRECT=0
root#DESKTOP-GFT05HU:/mnt/c/Users/Frank# gazebo
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function
snd_func_card_driver returned error: No such file or
directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function
snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function
snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default
AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device 'default': No such file or directory
[Err] [REST.cc:205] Error in REST request
libcurl: (51) SSL: no alternative certificate subject name matches target host name 'api.ignitionfuel.org'
Rviz:
root#DESKTOP-GFT05HU:/mnt/c/Users/Frank# rosrun rviz rviz
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
qt.qpa.screen: QXcbConnection: Could not connect to display
Could not connect to any X display.

Since WSL runs on top of the windows hypervisor you should treat the terminal like it has no direct knowledge of your display. To get this to work you need to do 2 things.
You need to download a windows X Server client. I personally use XMing.
Set your environment variable DISPLAY. Such as export DISPLAY=localhost:0.0
Edit: After doing some digging this issue is caused by how libGL interacts with the specific x server you're running. You have two options to fix this:
You run XMing instead of of XLaunch
If you want to keep using XLaunch under the "Additional Parameters for VcXsrv" add -nowgl

For me the solution was as simple as updating my WSL2 (Run Linux GUI apps on the Windows Subsystem for Linux)

Related

snmpd not found issue?

I've installed the net-snmp package (version 5.8) by downloading the tar.gz file and compiling the files inside on a RHEL server (version 6.9).
I can see that the package is installed when I type snmpd --version but whenever I try to use service snmpd restart it says snmpd: unrecognized service.
I did all the setups and the snmpd.conf file was created (but not at /etc/snmp/ for some reason initially, so I copied the file there) but it seems like snmpd isn't being recognized at all.
I even tried snmpd restart but nothing happens and it seems like the SNMP connection still isn't there either.
Is there a way to fix this issue? Thanks!

Daydream View Controller Emulator won't work with Google VR SDK 1.1 and Unity 5.6 beta for Linux

I can't get the controller emulator to work with Google VR SDK 1.1 & Unity 5.6b3 under Arch Linux 64-bit. If I load the GVRDemo scene in Unit and click the play button to enter Play Mode, the console shows the following:
"Android Debug Bridge (adb) command not found.
Verify that the Android SDK is installed and that the directory containing adb is included in your PATH environment variable."
In Windows, you have to add the directory containing the Android Debug Bridge (adb) program to the PATH environment variable in Windows itself (not in the Unity program). Once you do that, the Controller Emulator works fine in Windows. You have to do the same in Linux, evidently, to get Unity to locate adb, and therefore get the Controller Emulator phone working for testing the game.
I've added the following line in my .bashrc and .profile files in my home directory:
"PATH=/home/jesse/Android/Sdk/platform-tools/:$PATH"
This, however, doesn't fix the issue.
I've also added the root directory of the Android SDK to my Unity Preferences > External Tools section.
I don't know how to get Unity and Google VR SDK to recognize the directory containing adb to the PATH environment variable that Unity needs to make the Controller Emulator work.
Is anyone else having this issue? Is there a fix or work-around?
I was able to locate the culprit and modify Google VR SDK scripts to make it work! Turns out there was an issue in the code of the script file titled "EmulatorClientSocket.cs" regarding non-Windows machines. Here's what I changed, and why:
Originally, in line 111 and 112 of this script, it read:
stringprocessFilename="bash";
stringprocessArguments = string.Format(" -l -c \"{0}\"", adbCommand);
The context is that when Windows is not present (forgive my layman's terms -- I've only started learning coding a month ago) the command to process is this: bash -l -c "adb forward tcp:7003 tcp:7003". The problem is when the -l option is used in the command, the command is interpreted as if coming from a login shell, which - I believe - means that bash isn't looking at the custom environment variables set in the user's .bashrc and .profile files in their home directory. Without looking at those files, bash can't locate the adb command (try running the bold command above in a terminal, and the result will be a prompt saying adb command not found).
To fix it, I simply removed the -l option from line 112, and, voila! Everything works like a charm! Lines 111 and 112 now look like this:
stringprocessFilename="bash";
stringprocessArguments = string.Format(" -c \"{0}\"", adbCommand);
The fix will work when running "unity-editor" or "unity-editor-beta" from the Terminal or Xterm, but running it from the application menu will still produce the adb error and Controller Emulator will not work.

libvlc: Error loading script http.lua

I downloaded vlc-2.2.1 source code and compiled it after a long struggle. Now, when I run it as ./vlc from the source directory, it shows the following error and vlc window does not show up.
VLC media player 2.2.1 Terry Pratchett (Weatherwax) (revision 2.2.1-0-ga425c42)
[08258920] [http] lua interface error: Error loading script /home/ezio/vlcLib/vlc-2.2.1/share/lua/intf/http.luac: /home/ezio/vlcLib/vlc-2.2.1/share/lua/intf/http.luac: bad header in precompiled chunk
[081a2b18] core libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[082338b0] [cli] lua interface error: Error loading script /home/ezio/vlcLib/vlc-2.2.1/share/lua/intf/cli.luac: /home/ezio/vlcLib/vlc-2.2.1/share/lua/intf/cli.luac: bad header in precompiled chunk
I needed the web interface functionality of vlc. So, I configured ~/.config/vlc/vlcrc as
#### Extra interface modules (string)
extraintf=http
How can I fix this error ?
NOTE:
I have vlc 2.1.6 installed in my computer,
it works fine
VLC media player 2.1.6 Rincewind (revision 2.1.6-0-gea01d28)
[0x8fd3718] [http] lua interface: Lua HTTP interface
[0x8fc3910] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
"sni-qt/29618" WARN 13:36:25.965 void StatusNotifierItemFactory::connectToSnw() Invalid interface to SNW_SERVICE

mount using nfs4 giving no such device error

I am trying to mount a folder workspace from server to the client over nfs. For this I bind the folder to an /export by adding the following in my /etc/fstab on server:
/home /export none bind
Then I add the following lines in my /etc/exports on my server:
/export *(ro,sync,no_subtree_check,insecure,fsid=0)
/export/workspace *(rw,sync,no_subtree_check,insecure,nohide)
I load the exportfs file, and restart the nfs-kernel-server:
exportfs -vr
service nfs-kernel-server restart
I now go to my client and check which folders can be exported:
showmount -e 192.168.145.131
Export list fo 192.168.145.131:
/export/workspace *
/export *
But when I try mounting the folder, I get the following error:
sudo mount -t nfs4 192.168.145.131:/workspace nfs/ -v
mount.nfs4: timeout set for Sat Apr 19 19:16:51 2014
mount.nfs4: trying text-based options 'addr=192.168.145.131,clientaddr=192.168.145.128'
mount.nfs4: mount(2): No such device
mount.nfs4: No such device
I have also tried mounting :/export/workspace and :/home/workspace but that gives me the same error. I have tried loading the nfs module using modprobe on both client and server, but the module is loaded on both client and server.
Any help would be much appreciated. Thanks.
Solved the problem after 3 days!!
I tried mounting the nfs4 server folder from a client with a newer Kernel version (3.8). I was able to do so. So I copied the configuration file /boot/configure-3.8-generic file to my /usr/src/.config, and enabled the option Filesystems -> Network File Systems -> NFS3 client load as module and NFS4 client load as module.
compiled my kernel again, created initrd image, updated grub, and now I am able to mount the server folder from my 2.6 kernel client also!

DocBlox error: The XSL writer was unable to find your XSLTProcessor

I am using WAMP on my local machine and I'm trying to use docblox to generate documentation for a project.
When i try to run the docblox command in my command prompt for a file that has the necessary comments, I get the error message.
C:\wamp\www\wm-ppclps>docblox run -f wm-ppclps.php -t documentation
DocBlox version 0.18.1
Starting transformation of files (this could take a while depending upon the size of your project)
ERROR: The XSL writer was unable to find your XSLTProcessor; please check if you
have installed the PHP XSL extension
I have no idea why this is error message is appearing. The command creates the documentation folder, parses the source code and it produces the structure.xml file. It just won't transform the structure into an HTML file or any other readable file.
I added the PHP install directory to my system path, I installed PEAR system wide, added PEAR install directory to my system path, installed DocBlox using the docblox pear channel, I have the necessary environment variables setup. I uncommented the php.ini line to enable the php_xsl.dll extension for WAMP and restarted WAMP. When I view the phpinfo, i see that the XSL extension is enabled (XSL version 1.1.23, compiled against libxml version 2.6.32, EXSLT enabled).
Does anyone have any idea why this is happening, has come across this problem or can point me in the right direction for an answer?
The error that you are receiving means that php does not recognize the xsl extension.
Php has got a separate ini file for CLI and web; and I presume that you have enabled the xsl extension for apache only.
You can verify this by executing php -i in your command prompt and check if the xsl extension is enabled there. If not then add your dll to the right config for your WAMP.

Resources