Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jMAVSim: Added the option to run without the GUI #105

Merged
merged 5 commits into from
Aug 22, 2019

Conversation

katzfey
Copy link

@katzfey katzfey commented Aug 18, 2019

Added a new command line argument to allow the user to run without the GUI. The
new argument is -no-gui. This allows use of the simulator in environments that
do not have a GUI, like a headless Docker.

Fixes #59.

Added a new command line argument to allow the user to run without the GUI. The
new argument is -no-gui. This allows use of the simulator in environments that
do not have a GUI, like a headless Docker.
@julianoes julianoes self-requested a review August 19, 2019 07:23
@julianoes
Copy link

Thanks for the PR @katzfey! I'll try this out and review it.

@julianoes julianoes self-assigned this Aug 19, 2019
@julianoes
Copy link

@katzfey please rebase on top of master, then CI should pass.

Copy link

@julianoes julianoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct.

@julianoes
Copy link

Unfortunately the problem is that the j3d libs still require a X11 DISPLAY variable as was also mentioned in #59 (comment).

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.ExceptionInInitializerError
	at javax.media.j3d.GroupRetained.<init>(GroupRetained.java:155)
	at javax.media.j3d.TransformGroupRetained.<init>(TransformGroupRetained.java:116)
	at javax.media.j3d.TransformGroup.createRetained(TransformGroup.java:115)
	at javax.media.j3d.SceneGraphObject.<init>(SceneGraphObject.java:114)
	at javax.media.j3d.Node.<init>(Node.java:172)
	at javax.media.j3d.Group.<init>(Group.java:551)
	at javax.media.j3d.TransformGroup.<init>(TransformGroup.java:87)
	at me.drton.jmavsim.KinematicObject.<init>(KinematicObject.java:42)
	at me.drton.jmavsim.DynamicObject.<init>(DynamicObject.java:24)
	at me.drton.jmavsim.vehicle.AbstractVehicle.<init>(AbstractVehicle.java:26)
	at me.drton.jmavsim.vehicle.AbstractMulticopter.<init>(AbstractMulticopter.java:19)
	at me.drton.jmavsim.vehicle.Quadcopter.<init>(Quadcopter.java:33)
	at me.drton.jmavsim.Simulator.buildMulticopter(Simulator.java:431)
	at me.drton.jmavsim.Simulator.<init>(Simulator.java:312)
	at me.drton.jmavsim.Simulator.main(Simulator.java:930)
	... 5 more
Caused by: java.awt.HeadlessException: 
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
	at javax.media.j3d.VirtualUniverse.<clinit>(VirtualUniverse.java:269)
	... 20 more

I think the change is still worthwile but it doesn't allow it to be run in CI/docker just yet.

@katzfey
Copy link
Author

katzfey commented Aug 19, 2019

Darn! Sorry about that. You would think that if I wanted it to run in a headless Docker that I would have tested it in a headless Docker. I'll keep working on it.

@julianoes julianoes removed their assignment Aug 20, 2019
@JonasVautherin
Copy link

What's the status on that? @katzfey does it run in docker now? I'll be happy to test it when it works for you!

@katzfey
Copy link
Author

katzfey commented Aug 21, 2019

Well, I am testing in a Docker now and can reproduce the issue. I have made changes and it gets farther but still not quite there.

@katzfey
Copy link
Author

katzfey commented Aug 22, 2019

I have it all working now on headless docker. Need to clean up some commit comments and then I can submit a new PR.

@katzfey
Copy link
Author

katzfey commented Aug 22, 2019

@JonasVautherin Please feel free to test the work now. It seems to be working for me on a headless system with the -no-gui option. Branch is run_without_gui in my repo https://github.com/katzfey/jMAVSim

@JonasVautherin
Copy link

Branch is run_without_gui in my repo

Which is this PR, right? 😅

Copy link

@julianoes julianoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, it works for me in docker without $DISPLAY.

I made two small comments that would be nice if you could check them.

scripts/run_simulator.sh Outdated Show resolved Hide resolved
src/me/drton/jmavsim/KinematicObject.java Outdated Show resolved Hide resolved
2. Changed the gui parameter to showGui
@julianoes
Copy link

Awesome, thanks @katzfey!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jMAVSim without GUI
3 participants