Constructing an Instrument/Sensor Frame

Hi Forum,

I am trying to construct a frame that corresponds to a sensor/instrument located somewhere on a spacecraft. The attitude of the spacecraft itself is controlled by a defined AttitudesSequence.

How do I define a sensor frame? I understand the sensor’s parent would be the spacecraft body frame (How to retrieve this?) and a fixed transform from that would give the sensor/instrument frame.

Hi @gowtham

There was a direct way to retrieve a spacecraft frame, but we intentionnaly removed it because there were some hidden problems that quickly lead to either computation bottlenecks or infinite loops.

The problem was that the Frame interface enforces that a method getTransformTo(final Frame destination, final AbsoluteDate date) is available. This means that the frame is not bound to a specific time but should be able to compute autonomously its relationship with any other frame at any time the user wants.

In order to do this, our old SpacecraftFrame did in fact had a reference to an internal propagator in order to get the position of its own origin.

If you put an analytical propagator in the SpacecraftFrame and use this frame in another propagation, the results may be inaccurate because analytical propagators are not perfect.
If you put a numerical propagator in the SpacecraftFrame and use this frame in another propagation, performances may decrease dramatically because you have one numerical propagator hidden in all the internal computations of another propagator. There may also be numerical noise because the underlying propagator works within the steps of the outer propagator.
If you try to use the same propagator inside and outside, you get infinite recursion.

The root of the problem is this getTransformTo method that should be able to return something meaningful for any date. In most cases, however, we don’t really need this general purpose method. We already known the date (which is the current date from the existing SpacecraftState). So we don’t need a Frame or a TransformProvider, we need only the current Transform.

So what we use now is simply a fixed Transform from spacecraft frame to instrument frame. When we need to compute for example the line of sight of a target in the field of view of the instrument at some current date where we have a SpacecraftState, we just use spacecraftState.toTransform() to have the current transform for inertial frame to current time, then combine it with the fixed transfom from the spacecraft frame to the instrument frame and we have the Transform we want from inertial frame to instrument frame. In other word we don’t use the generic getTransformTo method between frames, we create our own getTransformTo that only works at current date.

Thanks a lot, @Luc, your explanation makes it quite clear and I totally understand the motivation behind removing it.

So, if I understand right, for example, if I want to find the line of sight of the Sun in an instrument frame, the following would be the procedure. For a particular time,

  1. Construct a Transform from the spacecraft body frame to the instrument frame. This can be achieved by constructing/combining a fixed translation and rotation (although this is independent of time)

  2. For that particular time, get the transform from inertial to spacecraft body frame (using spacecraftState.toTransform())

  3. Combine both these transforms (Transform(date, transform1, transform2))

  4. Get the Sun position in inertial and apply the combined transform to get it in the instrument frame

Let me know if I understood this right. Thank you!

Yes, this is exactly the process.

1 Like