test_cmdTorqueBodyToTorqueAtSite

test_cmdTorqueBodyToTorqueAtSite.runModule(torque_B, dcm_SB=None)[source]

Run the module for one second in a simulation and return the module and an output reader.

test_cmdTorqueBodyToTorqueAtSite.test_dcm_setter_copies_input_matrix()[source]

Changing the caller’s matrix must not alter the rotation or output torque.

Assign an identity rotation, then invalidate the original NumPy array. The module must retain the validated rotation and preserve the commanded torque on its next update.

test_cmdTorqueBodyToTorqueAtSite.test_dcm_setter_rejects_invalid_rotation(badDcm)[source]

Validation Test Description

This unit test verifies that dcm_SB only accepts 3x3 proper rotation matrices.

Description of Variables Being Tested

This unit test checks that a wrong shape, a non-orthonormal matrix, and a reflection each raise ValueError.

test_cmdTorqueBodyToTorqueAtSite.test_output_torque_and_header(useRotation)[source]

Validation Test Description

This unit test verifies that cmdTorqueBodyToTorqueAtSite.CmdTorqueBodyToTorqueAtSite maps a body-frame torque command into the site frame, both for the default aligned frames and for a general body-to-site rotation, and that the output message header carries the write time and the module ID.

Description of Variables Being Tested

This unit test checks torque_S against dcm_SB @ torqueRequestBody, the output message write time, and the output message module ID.

test_cmdTorqueBodyToTorqueAtSite.test_reset_rejects_missing_input_message()[source]

Validation Test Description

This unit test verifies that cmdTorqueBodyToTorqueAtSite.CmdTorqueBodyToTorqueAtSite rejects reset calls when the required command torque message is not connected.

Description of Variables Being Tested

This unit test checks the cmdTorqueInMsg link validation.

test_cmdTorqueBodyToTorqueAtSite.test_reset_writes_zero_torque_and_header()[source]

Reset must publish zero torque with the reset time and module ID.

Run the module with a nonzero command, then reset at a later time and inspect the output before another update can overwrite its header.