Hi @benoist and @MaximeJ
Does your file give you an information only about the quaternions (q0, q1, q2 and q3) or the quaternions plus their derivatives (q0, q1, q2, q3, q0Dot, q1Dot, q2Dot and q3Dot)?
For the first case, you have to build the TimeStampedAngularCoordinates
object as followed:
// Build the needed objects
final AbsoluteDate date = // The date of the quaternions in the file
final boolean normalized = false; // You have to change this value to true if the quaternion are not normalized
final Rotation rotation = new Rotation(q0, q1, q2 q3, normalized);
// Return
final TimeStampedAngularCoordinates tsac = TimeStampedAngularCoordinates(date, rotation, Vector3D.ZERO, Vector3D.ZERO);
For the second case, you can build the TimeStampedAngularCoordinates
object by using FieldRotation<DerivativeStructure>
as followed:
// Date
final AbsoluteDate date = // The date of the quaternions in the file
// Quaternion components
final boolean normalized = false; // You have to change this value to true if the quaternion are not normalized
final DSFactory factory = new DSFactory(1, 1);
final DerivativeStructure q0DS = factory.build(q0, q0Dot);
final DerivativeStructure q1DS = factory.build(q1, q1Dot);
final DerivativeStructure q2DS = factory.build(q2, q2Dot);
final DerivativeStructure q3DS = factory.build(q3, q3Dot);
// Rotation
final FieldRotation<DerivativeStructure> fieldRotation = new FieldRotation<>(q0DS, q1DS, q2DS, q3DS, normalized);
// Return
return new TimeStampedAngularCoordinates(date, fieldRotation);
Is your file a CCSDS Attitude Data Message file ? If yes, we will add, probably next week, a parser for this type of files. Before Orekit 10.2 the parser will be available in our develop branch. The parser will directly give you the list of TimeStampedAngularCoordinated
to build the TabulatedProvider
.