FoV/FoV Detector Usage Problems


#1

Hi all,

I am using the FoV Detector to find the time range when a point on earth is visible to the sensor on the spacecraft. However, the pass duration I get as a result is longer than I expect (I expect ~10s but get ~1.5 minutes).

I assume that this is caused by a misconfiguration of the FoV/FoV Detector but I did not figure out what I do wrong.

That’s my FoV declaration (rectangle, 5 degrees):

    final double viewAngle = 5.0;
    
    final var fov = new FieldOfView(Vector3D.PLUS_K, 
        Vector3D.PLUS_I, FastMath.toRadians(viewAngle / 2),
        Vector3D.PLUS_J, FastMath.toRadians(viewAngle / 2),
        0);

The FoV Detector:

final var tcf = new TopocentricFrame(earth, point, "point");
final var detector = new FieldOfViewDetector(tcf, fov).withMaxCheck(maxCheckingInterval).withHandler(new EventHandler<FieldOfViewDetector>() {

      private AbsoluteDate start;
      
      @Override
      public Action eventOccurred(SpacecraftState s, FieldOfViewDetector detector,
          boolean increasing) throws OrekitException {
        
        if (increasing) {
          // Leaving Area
          
          final var end = s.getDate();
          
          System.out.println("Pass duration: " + end.durationFrom(start));
          
          return Action.CONTINUE;
        } else {
          // Entering Area
          
          start = s.getDate();
          
          return Action.CONTINUE;
        }
}});

The propagation:

    final var logger = new EventsLogger();

    final var propagator = TLEPropagator.selectExtrapolator(...);

    final var attitudeProvider = new NadirPointing(propagator.getFrame(), earth);
    
    propagator.setAttitudeProvider(attitudeProvider);
    propagator.addEventDetector(logger.monitorDetector(detector));
    propagator.propagate(startDate, endDate);

Is there something wrong how I utilize the FoV/FoV Detector?

Thanks,
Jan


#2

The way you use this detector is correct. I think you have found a bug in Orekit!
Looking back at the test case for FieldOfViewDetector, the test pass but the way
it is written is wrong, we failed to notice the detector did not work properly since
at least version 7.2 :fearful:

Could you open a bug report at https://gitlab.orekit.org/orekit/orekit/issues ?

If you could add your own test configuration to the bug report (with your FoV definition, attitude definition,
the TLE data and the search time range), it would help us a lot.


#3

I looked again at the test and improved it, but the library behavior was in fact correct in this
case, so I am not sure anymore there is a bug. We need to have some data to check.

Could you try to copy the dihedraAngles/dihedraAngle functions from https://gitlab.orekit.org/orekit/orekit/blob/develop/src/test/java/org/orekit/propagation/events/FieldOfViewDetectorTest.java#L170 and
call them in your code to monitor the angles and see when your target crosses the FoV boundary?


#4

Thank you for your answers!

I have implemented the dihedraAngle methods to monitor the angles. For reference, this is the pass I find:

Pass Start:    2018-11-20T03:51:13.836;
Pass End:      2018-11-20T03:54:03.062;
Pass duration: 169.22639302270034

These are the angles in the relevant time frame: angles.dat (18.1 KB)

If I am not mistaken, the boundaries of the FoV are 2.5 degress (~0.0436 rad). When I look through the list of angles, I cannot see that the target crosses the FoV boundary. Does this help?

I have also attached the code snipped with the TLE data to test:

The Snipped

    final var tle = new TLE("1 33314U 08040C   18325.13536407  .00000020  00000-0  93127-5 0  9993",
        "2 33314  97.7735  35.5590 0025404 105.4992 254.9034 14.79911945552555");
    
    final var startDate = new AbsoluteDate(2018, 11, 20, 3, 0, 0, TimeScalesFactory.getUTC());
    final var endDate = new AbsoluteDate(2018, 11, 20, 4, 0, 0, TimeScalesFactory.getUTC());

    final var maxCheckingInterval = 5.0;

    final var ecef = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    final var earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS,
        Constants.WGS84_EARTH_FLATTENING, ecef);

    final double viewAngle = 5.0;

    final var fov = new FieldOfView(Vector3D.PLUS_K, Vector3D.PLUS_I,
        FastMath.toRadians(viewAngle / 2), Vector3D.PLUS_J, FastMath.toRadians(viewAngle / 2), 0);

    final var point = new GeodeticPoint(40.205842983848484, -92.58639608631753, 40.205842983848484);
    
    final var tcf = new TopocentricFrame(earth, point, "point");
    final var detector = new FieldOfViewDetector(tcf, fov).withMaxCheck(maxCheckingInterval)
        .withHandler(new EventHandler<FieldOfViewDetector>() {

          private AbsoluteDate start;

          @Override
          public Action eventOccurred(SpacecraftState s, FieldOfViewDetector detector,
              boolean increasing) throws OrekitException {

            if (increasing) {
              // Leaving Area

              final var end = s.getDate();

              final var duration = end.durationFrom(start);
              
              System.out.println("Pass duration: " + duration);

              return Action.CONTINUE;
            } else {
              // Entering Area

              start = s.getDate();

              return Action.CONTINUE;
            }
          }
        });

    final var logger = new EventsLogger();

    final var propagator = TLEPropagator.selectExtrapolator(tle);

    final var attitudeProvider = new NadirPointing(propagator.getFrame(), earth);

    propagator.setAttitudeProvider(attitudeProvider);
    propagator.addEventDetector(logger.monitorDetector(detector));
    propagator.propagate(startDate, endDate);