test_encoder

test_encoder.test_encoder(show_plots, accuracy)[source]

Validation Test Description

This unit test script tests the the features of an encoder, namely discretization and signal failures. It sets up the reaction wheel speed message and encoder modules and runs the simulation for a number of steps. The script tests each functionality of the module, including the discretization of the wheel speeds and the signal failures, such as the signal being turned off or being stuck at the previous iteration.

In the reaction wheel message, three wheels are considered with varying values. Throughout the simulation, the encoder module assumes different operating states, such as nominal (everything works as intended), off (wheel speeds are off) and stuck (wheel speeds remain constant).

The limitations of this test are the same as the ones discussed on the module’s .rst file. Also, the value of the accuracy used is the limit for the test to pass.

Test Parameters

Parameters:

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

Description of Variables Being Tested

In this file we are checking the values of the variables

  • wheelSpeedsEncoded

which represents the array of reaction wheel speeds. This array is compared to the truewheelSpeedsEncoded array, which contains the expected values of the wheel speeds after encoding.