Hey. I was trying to run one of the oreczml-tutorial files. I managed to build and run oreczml-core and I also managed to successfully hook up the tutorials to the compiled oreczml-core.jar library, because the code runs until the very end where it’s writing out the .czml file, but at that point I have an issue where the oreczml-core package can’t find the satellite.png image file that it uses to generate the images.
Exception in thread "main" java.lang.RuntimeException: java.nio.file.NoSuchFileException: /home/baubin/Projects/Code/01-Orekit/oreczml/oreczml-tutorials/file:/home/baubin/.m2/repository/org/orekit/czml/1.0/czml-1.0.jar!/satellite.png
at org.orekit.czml.object.primary.Satellite.writeCzmlBlock(Satellite.java:294)
at org.orekit.czml.file.CzmlFile.write(CzmlFile.java:173)
at org.orekit.czml.file.CzmlFile.write(CzmlFile.java:131)
at org.orekit.czml.fieldofviewtuto.YawCompensationExample.main(YawCompensationExample.java:258)
Caused by: java.nio.file.NoSuchFileException: /home/baubin/Projects/Code/01-Orekit/oreczml/oreczml-tutorials/file:/home/baubin/.m2/repository/org/orekit/czml/1.0/czml-1.0.jar!/satellite.png
Also, here is the pom.xml file with my modifications to include the cesiumlangaugewriter and czml (oreczml-core) libraries
This is indeed an issue in the code. You can use any picture you want as a workaround but the tutorial shall indeed work as is. I’m opening an issue on the gitlab.
I have also noticed this problem in the pom and it has been fixed on the develop branch.
@Vincent Thanks for the update. Handling coding environments isn’t my best skill so I tend to assume that if something new that I set up fails to run, it’s because I messed it up somehow.
You’ll see there’s no way a place like this could have existed on my machine. However, since that time @Zudo has fixed the code so it should be looking for the image file in a place that either does exist already on your computer, or a location you can create. Just pull the develop branch, find/make that location on your computer and place the satellite.png file there, and you should be good to go.
Hi,
I think I’m stuck with a similar issue when searching for ISSModel.glb or satellite.png, I get the issues below.
Would you have an idea on how to solve this? It does not seem related to the existence of the path (and I checked in the .jar that the objects existed) but more to the class loadResources (for the ISS model) and Spacecraft (for the satellite.png).
Thank you very much for your help!
Benoist
Exception in thread "main" java.nio.file.InvalidPathException: Illegal char <:> at index 4: file:\C:\Users\BenoistLOSCUL\.m2\repository\org\orekit\OreCzml-tutorials\1.1-SNAPSHOT\oreczml-tutorials-1.1-SNAPSHOT.jar!\Default3DModels\ISSModel.glb
at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:204)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:175)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:231)
at java.base/java.io.File.toPath(File.java:2413)
at org.orekit.czml.TutorialUtils.loadResources(TutorialUtils.java:136)
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.visualizer.App.main(App.java:150)
Caused by: java.nio.file.InvalidPathException: Illegal char <:> at index 4: file:\C:\Users\BenoistLOSCUL\.m2\repository\org\orekit\oreczml-core\1.1-SNAPSHOT\oreczml-core-1.1-SNAPSHOT.jar!\satellite.png
I didn’t try to use a complete tutorial but I used SSOAttitudeExample to code, see below:
final EphemerisGenerator generator = propagator.getEphemerisGenerator();
propagator.propagate(initialDate.shiftedBy(simDuration));
BoundedPropagator ephemeris = generator.getGeneratedEphemeris();
// Creation of the satellite
final String IssModel = TutorialUtils.loadResources("Default3DModels/ISSModel.glb");
// Creation of the satellite
final Spacecraft satellite =
Spacecraft.builder(ephemeris, header)
.withModelPath(IssModel).withColor(Color.RED)
.withOnlyOnePeriod().withDisplayAttitude().withReferenceSystem()
.build();
final AttitudePointing pointing =
AttitudePointing
.builder(satellite, TutorialUtils.getEarth(), Vector3D.MINUS_K,
header)
.withColor(Color.ORANGE).displayPointingPath()
.displayPeriodPointingPath().build();
// Creation of the field of observation of the satellite, it describes the area the satellite see
final Transform initialInertToBody = initialState.getFrame()
.getTransformTo(TutorialUtils.getEarth()
.getBodyFrame(),
initialState.getDate());
final Transform initialFovBody = new Transform(initialState.getDate(), initialState.toTransform()
.getInverse(),
initialInertToBody);
final FieldOfView fov = new DoubleDihedraFieldOfView(Vector3D.MINUS_K, Vector3D.PLUS_I, FastMath.toRadians(20),
Vector3D.PLUS_J, FastMath.toRadians(20), 2);
final FieldOfObservation fieldOfObservation = FieldOfObservation.builder(satellite, fov, initialFovBody, header).build();
// Creation of the file
final CzmlFile file =
CzmlFile.builder().withHeader(header).withSpacecraft(satellite)
.withAttitudePointing(pointing)
.withFieldOfObservation(fieldOfObservation).build();
// Writing in the file
file.write(output);