Ask Your Question
1

Running rviz with VNC on a remote computer

asked 2018-07-26 01:21:42 -0500

Subodh Malgonde gravatar image

I am developing a robot which uses Odroid XU4 as its onboard computer. It has a headless setup i.e. no monitor, keyboard and mouse. For testing purposes I SSH into the machine, which runs Ubuntu Mate 18.04, and start the vncserver. Then using a VNC viewer application, I have remote desktop access to the machine.

Everything runs fine except rviz. When I try to run rviz (I run a ROS master process in another tab), I get the following error:

odroid@odroid:~/workspace/racecar$ rosrun rviz rviz 
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
The X11 connection broke: Unsupported extension used (code 2)
XIO:  fatal IO error 22 (Invalid argument) on X server ":1"
  after 6 requests (6 known processed) with 0 events remaining.

I have seen solutions where Rviz is run on the local machine and all other nodes are run on remote computer. However my local machine is a Mac which does not have a ROS installation. Is there any way I can get Rviz to run on the remote computer?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-07-26 01:43:10 -0500

destogl gravatar image

Hi,

yes the usual setup is to have rviz running locally because in this way one gets best responsiveness and no loss of data. I am successfully using ssh -X command. But to be honest it is not so responsive..... Other, platform independent, possibility is to use mplayer an nc. for server we are using (running on your computer):

while true
do
nc -l -p 9000 | mplayer -benchmark -cache 1000 -framedrop -fs -
done

Client (funning on your robot):

ffmpeg -f x11grab -s ${resolution} -framerate 18 -i :0.0+${offset} -c:v libx264 -preset veryfast -tune zerolatency -pix_fmt yuv444p -x264opts crf=20:vbv-maxrate=3000:vbv-bufsize=100:intra-refresh=1:slice-max-size=1500:keyint=30:ref=1 -threads `nproc` -f mpegts - | nc ${server_host} ${server_port}

If you want to "play" there is also Homebrew installation of ROS on mac. (s. here)

edit flag offensive delete link more

Comments

Thanks. About the Homebrew installation on Mac, I have seen many users report issues on rviz, so I did not go for it. I haven't tried your approach. I decided to use a VM, which runs Ubuntu with a ROS installation. I run rviz on the VM and all other nodes on the remote machine.

Subodh Malgonde gravatar imageSubodh Malgonde ( 2018-07-26 05:45:24 -0500 )edit

Can you add your answer and mark the question as answered?

destogl gravatar imagedestogl ( 2018-07-26 06:50:52 -0500 )edit

Well my approach is not an answer to my question. My question is about running rviz on the remote computer. However my approach is to run rviz on the local computer (on Ubuntu VM on my Mac).

Subodh Malgonde gravatar imageSubodh Malgonde ( 2018-07-30 00:03:52 -0500 )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

2 followers

Stats

Asked: 2018-07-26 01:21:42 -0500

Seen: 636 times

Last updated: Jul 26 '18