jMAVSim GUI graphics errors

Having decided to build a simulation environment using DronecodeSDK on ubunto 16.04.5, I used the process described on Building SDK from source. Then I built the PX4 software and also installed the jMAVSim toolchain and jMAVSim with SITL

With all these dependencies installed I can load PX4 using

make posix_sitl_default jmavsim

but when it tries to install the GUI it crashes. I’ve seen other threads discussing this issue, but have not been able to resolve it using these approaches. There are several references to graphics issues, but the crashing is troublesome. Any help will be appreciated. This is what I get:

joe@joe-VirtualBox:~/src/Firmware$ make posix_sitl_default jmavsim
ninja: Entering directory `/home/joe/src/Firmware/build/posix_sitl_default’
[1/1] cd /home/joe/src/Firmware/build/…/src/Firmware/build/posix_sitl_default
sitl_bin: /home/joe/src/Firmware/build/posix_sitl_default/bin/px4
debugger: none
program: jmavsim
model: none
src_path: /home/joe/src/Firmware
build_path: /home/joe/src/Firmware/build/posix_sitl_default
empty model, setting iris as default
SITL COMMAND: /home/joe/src/Firmware/build/posix_sitl_default/bin/px4 /home/joe/src/Firmware/ROMFS/px4fmu_common -s etc/init.d-posix/rcS -t /home/joe/src/Firmware/test_data
INFO [Unknown] Creating symlink /home/joe/src/Firmware/ROMFS/px4fmu_common -> /home/joe/src/Firmware/build/posix_sitl_default/tmp/rootfs/etc

| ___ \ \ \ / / / |
| |/ / \ V / / /| |
| __/ / \ / /
| |
| | / /^\ \ ___ |
_| / / |_/

px4 starting.

INFO [Unknown] Calling startup script: /bin/sh etc/init.d-posix/rcS 0
13600 WARNING: setRealtimeSched failed (not run as root?)
INFO [dataman] Unknown restart, data manager file ‘./dataman’ size is 11405132 bytes
INFO [simulator] Waiting for initial data on UDP port 14560. Please start the flight simulator to proceed…
Buildfile: /home/joe/src/Firmware/Tools/jMAVSim/build.xml





Total time: 1 second
Options parsed, starting Sim.
Starting GUI…
3D [dev] 1.6.0-pre12-daily-experimental daily

com.jogamp.opengl.GLException: J3D-Renderer-1: createImpl ARB n/a but required, profile > GL2 requested (OpenGL >= 3.1). Requested: GLProfile[GL3bc/GL3bc.sw], current: 3.0 (Compat profile, compat[ES2], FBO, software) - 3.0 Mesa 18.0.5
at jogamp.opengl.x11.glx.X11GLXContext.createImpl(
at jogamp.opengl.GLContextImpl.makeCurrentWithinLock(
at jogamp.opengl.GLContextImpl.makeCurrent(
at jogamp.opengl.GLContextImpl.makeCurrent(

CONTEXT_CREATION_ERROR: Renderer: Error creating Canvas3D graphics context for queryProperties()
graphicsDevice = X11GraphicsDevice[screen=0]
canvas = me.drton.jmavsim.Visualizer3D$CustomCanvas3D[canvas0,0,0,0x0,invalid]
X11Util.Display: Shutdown (JVM shutdown: true, open (no close attempt): 1/1, reusable (open, marked uncloseable): 0, pending (open in creation order): 1)
X11Util: Open X11 Display Connections: 1
X11Util: Open[0]: NamedX11Display[:0, 0x7feee803ac70, refCount 1, unCloseable false]
Exception in thread “main” java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(
Caused by: java.lang.IllegalStateException: Canvas3D: Non-recoverable graphics configuration error
at me.drton.jmavsim.Visualizer3D.createEnvironment(
at me.drton.jmavsim.Visualizer3D.(
at me.drton.jmavsim.Simulator.(
at me.drton.jmavsim.Simulator.main(
… 5 more
^CERROR [Unknown] Startup script returned with return value: 2
pxh> Shutting down
/home/joe/src/Firmware/Tools/ line 150: kill: (9582) - No such process
ninja: build stopped: interrupted by user.
Makefile:170: recipe for target ‘posix_sitl_default’ failed
make: *** [posix_sitl_default] Interrupt


1 Like

Looks like you’re running this in a virtual machine. Have you checked if 3D support is working correctly? Please check the virtual box settings, and make sure the guest extensions are installed correctly.

@Joseph_Marrone given that you’re building/running with a VM yyou may want to check this issue with jMAVSim’s java3d library

Once I went from a virtual machine to a direct install as host, the graphics problems went away. Evidently SITL needs a lot of horsepower that just isn’t there on a virtual machine. Now I will make ubuntu my host and Windows the guest.


1 Like