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 ARGS
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

make_dirs:

compile:

create_run_jar:

copy_res:

BUILD SUCCESSFUL
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(X11GLXContext.java:418)
at jogamp.opengl.GLContextImpl.makeCurrentWithinLock(GLContextImpl.java:759)
at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:642)
at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:580)
at javax.media.j3d.JoglPipeline$QueryCanvas.doQuery(JoglPipeline.java:8615)
at javax.media.j3d.JoglPipeline$QueryCanvas.access$100(JoglPipeline.java:8566)
at javax.media.j3d.JoglPipeline.createQueryContext(JoglPipeline.java:6562)
at javax.media.j3d.Canvas3D.createQueryContext(Canvas3D.java:4609)
at javax.media.j3d.Canvas3D.createQueryContext(Canvas3D.java:3606)
at javax.media.j3d.Renderer.doWork(Renderer.java:461)
at javax.media.j3d.J3dThread.run(J3dThread.java:271)

DefaultRenderingErrorListener.errorOccurred:
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(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:61)
Caused by: java.lang.IllegalStateException: Canvas3D: Non-recoverable graphics configuration error
at javax.media.j3d.Canvas3D.queryProperties(Canvas3D.java:3595)
at me.drton.jmavsim.Visualizer3D.createEnvironment(Visualizer3D.java:214)
at me.drton.jmavsim.Visualizer3D.(Visualizer3D.java:175)
at me.drton.jmavsim.Simulator.(Simulator.java:157)
at me.drton.jmavsim.Simulator.main(Simulator.java:678)
… 5 more
^CERROR [Unknown] Startup script returned with return value: 2
pxh>
Exiting…
pxh> Shutting down
/home/joe/src/Firmware/Tools/sitl_run.sh: 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

joe@joe-VirtualBox:~/src/Firmware$

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.

-Joe

1 Like