Hello community,
I am building a Matlab script using Orekit and am having some issues with the StateToTLE() method. I have imported Orekit properly and the methods are recognized with no issues. I can builld the SpacecraftState with no issues, however when I pass it to the StateToTLE method, I get the following error:
Java exception occurred:
java.lang.NoSuchMethodError:
org.hipparchus.geometry.euclidean.threed.Vector3D.normalize()Lorg/hipparchus/geometry/euclidean/threed/Vector3D;
at org.orekit.orbits.EquinoctialOrbit.<init>(EquinoctialOrbit.java:267)
at org.orekit.propagation.analytical.tle.TLE.convert(TLE.java:861)
at org.orekit.propagation.analytical.tle.TLE.stateToTLE(TLE.java:780)
at org.orekit.propagation.analytical.tle.TLE.stateToTLE(TLE.java:757)
at org.orekit.propagation.analytical.tle.TLE.stateToTLE(TLE.java:731)
Here is the lines of codes I have. They are embedded into a nested for loop. “i” iterates through the measurements (TLEs), and j iterates from 1 through 6. “x_hatJ” is an Nx6 matrix of states in each row, and “TLEs” is a structure where each cell is a TLE object.
positionJ = org.hipparchus.geometry.euclidean.threed.Vector3D(x_hatJ(j,1),x_hatJ(j,2),x_hatJ(j,3));
velocityJ = org.hipparchus.geometry.euclidean.threed.Vector3D(x_hatJ(j,4),x_hatJ(j,5),x_hatJ(j,6));
pvCoordsJ = org.orekit.utils.TimeStampedPVCoordinates(TLEs{1,i-1}.getDate(),positionJ,velocityJ);
orbitJ = org.orekit.orbits.CartesianOrbit(pvCoordsJ,inertialFrame,TLEs{1,i-1}.getDate(),mu);
angularRateJ = org.orekit.utils.TimeStampedAngularCoordinates(TLEs{1,i-1}.getDate(),pvCoordsJ,pvCoordsJ);
attitudeJ = org.orekit.attitudes.Attitude(inertialFrame, angularRateJ);
stateJ = org.orekit.propagation.SpacecraftState(orbitJ,attitudeJ);
TLEJ = org.orekit.propagation.analytical.tle.TLE.stateToTLE(stateJ,TLEs{1,i-1});
From what I gather, and @Serrof helped me reach this conclusion, is that for some reason Orekit can’t locate the normalize() method in Vector3D. However, I can manually call these methods with no issues. Has anyone run into this problem in Matlab?
Thank you,
Franco