test_ConstrainedAttitudeManeuver

test_ConstrainedAttitudeManeuver.test_constrainedAttitudeManeuver(show_plots, N, keepOutFov, keepInFov, costFcnType, accuracy)[source]

Validation Test Description

This unit test script tests the correctness of the path computed by the ConstrainedAttitudeManeuver module. The module is tested against Python scripts that mirror the same functions contained in the module. Tests are run for different grid coarseness levels, different keep-out fields of view, and one keep-in field of view.

Test Parameters

Parameters:
  • N (int) – grid coarseness;

  • keepOutFov (float) – Field of View (in radiants) of the keep-out boresight;

  • keepInFov (float) – Field of View (in radiants) of the keep-in boresight;

  • costFcnType (int) – 0 for the minimum MRP cartesian distance graph search, 1 for the effort-based graph search.

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

Description of Variables Being Tested

The tests to show the correctness of the module are the following:

  • First of all, an equivalent grid is built in python. The first test consists in comparing the nodes generated in Python versus the nodes generated in C++. The check consists in verifying whether the same key indices \((i,j,k)\) generate the same node coordinates \(\sigma_{BN}\). Secondly, it is checked whether the same node is constraint-compliant or -incompliant both in Python and in C++.

  • After running the graph-search algorithm, a check is conduced to ensure the equivalence of the computed paths. Note that this unit test does not run the effort-based version of A*, due to the slow nature of the Python implementation. If the user wishes, it is possible to uncomment line 429 to also test the effort-based graph-search algorithm.

  • The interpolated trajectory obtained in Python is checked versus the interpolated trajectory obtained in C++. The Python code uses the BSK-native BSpline library, which has its own unit test.

  • Lastly, a check is run on the norm of the required control torque for each time step of the interpolated trajectory. The correctness of this check should imply the correctness of the functions used in the effort-based graph-search algorithm as well.