Could not initialize OpenGL

Typically: "How do I... ", "How can I... " questions
jessica
Posts: 10
Joined: 06 Oct 2015, 16:03

Could not initialize OpenGL

Post by jessica » 21 Jun 2016, 10:29

Hi,
I'm trying to install "V-REP_PRO_EDU_V3_3_1_64_Linux" on a remote cluster, but I get this error message when I do ./vrep.sh:

Using the default Lua library.
Loaded the video compression library.
Could not initialize OpenGL for RasterGLSurface, reverting to RasterSurface.
Add-on script 'vrepAddOnScript-addOnScriptDemo.lua' was loaded.
Could not initialize OpenGL
Aborted (core dumped)

In my ~/.bahsrc I have this line:
export VREP_ROOT_DIR=/home/me/graphics/V-REP_PRO_EDU_V3_3_1_64_Linux

Any help would be appreciated! Thanks!

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

Re: Could not initialize OpenGL

Post by coppelia » 21 Jun 2016, 20:56

Hello Jessica,

can you try the workaround explained in this post?

Cheers

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

Re: Could not initialize OpenGL

Post by jessica » 27 Jun 2016, 15:04

Hey,
thanks a lot for the reply!
I tried the post you referred, now with:
xvfb-run --auto-servernum --server-num=1 ./vrep.sh -h -s -q my-sim.ttt
I can finally run vrep via ssh, but when I do
"rostopis list", still there is no topic coming from the vision sensor, not even when I run the following command as further suggested in the post:
xvfb-run --auto-servernum --server-num=1 -s "-screen 0 640x480x24" ./vrep.sh -h -s -q my-sim.ttt

Below is the message I get:
Using the default Lua library.
Add-on script 'vrepAddOnScript-addOnScriptDemo.lua' was loaded.
Simulator launched.
Plugin 'MeshCalc': loading...
Plugin 'MeshCalc': load succeeded.
Plugin 'BubbleRob': loading...
Plugin 'BubbleRob': load succeeded.
Plugin 'Collada': loading...
V-REP runs in headless mode. Cannot start 'Collada' plugin.
Plugin 'Collada': load failed (failed initialization).
Plugin 'ConvexDecompose': loading...
Plugin 'ConvexDecompose': load succeeded.
Plugin 'CustomUI': loading...
Plugin 'CustomUI': load succeeded.
Plugin 'DynamicsBullet-2-78': loading...
Plugin 'DynamicsBullet-2-78': load succeeded.
Plugin 'DynamicsBullet-2-83': loading...
Plugin 'DynamicsBullet-2-83': load succeeded.
Plugin 'DynamicsNewton': loading...
Plugin 'DynamicsNewton': load succeeded.
Plugin 'DynamicsOde': loading...
Plugin 'DynamicsOde': load succeeded.
Plugin 'DynamicsVortex': loading...
Plugin 'DynamicsVortex': load succeeded.
Plugin 'ExternalRenderer': loading...
Plugin 'ExternalRenderer': load succeeded.
Plugin 'K3': loading...
Plugin 'K3': load succeeded.
Plugin 'LuaRemoteApiClient': loading...
Plugin 'LuaRemoteApiClient': load succeeded.
Plugin 'Mtb': loading...
Plugin 'Mtb': load succeeded.
Plugin 'OMPL': loading...
Plugin 'OMPL': load succeeded.
Plugin 'OpenMesh': loading...
Plugin 'OpenMesh': load succeeded.
Plugin 'PovRay': loading...
Plugin 'PovRay': load succeeded.
Plugin 'Qhull': loading...
Plugin 'Qhull': load succeeded.
Plugin 'RRS1': loading...
Plugin 'RRS1': load succeeded.
Plugin 'ReflexxesTypeIV': loading...
Plugin 'ReflexxesTypeIV': load succeeded.
Plugin 'RemoteApi': loading...
Starting a remote API server on port 19997
Plugin 'RemoteApi': load succeeded.
Plugin 'Ros': loading...
Plugin 'Ros': load succeeded.
Plugin 'SimpleFilter': loading...
Plugin 'SimpleFilter': load succeeded.
Plugin 'Urdf': loading...
V-REP runs in headless mode. Cannot start 'Urdf' plugin.
Plugin 'Urdf': load failed (failed initialization).
Plugin 'Vision': loading...
Plugin 'Vision': load succeeded.
Using the 'MeshCalc' plugin.
Initializing the Bullet physics engine in plugin 'DynamicsBullet_2_78'...
Engine version: 2.78
Plugin version: 8
Initialization successful.

Any idea how should I solve this?
Thanks!

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

Re: Could not initialize OpenGL

Post by coppelia » 28 Jun 2016, 10:38

This problem does not seem to be linked with your previous openGl problem, since the sensor would anyways stream an empty or black image.

How do you enable the image publisher and how do you stream it? It seems you are using the old ROS plugin. We recommend you use the new ROS interface called RosInterface, which is available since V-REP 3.3.1. (the RosInterface plugin seems not to be loaded from your console output, since it shopuld mention something like:

Code: Select all

Plugin 'RosInterface': loading...
Plugin 'RosInterface': load succeeded.
Cheers

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

Re: Could not initialize OpenGL

Post by jessica » 28 Jun 2016, 14:17

Hey,
thanks for the reply!
Current I'm using the ROSPlugin, I named my visionSensor as get_vis_sns and I didn't add any childscripts. When I run it on my PC, I can get all the messages within ros from the vision sensors and everything works fine, it's just when I try to run it on the cluster, I can get the vrep to run according to your previous post, but when it is running, when I do "rostopic list", there is no topic from publishing from this get_vis_sns.
I enabled two subscribers from within VREP using the RosPlugin like:
simExtROS_enablePublisher( 'get_bot_pose', 1, simros_strmcmd_get_object_pose, botHandle, -1, '')
simExtROS_enableSubscriber('set_bot_pose', 1, simros_strmcmd_set_object_pose, botHandle, -1, '')
and I can get both topics "/get_bot_pose" and "/set_bot_pose" from within ROS, just that nothing from vision sensor.
So you suspect that this is due to the usage of ROS Plugin and using ROS Interface would solve the problem?

----------------------------------------------------


Hi,
so I "ln -s compiledRosPlugins/libv_repExtRosInterface.so" in the vrep root directory to enable RosInterface, and I tried to run headless the tutorial simulation rosInterfaceTopicPublisherAndSubscriber.ttt, but still I get this error message:

Using the default Lua library.
Add-on script 'vrepAddOnScript-addOnScriptDemo.lua' was loaded.
Simulator launched.
Plugin 'MeshCalc': loading...
Plugin 'MeshCalc': load succeeded.
Plugin 'BubbleRob': loading...
Plugin 'BubbleRob': load succeeded.
Plugin 'Collada': loading...
V-REP runs in headless mode. Cannot start 'Collada' plugin.
Plugin 'Collada': load failed (failed initialization).
Plugin 'ConvexDecompose': loading...
Plugin 'ConvexDecompose': load succeeded.
Plugin 'CustomUI': loading...
Plugin 'CustomUI': load succeeded.
Plugin 'DynamicsBullet-2-78': loading...
Plugin 'DynamicsBullet-2-78': load succeeded.
Plugin 'DynamicsBullet-2-83': loading...
Plugin 'DynamicsBullet-2-83': load succeeded.
Plugin 'DynamicsNewton': loading...
Plugin 'DynamicsNewton': load succeeded.
Plugin 'DynamicsOde': loading...
Plugin 'DynamicsOde': load succeeded.
Plugin 'DynamicsVortex': loading...
Plugin 'DynamicsVortex': load succeeded.
Plugin 'ExternalRenderer': loading...
Plugin 'ExternalRenderer': load succeeded.
Plugin 'K3': loading...
Plugin 'K3': load succeeded.
Plugin 'LuaRemoteApiClient': loading...
Plugin 'LuaRemoteApiClient': load succeeded.
Plugin 'Mtb': loading...
Plugin 'Mtb': load succeeded.
Plugin 'OMPL': loading...
Plugin 'OMPL': load succeeded.
Plugin 'OpenMesh': loading...
Plugin 'OpenMesh': load succeeded.
Plugin 'PovRay': loading...
Plugin 'PovRay': load succeeded.
Plugin 'Qhull': loading...
Plugin 'Qhull': load succeeded.
Plugin 'RRS1': loading...
Plugin 'RRS1': load succeeded.
Plugin 'ReflexxesTypeIV': loading...
Plugin 'ReflexxesTypeIV': load succeeded.
Plugin 'RemoteApi': loading...
Starting a remote API server on port 19997
Plugin 'RemoteApi': load succeeded.
Plugin 'Ros': loading...
Plugin 'Ros': load succeeded.
Plugin 'RosInterface': loading...
Plugin 'RosInterface': load succeeded.
Plugin 'SimpleFilter': loading...
Plugin 'SimpleFilter': load succeeded.
Plugin 'Urdf': loading...
V-REP runs in headless mode. Cannot start 'Urdf' plugin.
Plugin 'Urdf': load failed (failed initialization).
Plugin 'Vision': loading...
Plugin 'Vision': load succeeded.
Using the 'MeshCalc' plugin.
Initializing the Bullet physics engine in plugin 'DynamicsBullet_2_78'...
Engine version: 2.78
Plugin version: 8
Initialization successful.
ERROR: Failed creating a QOffscreenSurface. Switching to a hidden QGLWidget.
Could not initialize OpenGL
Aborted (core dumped)

So it seems the OpenGL problem is still there if tried to use a vision sensor?

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

Re: Could not initialize OpenGL

Post by coppelia » 29 Jun 2016, 11:09

So I am confused. So:

1. With the RosPlugin you can run V-REP and your scene, but there is no data coming from the vision sensor
2. With the RosInterface you cannot run V-REP and your scene, because of the crash.

Is that correct?

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

Re: Could not initialize OpenGL

Post by jessica » 13 Jul 2016, 23:01

Hey,
sorry for the late reply, I got stuck in something else and just got back to deal with this problem ...

So now I am finally able to run the simulation with RosPlugin, and I get all the topics, but for the vision image topic, I get only 0's
This is what I did:

on the cluster:

xvfb-run --auto-servernum --server-num=1 ./vrep.sh -h -s -q /home/zhang/ws/vis-planner/vrep/scenes/myScene.ttt &
I also tried:
xvfb-run --auto-servernum --server-num=1 -s "-screen 0 640x480x24" ./vrep.sh -h -s -q /home/zhang/ws/vis-planner/vrep/scenes/myScene.ttt

both are only get 0's in the msg returned.

In the child script, this is the part for the vision sensor
visHandle = simGetObjectHandle('visionSensor')
simExtROS_enablePublisher( 'get_vis_sens', 1, simros_strmcmd_get_vision_sensor_image, visHandle, -1, '')

Could you help me in solving this problem? Thanks in advance!

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

Re: Could not initialize OpenGL

Post by coppelia » 15 Jul 2016, 09:09

Jessica,

I think the problem you describe here is linked to your other question. Check here for a first identification if the vision sensor is correctly working. It seems to me you are describing a black image, right?

Cheers

onlytailei
Posts: 4
Joined: 23 Mar 2017, 17:02

Re: Could not initialize OpenGL

Post by onlytailei » 24 Mar 2017, 10:14

coppelia wrote:Jessica,

I think the problem you describe here is linked to your other question. Check here for a first identification if the vision sensor is correctly working. It seems to me you are describing a black image, right?

Cheers
Hi,

I face the same problem.
It's nothing to do with ROS.
I tested two environments through ssh, where the only difference is with vision sensor or not.
With this command:

Code: Select all

xvfb-run --auto-servernum --server-num=1 -s "-screen 0 640x480x24" ./vrep.sh -h -s -q my-sim.ttt
For the one without vision sensor, everything works fine.
For the one with vision sensor, I get the totally same error.

Code: Select all

ERROR: Failed creating a QOffscreenSurface. Switching to a hidden QGLWidget
The full output is listed below.

Code: Select all

Using the default Lua library.
Add-on script 'vrepAddOnScript-addOnScriptDemo.lua' was loaded.
Simulator launched.
Plugin 'MeshCalc': loading...
Plugin 'MeshCalc': load succeeded.
Plugin 'BubbleRob': loading...
Plugin 'BubbleRob': load succeeded.
Plugin 'Collada': loading...
V-REP runs in headless mode. Cannot start 'Collada' plugin.
Plugin 'Collada': load failed (failed initialization).
Plugin 'ConvexDecompose': loading...
Plugin 'ConvexDecompose': load succeeded.
Plugin 'CustomUI': loading...
Plugin 'CustomUI': load succeeded.
Plugin 'DynamicsBullet-2-78': loading...
Plugin 'DynamicsBullet-2-78': load succeeded.
Plugin 'DynamicsBullet-2-83': loading...
Plugin 'DynamicsBullet-2-83': load succeeded.
Plugin 'DynamicsNewton': loading...
Plugin 'DynamicsNewton': load succeeded.
Plugin 'DynamicsOde': loading...
Plugin 'DynamicsOde': load succeeded.
Plugin 'DynamicsVortex': loading...
Plugin 'DynamicsVortex': load succeeded.
Plugin 'ExternalRenderer': loading...
Plugin 'ExternalRenderer': load succeeded.
Plugin 'K3': loading...
Plugin 'K3': load succeeded.
Plugin 'LuaRemoteApiClient': loading...
Plugin 'LuaRemoteApiClient': load succeeded.
Plugin 'Mtb': loading...
Plugin 'Mtb': load succeeded.
Plugin 'OMPL': loading...
Plugin 'OMPL': load succeeded.
Plugin 'OpenMesh': loading...
Plugin 'OpenMesh': load succeeded.
Plugin 'PovRay': loading...
Plugin 'PovRay': load succeeded.
Plugin 'Qhull': loading...
Plugin 'Qhull': load succeeded.
Plugin 'RRS1': loading...
Plugin 'RRS1': load succeeded.
Plugin 'ReflexxesTypeIV': loading...
Plugin 'ReflexxesTypeIV': load succeeded.
Plugin 'RemoteApi': loading...
Starting a remote API server on port 19997
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Could not initialize OpenGL
Plugin 'RemoteApi': load succeeded.
Plugin 'Ros': loading...
Plugin 'Ros': load succeeded.
Plugin 'RosInterface': loading...
Plugin 'RosInterface': load succeeded.
Plugin 'RosSkeleton': loading...
Plugin 'RosSkeleton': load succeeded.
Plugin 'SDF': loading...
Plugin 'SDF': load succeeded.
Plugin 'SimpleFilter': loading...
Plugin 'SimpleFilter': load succeeded.
Plugin 'SurfaceReconstruction': loading...
Plugin 'SurfaceReconstruction': load succeeded.
Plugin 'Urdf': loading...
V-REP runs in headless mode. Cannot start 'Urdf' plugin.
Plugin 'Urdf': load failed (failed initialization).
Plugin 'Vision': loading...
Plugin 'Vision': load succeeded.
Using the 'MeshCalc' plugin.
Initializing the Bullet physics engine in plugin 'DynamicsBullet_2_78'...
Engine version: 2.78
Plugin version: 8
Initialization successful.
ERROR: Failed creating a QOffscreenSurface. Switching to a hidden QGLWidget.
./vrep.sh: line 33: 11419 Aborted                 (core dumped) "$dirname/$appname" "${PARAMETERS[@]}"

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

Re: Could not initialize OpenGL

Post by coppelia » 25 Mar 2017, 12:02

When you start V-REP in headless mode, you basically run the exact same binaries as the V-REP with GUI. It is not a true headless version of V-REP. I see currently two possibilities:
  • You can try to run with different graphic settings and see if this makes a difference. Have a look at file system/usrset.txt. In there, try out different values for offscreenContextType, fboType, forceFboViaExt and vboOperation.
  • You can recompile V-REP in true headless mode by compiling V-REP with the makefile_noGui_noGl makefile. In that case however, vision sensors will only work if they rely on a plugin for image generation (e.g. v_repExtPovRay).
Cheers

Post Reply