ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

When running ROS on the Linux subsystem of Windows 10, the terminal cannot communicate normally.

asked 2019-12-10 05:01:35 -0500

InsistXU gravatar image

updated 2019-12-10 07:13:21 -0500

Process: This is the process of installing the subsystem in Windows 10. https://docs.microsoft.com/en-us/wind...

After I successfully installed ROS, I ran roscore normally. When I created a new terminal, I ran rosrun turtlesim turtlesim_node and it showed QXcbConnection: Could not connect to display Aborted (core dumped). Therefore, I suspect that the two terminals I opened in Windows 10 are not communicating normally. Q: How can I make two terminals running on Windows 10 communicate normally? Personal Note: Now that Windows 10 has added the Linux subsystem, and Windows 10 and Linux can communicate with each other, I believe there will be great development prospects in the future.

edit retag flag offensive close merge delete

Comments

2

QXcbConnection: Could not connect to display

This error typically means that you either don't have a running X server, or you haven't configured your X client correctly to use it.

Do you have an X server installed and running on Windows 10?

WSL does not include an X server.

gvdhoorn gravatar image gvdhoorn  ( 2019-12-10 05:52:24 -0500 )edit

Thanks,i solve my question by run vim ~/.bashrc add QT_QPA_PLATFORM='offscreen' run source ~/.bashrc But I found a new problem, that is, after running rosrun turtlesim turtlesim_node, no image will be displayed, only Spawning turtle [turtle1] at x = [5.544445], y = [5.544445], theta = [0.000000], of course This is not accidental, and rqt_graph is also unable to generate images. However, everything works fine in the virtual machine, and the subsystem and virtual machine use are both Ubuntu 16.04, and QT is the same version.

InsistXU gravatar image InsistXU  ( 2019-12-10 06:29:12 -0500 )edit

QT_QPA_PLATFORM='offscreen' turns the image off, so that is why it works but no image is displayed. @gvdhoorn is right, you need to install an X server on Windows, like XMing, Cygwin X or vcXsrv.

Martin Günther gravatar image Martin Günther  ( 2019-12-10 07:22:00 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2019-12-10 07:29:43 -0500

@gvdhoorn is right, you need to install an X server on Windows, like XMing, Cygwin X or vcXsrv. This tutorial explains it in detail.

I'm copying the relevant part here for archival purposes:

To run applications with graphical output, you need to install an X Server on Windows. To me, VcXsrv now works best.

After you have installed VcXsrv, you also need to configure WSL to use it. To do so modify you .bashrc as follows

echo "export DISPLAY=:0" >> ~/.bashrc
source ~/.bashrc

Finally, launch VcXsrv from the start menu. You can keep all default settings except "Native opengl" which needs to be unchecked. Otherwise applications such as rviz do not run as expected.

edit flag offensive delete link more

Comments

Thanks for your help,

InsistXU gravatar image InsistXU  ( 2019-12-13 22:57:24 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2019-12-10 05:01:35 -0500

Seen: 1,314 times

Last updated: Dec 10 '19