test_locationPointing

test_locationPointing.checkReferenceGeometry(sigma_RN_list, sigma_BN_list, r_LN_N, r_SN_N, pHat_B, cHat_B, v_LP_N, isStrip=False, accuracy=1e-10)[source]

Verify geometric properties of the reference attitude.

For every recorded time step this function checks:
  1. Pointing constraint – the body-fixed pointing axis pHat_B, when expressed in the inertial frame through the reference DCM, must be aligned with the target direction r_LS_N.

  2. Scan-line constraint (strip imaging only) – the body-fixed cross-track axis cHat_B, when expressed in the inertial frame, must be perpendicular to the strip scanning direction v_LP_N.

Parameters:
  • sigma_RN_list – recorded reference MRP history (N×3).

  • sigma_BN_list – recorded body MRP history (N×3), used only for indexing.

  • r_LN_N – inertial target position [m].

  • r_SN_N – inertial spacecraft position [m].

  • pHat_B – body-fixed pointing axis.

  • cHat_B – body-fixed cross-track axis.

  • v_LP_N – strip velocity in inertial frame.

  • isStrip – True when strip-imaging mode is active.

  • accuracy – absolute tolerance for the checks.

Returns:

number of failures and list of error strings.

Return type:

(failCount, messages)

test_locationPointing.locationPointingTestFunction(show_plots, r_LS_NIn, v_LP_NIn, locationType, use3DRate, accuracy)[source]

Test method

test_locationPointing.test_locationPointing(show_plots, r_LS_N, locationType, v_LP_N, use3DRate, accuracy)[source]

Validation Test Description

This unit test ensures that the Attitude Guidance and Attitude Reference messages content are properly computed for a series of desired inertial target locations. For strip imaging (locationType=3), the test also verifies that the extra rotation aligns cHat_B perpendicular to the scanning direction.

Test Parameters

Parameters:
  • r_LS_N (float) – position vector of location relative to spacecraft

  • locationType (int) – choose whether to use locationInMsg, celBodyInMsg, scTargetInMsg, or locationstripInMsg

  • v_LP_N (float) – strip velocity vector relative to the planet (inertial frame), only used when locationType=3

  • use3DRate (bool) – choose between 2D or 3D rate control

  • accuracy (float) – absolute accuracy value used in the validation tests

Description of Variables Being Tested

The script checks the attitude and rate outputs. For strip imaging, it additionally checks that the reference attitude correctly constrains the roll degree of freedom so that cHat_B is perpendicular to the strip scanning direction.