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 -0600

InsistXU gravatar image

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

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 imagegvdhoorn ( 2019-12-10 05:52:24 -0600 )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 imageInsistXU ( 2019-12-10 06:29:12 -0600 )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 imageMartin Günther ( 2019-12-10 07:22:00 -0600 )edit

1 Answer

Sort by » oldest newest most voted
0

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

@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 imageInsistXU ( 2019-12-13 22:57:24 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 44 times

Last updated: Dec 10 '19