Execute V-REP without GUI via ssh

Report crashes, strange behaviour, or apparent bugs
sergi
Posts: 4
Joined: 10 Jan 2014, 17:46

Execute V-REP without GUI via ssh

Post by sergi »

Hi,

I want to run V-REP on a remote computer via ssh, but I get the following error when I run it there:
$ ./vrep.sh -h

QXcbConnection: Could not connect to display
Aborted (core dumped)

If I connect to the remote computer via ssh -X (X11 server activated) then the application runs, but if the connection with the remote computer dies then the application dies, even if I use "screen". Somehow it seems that even that no GUI is being activated V-REP is using the X11. This is the error that I get when I re-connect using "screen":

The X11 connection broke (error 1). Did the X11 server die?

Thanks in advance,

Sergi.

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: Execute V-REP without GUI via ssh

Post by coppelia »

Hello Sergi,

the current headless mode has the exact same dependency libraries as the normal mode (i.e. openGl, Qt Gui, etc.). In future we will prepare a special version that doesn't realy at all on those.

Cheers

sergi
Posts: 4
Joined: 10 Jan 2014, 17:46

Re: Execute V-REP without GUI via ssh

Post by sergi »

Hi,

I understand. Thanks.

Sergi.

rezama
Posts: 14
Joined: 29 Sep 2014, 20:49

Re: Execute V-REP without GUI via ssh

Post by rezama »

This issue affects me as well. I work on optimization problems and I would like to run v-rep simulations on remote computers in a cluster.

Are there any plans to make this possible in the near future?

Thanks

rezama
Posts: 14
Joined: 29 Sep 2014, 20:49

Re: Execute V-REP without GUI via ssh

Post by rezama »

I was able to run v-rep on a remote computer using Xvfb and I thought I'd share the solution with other users who might visit this page.

If the remote server has the xvfb package installed, you can run v-rep over ssh using:

Code: Select all

xvfb-run --auto-servernum --server-num=1 ./vrep.sh -h -s -q myscene.ttt
Another problem I ran into was using vision sensors, which use GPU rendering and therefore need the GLX extension on the X server. Fortunately, if the remote server has the libgl1-mesa-dri package installed, there is a way to get around that as well:

Code: Select all

xvfb-run --auto-servernum --server-num=1 -s "-screen 0 640x480x24" ./vrep.sh -h -s -q myscene.ttt
It would be nice if future versions of v-rep offer better headless support out of the box (not needing an X server or a GPU to be present.)

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: Execute V-REP without GUI via ssh

Post by coppelia »

Thanks for the info!

Cheers

kleinash
Posts: 112
Joined: 28 Sep 2014, 09:58

Re: Execute V-REP without GUI via ssh

Post by kleinash »

rezama wrote:rezama
Upvote @rezama!!

jessica
Posts: 10
Joined: 06 Oct 2015, 16:03

Re: Execute V-REP without GUI via ssh

Post by jessica »

Hey rezama,
I'm trying to run my stuff on the cluster headless using your method, but I only get blank images from the vision sensor topic... Can you tell me how you are publishing the image topics?
This is the part in my childscript where I enable the publisher:

visHandle = simGetObjectHandle('visionSensor')
simExtROS_enablePublisher( 'get_vis_sens', 1, simros_strmcmd_get_vision_sensor_image, visHandle, -1, '')

Thanks in advance!

rezama
Posts: 14
Joined: 29 Sep 2014, 20:49

Re: Execute V-REP without GUI via ssh

Post by rezama »

I'm using:

Code: Select all

VISION_SENSOR = simGetObjectHandle("VisionSensor")
local image_buffer = simGetVisionSensorImage(VISION_SENSOR)

jessica
Posts: 10
Joined: 06 Oct 2015, 16:03

Re: Execute V-REP without GUI via ssh

Post by jessica »

Hey,
thank you so much for the reply!
But this is of your child script right? How are you transmitting this image data from Vrep to ROS?

Post Reply