rviz and rqt_image_view in WSL shows void image topic, but rostopic echo on WSL works

asked 2020-12-28 04:21:21 -0600

mmp52 gravatar image

updated 2020-12-28 05:16:06 -0600

Hello,

I have a ros network composed of a ros melodic running roscore on a ubuntu 18.04 pc, and WSL on windows 10 also running ros melodic.

I have configured environmental variables on both machines, I have the following lines on my master pc's .bashrc: export ROS_MASTER_URI=http://192.168.1.4:11311 export ROS_IP=192.168.1.4

an the following on my slave (WSL) pc's .bashrc: export DISPLAY=l92.168.1.105:0 export ROS_MASTER_URI=http://192.168.1.4:11311 export ROS_IP=192.168.1.105 unset LIBGL_ALWAYS_INDIRECT

I have also configured xLaunch, I can export the visual stuff to xLaunch on my WSL pc.

Now, I have a sensor_msgs image topic published by my master pc, named /zed2/zed_node/left/image_rect_gray, and I can visualize the image in master pc either by rqt_image_view or rviz. I also can see the topic in my slave pc(WSL), I can even echo the topic (i.e. rostopic echo /zed2/zed_node/left/image_rect_gray works) but when I open rviz and try to add the image I can only see empty screen as if the image was not being published.

edit retag flag offensive close merge delete

Comments

I think this may have to do with X server and limitations with wsl. It puzzles me because you are able to see the topic.

When I look at the code for image_publisher is using opencv to publish but it uses cv bridge. However in wsl camera images can’t be read but it doesn’t give you a failure but it shows empty images. So one way is to go around will be to use xlib

https://github.com/ros-perception/ima...

osilva gravatar image osilva  ( 2021-09-11 20:46:24 -0600 )edit