PX4 / jMAVSim

Simple multirotor simulator with MAVLink protocol support
BSD 3-Clause "New" or "Revised" License
84 stars 208 forks source link

Still crash on load due to missing image file #23

Closed muyangren499 closed 8 years ago

muyangren499 commented 8 years ago

@mpaperno @LorenzMeier I have a problem in anting the project jmavsim. I also get a crash on boot because the image is not found:

Exception in thread "main" java.lang.IllegalArgumentException: input == null! at javax.imageio.ImageIO.read(ImageIO.java:1388) at me.drton.jmavsim.Visualizer3D$CustomCanvas3D.(Visualizer3D.java:707) at me.drton.jmavsim.Visualizer3D.(Visualizer3D.java:114) at me.drton.jmavsim.Simulator.(Simulator.java:209) at me.drton.jmavsim.Simulator.main(Simulator.java:611) I also used followed code, but it still report this errors. java -Djava.ext.dirs= -cp lib/*:out/production/jmavsim.jar me.drton.jmavsim.Simulator

In aternate build method. the terminal report that the error is followed:

OS:Ubuntu 14.04 64bit FIle:/home/user

mpaperno commented 8 years ago
BUILD FAILED Target "creat_run_jar" does not exist in the project "jMAVSim". 
                         ^

Please check your spelling.

I don't know why the images don't work when trying to start it the "old way." It shouldlook in environment/ folder relative to the executing directory.

Someone could try to debug the line throwing the error -- perhaps the way the image is being loaded (the classLoader) is causing the problem. There are quite a few ways to load a URL/path in Java... one of them should work (as an example, there's another way used in KinematicObject.modelFromFile()).

// load and scale compass image for overlay
Image img = ImageIO.read(getClass().getClassLoader().getResource(TEX_DIR + COMPASS_IMG));

-Max

muyangren499 commented 8 years ago

Thank you, Max. I will try it. I just copied the code" ant create_run_jar copy_res" to the terminal. I am a newer of Ubuntu,since the jMAVSIm is work in WIndows.

muyangren499 commented 8 years ago

@mpaperno Thank you very much for your work. the code is work after you fixed in my somputer

muyangren499 commented 8 years ago

in my computer

mpaperno commented 8 years ago

Good to hear, and thanks for letting me know!

-Max

On Mon, Apr 04, 2016, at 04:31 AM (-0400), muyangren499 notifications@github.com wrote:

@mpaperno https://github.com/mpaperno Thank you very much for your work. the code is work after you fixed in my somputer

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/PX4/jMAVSim/issues/23#issuecomment-205193677

muyangren499 commented 8 years ago

@mpaperno Great job! I will test controller in the next period of time