Ephemeris class cannot be used with AbsolutePVCoordinates if an attitude provider is set
Issue raised here.
- Detailed description provided by @bryan :
Indeed, Ephemeris class cannot be used with AbsolutePVCoordinates if an attitude provider is set. The reason is in basicPropagate(...) method because the new SpacecraftState is built with an Orbit and not with AbsolutePVCoordinates.
return new SpacecraftState(evaluatedState.getOrbit(), calculatedAttitude,
evaluatedState.getMass(), evaluatedState.getAdditionalStates());
As this orbit is null, the getOrbit(...) method throw an OrekitException. I think this can be corrected.
- Solution suggested by @bryan too:
Issue can be fixed by checking if the orbit is defined:
// Ensure that the orbit is defined
if (evaluatedState.isOrbitDefined()) {
return new SpacecraftState(evaluatedState.getOrbit(), calculatedAttitude,
evaluatedState.getMass(), evaluatedState.getAdditionalStates());
} else {
return new SpacecraftState(evaluatedState.getAbsPVA(), calculatedAttitude,
evaluatedState.getMass(), evaluatedState.getAdditionalStates());
}