Class NEDKinematicsEstimatorTest

java.lang.Object
com.irurueta.navigation.inertial.estimators.NEDKinematicsEstimatorTest

class NEDKinematicsEstimatorTest extends Object
  • Field Details

    • TIME_INTERVAL_SECONDS

      private static final double TIME_INTERVAL_SECONDS
      See Also:
    • LATITUDE_DEGREES

      private static final double LATITUDE_DEGREES
      See Also:
    • LONGITUDE_DEGREES

      private static final double LONGITUDE_DEGREES
      See Also:
    • HEIGHT

      private static final double HEIGHT
      See Also:
    • MIN_ANGLE_DEGREES

      private static final double MIN_ANGLE_DEGREES
      See Also:
    • MAX_ANGLE_DEGREES

      private static final double MAX_ANGLE_DEGREES
      See Also:
    • MIN_VELOCITY_VALUE

      private static final double MIN_VELOCITY_VALUE
      See Also:
    • MAX_VELOCITY_VALUE

      private static final double MAX_VELOCITY_VALUE
      See Also:
    • MIN_ANGLE_VARIATION_DEGREES

      private static final double MIN_ANGLE_VARIATION_DEGREES
      See Also:
    • MAX_ANGLE_VARIATION_DEGREES

      private static final double MAX_ANGLE_VARIATION_DEGREES
      See Also:
    • MIN_POSITION_VARIATION_DEGREES

      private static final double MIN_POSITION_VARIATION_DEGREES
      See Also:
    • MAX_POSITION_VARIATION_DEGREES

      private static final double MAX_POSITION_VARIATION_DEGREES
      See Also:
    • MIN_HEIGHT_VARIATION

      private static final double MIN_HEIGHT_VARIATION
      See Also:
    • MAX_HEIGHT_VARIATION

      private static final double MAX_HEIGHT_VARIATION
      See Also:
    • MIN_VELOCITY_VARIATION

      private static final double MIN_VELOCITY_VARIATION
      See Also:
    • MAX_VELOCITY_VARIATION

      private static final double MAX_VELOCITY_VARIATION
      See Also:
    • SCALING_THRESHOLD

      private static final double SCALING_THRESHOLD
      See Also:
    • ALPHA_THRESHOLD

      private static final double ALPHA_THRESHOLD
      See Also:
    • ABSOLUTE_ERROR

      private static final double ABSOLUTE_ERROR
      See Also:
    • LARGE_ABSOLUTE_ERROR

      private static final double LARGE_ABSOLUTE_ERROR
      See Also:
    • TIMES

      private static final int TIMES
      See Also:
    • ROUND_TRIP_SHORT_TIME_INTERVAL_SECONDS

      private static final double ROUND_TRIP_SHORT_TIME_INTERVAL_SECONDS
      Shortest time interval of the navigator round-trip test, expressed in seconds (s).
      See Also:
    • ROUND_TRIP_LONG_TIME_INTERVAL_SECONDS

      private static final double ROUND_TRIP_LONG_TIME_INTERVAL_SECONDS
      Longest time interval of the navigator round-trip test, expressed in seconds (s).
      See Also:
    • ROUND_TRIP_OLD_VELOCITY

      private static final double[] ROUND_TRIP_OLD_VELOCITY
      Old NED velocity (north, east, down) of the navigator round-trip test, expressed in meters per second (m/s).
    • ROUND_TRIP_OLD_ATTITUDE_DEGREES

      private static final double[] ROUND_TRIP_OLD_ATTITUDE_DEGREES
      Old body attitude (roll, pitch, yaw) of the navigator round-trip test, expressed in degrees.
    • ROUND_TRIP_SPECIFIC_FORCE

      private static final double[] ROUND_TRIP_SPECIFIC_FORCE
      Specific force (x, y, z) navigated in the round-trip test, expressed in meters per squared second (m/s^2).
    • ROUND_TRIP_ANGULAR_RATE

      private static final double[] ROUND_TRIP_ANGULAR_RATE
      Angular rate (x, y, z) navigated in the round-trip test, expressed in radians per second (rad/s).
    • ROUND_TRIP_ACCURACY_THRESHOLD

      private static final double ROUND_TRIP_ACCURACY_THRESHOLD
      Threshold used by the navigator of the round-trip test to accept the navigated body-to-NED matrix as a rotation. Nav_equations_NED updates attitude with the first-order factor (I - tau * skew(omega_in^n)) of eq. (5.77), which is not orthonormal: for these inputs the measured Frobenius norm of (C' * C - I) is 8.4e-11 for tau = 0.1 s and 8.6e-9 for tau = 1 s (it grows as (omega_in * tau)^2), so the default threshold of 1e-11 rejects both and the smallest passing power of ten is 1e-8 for tau = 1 s. 1e-7 leaves one order of magnitude of margin over that.
      See Also:
    • ROUND_TRIP_SHORT_INTERVAL_ABSOLUTE_ERROR

      private static final double ROUND_TRIP_SHORT_INTERVAL_ABSOLUTE_ERROR
      Tolerance of the navigator round-trip test for tau = 0.1 s, for both specific force (m/s^2) and angular rate (rad/s). Derived from the measured round-trip error of the current (correct) implementation: the largest component error is 4.0e-12 m/s^2 in specific force and 1.9e-11 rad/s in angular rate, caused by the first-order attitude terms of eq. (5.46)-(5.54) and (5.77). 1e-9 is about 50 times the largest measured error, and still 280 times below the 2.8e-7 m/s^2 gravity change produced by using the new height (0.09 m away) instead of the old one.
      See Also:
    • ROUND_TRIP_LONG_INTERVAL_ABSOLUTE_ERROR

      private static final double ROUND_TRIP_LONG_INTERVAL_ABSOLUTE_ERROR
      Tolerance of the navigator round-trip test for tau = 1 s, for both specific force (m/s^2) and angular rate (rad/s). Derived from the measured round-trip error of the current (correct) implementation: the largest component error is 6.9e-9 m/s^2 in specific force and 1.9e-9 rad/s in angular rate (the first-order error grows as tau^2 with respect to the 0.1 s case). 1e-7 is about 15 times the largest measured error, and still 10 times below the 1.0e-6 m/s^2 gravity change produced by using the new height (0.32 m away) instead of the old one.
      See Also:
  • Constructor Details

    • NEDKinematicsEstimatorTest

      NEDKinematicsEstimatorTest()
  • Method Details

    • testEstimate

      @Test void testEstimate() throws com.irurueta.navigation.frames.InvalidSourceAndDestinationFrameTypeException, com.irurueta.geometry.InvalidRotationMatrixException
      Throws:
      com.irurueta.navigation.frames.InvalidSourceAndDestinationFrameTypeException
      com.irurueta.geometry.InvalidRotationMatrixException
    • testEstimateAndReturnNew

      @Test void testEstimateAndReturnNew() throws com.irurueta.navigation.frames.InvalidSourceAndDestinationFrameTypeException, com.irurueta.geometry.InvalidRotationMatrixException
      Throws:
      com.irurueta.navigation.frames.InvalidSourceAndDestinationFrameTypeException
      com.irurueta.geometry.InvalidRotationMatrixException
    • testEstimateKinematics

      @Test void testEstimateKinematics() throws com.irurueta.navigation.frames.InvalidSourceAndDestinationFrameTypeException, com.irurueta.geometry.InvalidRotationMatrixException, com.irurueta.algebra.WrongSizeException, com.irurueta.algebra.RankDeficientMatrixException, com.irurueta.algebra.DecomposerException
      Throws:
      com.irurueta.navigation.frames.InvalidSourceAndDestinationFrameTypeException
      com.irurueta.geometry.InvalidRotationMatrixException
      com.irurueta.algebra.WrongSizeException
      com.irurueta.algebra.RankDeficientMatrixException
      com.irurueta.algebra.DecomposerException
    • testEstimateKinematicsAndReturnNew

      @Test void testEstimateKinematicsAndReturnNew() throws com.irurueta.navigation.frames.InvalidSourceAndDestinationFrameTypeException, com.irurueta.geometry.InvalidRotationMatrixException, com.irurueta.algebra.WrongSizeException, com.irurueta.algebra.RankDeficientMatrixException, com.irurueta.algebra.DecomposerException
      Throws:
      com.irurueta.navigation.frames.InvalidSourceAndDestinationFrameTypeException
      com.irurueta.geometry.InvalidRotationMatrixException
      com.irurueta.algebra.WrongSizeException
      com.irurueta.algebra.RankDeficientMatrixException
      com.irurueta.algebra.DecomposerException
    • testEstimateKinematicsWhenNegativeIntervalThrowsIllegalArgumentException

      @Test void testEstimateKinematicsWhenNegativeIntervalThrowsIllegalArgumentException() throws com.irurueta.navigation.frames.InvalidSourceAndDestinationFrameTypeException, com.irurueta.geometry.InvalidRotationMatrixException
      Throws:
      com.irurueta.navigation.frames.InvalidSourceAndDestinationFrameTypeException
      com.irurueta.geometry.InvalidRotationMatrixException
    • testEstimateKinematicsWhenInvalidCoordinateTransformationThrowsIllegalArgumentException

      @Test void testEstimateKinematicsWhenInvalidCoordinateTransformationThrowsIllegalArgumentException() throws com.irurueta.navigation.frames.InvalidSourceAndDestinationFrameTypeException, com.irurueta.geometry.InvalidRotationMatrixException
      Throws:
      com.irurueta.navigation.frames.InvalidSourceAndDestinationFrameTypeException
      com.irurueta.geometry.InvalidRotationMatrixException
    • testEstimateKinematicsWhenInvalidOldCoordinateTransformationThrowsIllegalArgumentException

      @Test void testEstimateKinematicsWhenInvalidOldCoordinateTransformationThrowsIllegalArgumentException() throws com.irurueta.navigation.frames.InvalidSourceAndDestinationFrameTypeException, com.irurueta.geometry.InvalidRotationMatrixException
      Throws:
      com.irurueta.navigation.frames.InvalidSourceAndDestinationFrameTypeException
      com.irurueta.geometry.InvalidRotationMatrixException
    • testEstimateKinematicsWhenZeroTimeIntervalReturnsZeroValues

      @Test void testEstimateKinematicsWhenZeroTimeIntervalReturnsZeroValues() throws com.irurueta.navigation.frames.InvalidSourceAndDestinationFrameTypeException, com.irurueta.geometry.InvalidRotationMatrixException, com.irurueta.algebra.WrongSizeException, com.irurueta.algebra.RankDeficientMatrixException, com.irurueta.algebra.DecomposerException
      Throws:
      com.irurueta.navigation.frames.InvalidSourceAndDestinationFrameTypeException
      com.irurueta.geometry.InvalidRotationMatrixException
      com.irurueta.algebra.WrongSizeException
      com.irurueta.algebra.RankDeficientMatrixException
      com.irurueta.algebra.DecomposerException
    • testCompareKinematics

      @Test void testCompareKinematics() throws com.irurueta.navigation.frames.InvalidSourceAndDestinationFrameTypeException, com.irurueta.geometry.InvalidRotationMatrixException
      Throws:
      com.irurueta.navigation.frames.InvalidSourceAndDestinationFrameTypeException
      com.irurueta.geometry.InvalidRotationMatrixException
    • testNavigatorRoundTripWithRotation

      @Test void testNavigatorRoundTripWithRotation() throws com.irurueta.navigation.frames.InvalidSourceAndDestinationFrameTypeException, com.irurueta.geometry.InvalidRotationMatrixException, InertialNavigatorException
      Navigates one epoch with NEDInertialNavigator (Groves' Nav_equations_NED) from a fixed, rotating old frame and checks that NEDKinematicsEstimator (Groves' Kinematics_NED), fed with the old latitude and height, recovers the body kinematics that were navigated, for time intervals of 0.1 s and 1 s. This is a regression guard for the start-of-interval position convention.
      Throws:
      com.irurueta.navigation.frames.InvalidSourceAndDestinationFrameTypeException - never thrown, the frame types used are valid.
      com.irurueta.geometry.InvalidRotationMatrixException - never thrown, the old attitude is a valid rotation.
      InertialNavigatorException - never thrown, the navigated attitude is valid within ROUND_TRIP_ACCURACY_THRESHOLD.
    • createOldNedFrame

      private static com.irurueta.navigation.frames.NEDFrame createOldNedFrame() throws com.irurueta.navigation.frames.InvalidSourceAndDestinationFrameTypeException, com.irurueta.geometry.InvalidRotationMatrixException
      Throws:
      com.irurueta.navigation.frames.InvalidSourceAndDestinationFrameTypeException
      com.irurueta.geometry.InvalidRotationMatrixException
    • createNewNedFrame

      private static com.irurueta.navigation.frames.NEDFrame createNewNedFrame(com.irurueta.navigation.frames.NEDFrame oldFrame) throws com.irurueta.geometry.InvalidRotationMatrixException, com.irurueta.navigation.frames.InvalidSourceAndDestinationFrameTypeException
      Throws:
      com.irurueta.geometry.InvalidRotationMatrixException
      com.irurueta.navigation.frames.InvalidSourceAndDestinationFrameTypeException
    • estimateKinematics

      private static BodyKinematics estimateKinematics(double timeInterval, com.irurueta.navigation.frames.CoordinateTransformation c, com.irurueta.navigation.frames.CoordinateTransformation oldC, double vn, double ve, double vd, double oldVn, double oldVe, double oldVd, double latitude, double height, double oldLatitude, double oldHeight) throws com.irurueta.algebra.WrongSizeException, com.irurueta.algebra.RankDeficientMatrixException, com.irurueta.algebra.DecomposerException
      Throws:
      com.irurueta.algebra.WrongSizeException
      com.irurueta.algebra.RankDeficientMatrixException
      com.irurueta.algebra.DecomposerException
    • assertNavigatorRoundTrip

      private static void assertNavigatorRoundTrip(double timeInterval, double absoluteError) throws com.irurueta.navigation.frames.InvalidSourceAndDestinationFrameTypeException, com.irurueta.geometry.InvalidRotationMatrixException, InertialNavigatorException
      Navigates one epoch of the given duration from the fixed old frame of the round-trip test and asserts that the kinematics estimated back from the old and navigated frames, using the old latitude and height, match the navigated ones.
      Parameters:
      timeInterval - time interval between epochs expressed in seconds (s).
      absoluteError - maximum allowed absolute error per component of specific force (m/s^2) and angular rate (rad/s).
      Throws:
      com.irurueta.navigation.frames.InvalidSourceAndDestinationFrameTypeException - never thrown, the frame types used are valid.
      com.irurueta.geometry.InvalidRotationMatrixException - never thrown, the old attitude is a valid rotation.
      InertialNavigatorException - if the navigated attitude is not a valid rotation within ROUND_TRIP_ACCURACY_THRESHOLD.