test_linearTranslationOneDOFStateEffector
- test_linearTranslationOneDOFStateEffector.test_translatingBody(show_plots, function)[source]
Validation Test Description
This unit test sets up a spacecraft with a single-axis translating rigid body attached to a rigid hub. The position of the boom axis is arbitrary. The scenario includes gravity acting on both the spacecraft and the effector.
Description of Variables Being Tested
In this file we are checking the principles of conservation of energy and angular momentum. Both the orbital and rotational energy and angular momentum must be maintained when conservative forces like gravity are present. Therefore, the values of the variables
finalOrbAngMomfinalOrbEnergyfinalRotAngMomfinalRotEnergy
should be constant when tested against their initial values.
- test_linearTranslationOneDOFStateEffector.test_translatingBodyConfigurationValidation(configuration, shouldRaise, scheduleEffector)[source]
Verify that initialization rejects a translating body whose frame or inertia is not physical.
The frame orientation and the inertia tensor enter the mass properties directly, through
dcm_FB.transpose() * IPntFc_F * dcm_FBanddcm_FB.transpose() * r_FcF_F, so a matrix that is merely close to a rotation or to an inertia tensor produces wrong dynamics rather than an error. These are the checks the spinning body effectors already apply, asserted here on five ways of getting them wrong: a non-orthogonal frame, a left-handed frame, a non-symmetric inertia, one that is not positive definite, and one whose principal moments violate the triangle inequality.Test Parameters:
- configuration: [string]
translating body configuration to initialize
- shouldRaise: [bool]
whether initialization must reject the configuration
- scheduleEffector: [bool]
whether the effector is added to the task in addition to the spacecraft
The scheduling parameter matters because the checks must not depend on it. Spacecraft initialization calls
registerStates()on every attached state effector but never callsReset(), which runs only for a module added to a task.