I’d like to be able to compute when a tumbling satellite will be able to photograph the horizon given camera sensor parameters, and the satellite’s initial attitude and angular velocity. What are the best tools to use in Orekit to accomplish this?
You will need to set up a custom horizon event detector, configured with an implementation of
FieldOfView (most probably
DoubleDihedraFieldOfView) and an instance of
OneAxisEllipsoid. In order to implement
HorizonDetector, the simplest way is to make it extend the abstract class
AbstractDetector so the only two metods you have to implement will be a protected
create factory method and the core computation method: the
g switching function.
For a simple example of how to set up the constructors and the
create factory method, just look at a simple existing detector, like
AltitudeDetector for example.
g function is the more difficult part. Its specification is that the event occur when the sign of this function changes. In your case, I would suggest the following approach to implement the g function.
- using the current
SpacecraftState provided as an argument to the
g function, the internally
OneAxisEllipsoid and an internally stored angular step, build a list of target points that
will sample limb of the ellipsoid as seen from the spacecraft, in spacecraft frame (there is
pointOnLimb method in
Ellipsoid, which is the parent class of
OneAxisEllipsoid that may
help you, you will still need to do some frames transforms to get it in spacecraft frame)
- for each of the sample targets, call the
offsetFromBoundary method from the
interface with a line of sight computed from the sample point and a radius set to 0 (the
VisibilityTrigger will have no effect here, so you can select one arbitrarily)
- the value of the g function should be set to the minimum of all offsets computed from
all sample points