Constraining Z-axis for a CelestialBodyPointed Attitude

Hello everyone,

I’m working on a case where a satellite A is pointing to another satellite, satellite B.

The idea is to create an attitude law, using CelestialBodyPointed and to provide it to satellite A.
Since I’m also using a rectangular FOV detector, I’d like to constrain Z axis in order to align the vector_IJ (that is Vector_I + Vector_J) of satellite A and the velocity vector of satellite B.

So it means that from my FOV point of view, I’m aligning the FOV’s diagonal of sat A with the velocity vector of B.

For now I have the following code that is working with the Orekit 12.2 python wrapper :slight_smile:

attitude_sat_A = CelestialBodyPointed(
        ephemeris_sat_B.getFrame(),
        ephemeris_sat_B,
        Vector3D.PLUS_K,
        Vector3D.PLUS_K,
        Vector3D.add(Vector3D.MINUS_I, Vector3D.MINUS_J),
    )

propagator_sat_A.setAttitudeProvider(attitude_sat_A)


When running this code, satellite A is indeed pointing to satellite B but the Z-axis constraint is not the good one. (I’m visualizing this using OEM/AEM as outputs from orekit)

I really think that my Phasing_Cel isn’t the good one. Should I use PVcoordinates from ephemeris_sat_B in order to retrieve the vector_IJ and the velocity vector of satellite B ?
If yes, how to do so ?
Thank you for the help you could provide me with !

Cheers,
Emilien

I would suggest to use AlignedAndConstrained instead of CelestialBodyPointed, it is easier to understand. You will need to implement your own TargetProvider, though. I also guess you should compute the relative velocity instead of the absolute one (assuming you want the target satellite to cross the first satellite field of view diagonally).