I tried to construct a LEO and a MEO orbit to test the operation of the intersatellite link. I don’t know if there is a problem with my program, but in some cases, the link array in the “show” list of the generated Output.czml appears “confused”.
"show":[
{
"interval":"2024-03-15T00:00:00Z/2024-03-15T00:00:17.02462289450341Z",
"boolean":true
},
{
"interval":"2024-03-15T00:00:17.02462289450341Z/2024-03-15T02:35:44.507556439741165Z",
"boolean":true
},
{
"interval":"2024-03-15T02:35:44.507556439741165Z/2024-03-15T00:00:17.02462289450341Z",
"boolean":false
},
{
"interval":"2024-03-15T01:29:37.95154078813357Z/2024-03-15T05:16:13.570397322822828Z",
"boolean":true
},
{
"interval":"2024-03-15T05:16:13.570397322822828Z/2024-03-15T01:29:37.95154078813357Z",
"boolean":false
},
{
"interval":"2024-03-15T04:15:10.957183739446918Z/2024-03-15T08:01:21.472332699107938Z",
"boolean":true
},
public class InterVisuSatError {
private InterVisuSatError() {
// empty
}
public static void main (final String[] args) throws Exception {
// CommInit.configureOrekit();
// Load orekit data
TutorialUtils.loadOrekitData();
// Paths
final String output = TutorialUtils.generateOutput();
// !!! Here you need to change the path inside 'generateJsPath' to the path you are using for images or Model.
// This folder can also be the public folder of your cesium javascript interface.
final String pathToJSFolder = TutorialUtils.generateJSPath(
System.getProperty("user.dir") + "/Javascript/public");
// Creation of the clock.
final double durationOfSimulation = 32 * 3600; // in seconds;
final AbsoluteDate startDate = new AbsoluteDate(2024, 3, 15, 0, 0, 0.0, TutorialUtils.UTC);
final AbsoluteDate finalDate = startDate.shiftedBy(durationOfSimulation);
final Clock clock = new Clock(startDate, finalDate, TutorialUtils.UTC,10);
// TutorialUtils.STEP_BETWEEN_EACH_INSTANT);
final Header header = new Header("Setup of the visualisation inter-satellites", clock, pathToJSFolder);
//// Build of the first satellite with an orbit with 20 degree inclination
// Build of a LEO orbit
final KeplerianOrbit firstOrbit = new KeplerianOrbit(7838000, 0, FastMath.toRadians(45), FastMath.toRadians(20),
FastMath.toRadians(0), FastMath.toRadians(0), PositionAngleType.MEAN, TutorialUtils.EME2000, startDate,
Constants.WGS84_EARTH_MU);
final SpacecraftState firstState = new SpacecraftState(firstOrbit);
// Build of a MEO orbit
final KeplerianOrbit MeoOrbit = new KeplerianOrbit(17878000, 0, FastMath.toRadians(0),
FastMath.toRadians(120),
/*But if pa is "0",the "show" list will be ok.*/
FastMath.toRadians(0),
FastMath.toRadians(0), PositionAngleType.MEAN,
TutorialUtils.EME2000,
startDate, Constants.WGS84_EARTH_MU);
final SpacecraftState MeoState = new SpacecraftState(MeoOrbit);
// Build of the propagator
final double[][] tolerances1 = NumericalPropagator.tolerances(TutorialUtils.POSITION_TOLERANCE, firstOrbit,
OrbitType.CARTESIAN);
final double[][] tolerancesMeo = NumericalPropagator.tolerances(TutorialUtils.POSITION_TOLERANCE, MeoOrbit,
OrbitType.CARTESIAN);
final AdaptiveStepsizeIntegrator integrator1 = new DormandPrince853Integrator(TutorialUtils.MIN_STEP,
TutorialUtils.MAX_STEP, tolerances1[0],
tolerances1[1]);
final AdaptiveStepsizeIntegrator integratorMeo = new DormandPrince853Integrator(TutorialUtils.MIN_STEP,
TutorialUtils.MAX_STEP, tolerancesMeo[0],
tolerancesMeo[1]);
final NormalizedSphericalHarmonicsProvider provider = GravityFieldFactory.getNormalizedProvider(10,
10);
final ForceModel holmesFeatherstone = new HolmesFeatherstoneAttractionModel(TutorialUtils.EME2000,
provider);
final NumericalPropagator firstPropagator = new NumericalPropagator(integrator1);
final NumericalPropagator MeosecondPropagator = new NumericalPropagator(integratorMeo);
firstPropagator.setOrbitType(OrbitType.CARTESIAN);
firstPropagator.addForceModel(holmesFeatherstone);
firstPropagator.setInitialState(firstState);
final EphemerisGenerator firstGenerator = firstPropagator.getEphemerisGenerator();
firstPropagator.propagate(startDate, finalDate);
final BoundedPropagator firstBoundedPropagator = firstGenerator.getGeneratedEphemeris();
MeosecondPropagator.setOrbitType(OrbitType.CARTESIAN);
MeosecondPropagator.addForceModel(holmesFeatherstone);
MeosecondPropagator.setInitialState(MeoState);
final EphemerisGenerator MeosecondGenerator = MeosecondPropagator.getEphemerisGenerator();
MeosecondPropagator.propagate(startDate, finalDate);
final BoundedPropagator MeosecondBoundedPropagator = MeosecondGenerator.getGeneratedEphemeris();
// Creation of the satellites
final Satellite firstSatellite = Satellite.builder(firstBoundedPropagator)
.withColor(Color.MAGENTA)
.withOnlyOnePeriod()
.build();
final Satellite MeoSatellite = Satellite.builder(MeosecondBoundedPropagator)
.withColor(Color.YELLOW)
.withOnlyOnePeriod()
.build();
// Creation of the inter-sat visualisation
final InterSatVisu interSatVisu1 = new InterSatVisu(firstSatellite, MeoSatellite, finalDate);
// Creation of the file
final CzmlFile file = CzmlFile.builder(output)
.withHeader(header)
.withSatellite(firstSatellite)
.withSatellite(MeoSatellite)
.withInterSatVisu(interSatVisu1)
.build();
// Writing in the file
file.write();
}
}