AttitudeProvider.java

  1. /* Copyright 2002-2023 CS GROUP
  2.  * Licensed to CS GROUP (CS) under one or more
  3.  * contributor license agreements.  See the NOTICE file distributed with
  4.  * this work for additional information regarding copyright ownership.
  5.  * CS licenses this file to You under the Apache License, Version 2.0
  6.  * (the "License"); you may not use this file except in compliance with
  7.  * the License.  You may obtain a copy of the License at
  8.  *
  9.  *   http://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */
  17. package org.orekit.attitudes;

  18. import org.hipparchus.CalculusFieldElement;
  19. import org.hipparchus.geometry.euclidean.threed.FieldRotation;
  20. import org.hipparchus.geometry.euclidean.threed.Rotation;
  21. import org.orekit.frames.Frame;
  22. import org.orekit.time.AbsoluteDate;
  23. import org.orekit.time.FieldAbsoluteDate;
  24. import org.orekit.utils.FieldPVCoordinatesProvider;
  25. import org.orekit.utils.PVCoordinatesProvider;


  26. /** This interface represents an attitude provider model set.
  27.  * <p>An attitude provider provides a way to compute an {@link Attitude Attitude}
  28.  * from an date and position-velocity local provider.</p>
  29.  * @author V&eacute;ronique Pommier-Maurussane
  30.  */
  31. public interface AttitudeProvider {

  32.     /** Compute the attitude corresponding to an orbital state.
  33.      * @param pvProv local position-velocity provider around current date
  34.      * @param date current date
  35.      * @param frame reference frame from which attitude is computed
  36.      * @return attitude on the specified date and position-velocity state
  37.      */
  38.     Attitude getAttitude(PVCoordinatesProvider pvProv, AbsoluteDate date, Frame frame);

  39.     /** Compute the attitude corresponding to an orbital state.
  40.      * @param pvProv local position-velocity provider around current date
  41.      * @param date current date
  42.      * @param frame reference frame from which attitude is computed
  43.      * @param <T> type of the field elements
  44.      * @return attitude on the specified date and position-velocity state
  45.      * @since 9.0
  46.      */
  47.     <T extends CalculusFieldElement<T>> FieldAttitude<T> getAttitude(FieldPVCoordinatesProvider<T> pvProv,
  48.                                                                      FieldAbsoluteDate<T> date,
  49.                                                                      Frame frame);

  50.     /** Compute the attitude-related rotation corresponding to an orbital state.
  51.      * @param pvProv local position-velocity provider around current date
  52.      * @param date current date
  53.      * @param frame reference frame from which attitude is computed
  54.      * @return attitude-related rotation on the specified date and position-velocity state
  55.      * @since 12.0
  56.      */
  57.     default Rotation getAttitudeRotation(PVCoordinatesProvider pvProv, AbsoluteDate date, Frame frame) {
  58.         return getAttitude(pvProv, date, frame).getRotation();
  59.     }

  60.     /** Compute the attitude-related rotation corresponding to an orbital state.
  61.      * @param pvProv local position-velocity provider around current date
  62.      * @param date current date
  63.      * @param frame reference frame from which attitude is computed
  64.      * @param <T> type of the field elements
  65.      * @return rotation on the specified date and position-velocity state
  66.      * @since 12.0
  67.      */
  68.     default <T extends CalculusFieldElement<T>> FieldRotation<T> getAttitudeRotation(FieldPVCoordinatesProvider<T> pvProv,
  69.                                                                                      FieldAbsoluteDate<T> date,
  70.                                                                                      Frame frame) {
  71.         return getAttitude(pvProv, date, frame).getRotation();
  72.     }

  73. }