test_integration

test_integration.test_highOrderQuaternionConvergesFasterThanDefault()[source]

High-order attitude integration converges at a higher order than the default exponential-map path.

Both are compared against a high-accuracy reference (very small step). When the step is halved, the high-order (RK4) quaternion error falls by roughly 2^4 = 16, while the default path is only second order on SO(3) and falls by roughly 2^2 = 4.

test_integration.test_integration(showPlots: bool = False)[source]

Tests that integration with RK4 in Basilisk is equal to integration with RK4 in MuJoCo.

The simulation is simple. The multi-body is made of a central cube with two panels attached with one rotational degree of freedom (see test_sat.xml for details). No forces are exerted on the system, but the system is given an initial angular rate and the panels’ joints are initialized to some velocity.

The native mujoco toolbox was used to integrate this dynamic environment, and the results were saved to test_sat_qpos_reference.txt. Basilisk is also used to integrate these dynamics, using the same integrator, thus the results should be numerically identical.

test_integration.test_quaternionStaysNormalized(highOrder)[source]

The orientation quaternion stays unit-norm after many integration steps in both the default and high-order attitude modes.

test_integration.test_repeatedResetSucceeds()[source]

A scene can be reset more than once. test_sat.xml has nq != nv (free joint plus hinges), so the bulk states must be registered at their compiled sizes for a second reset to succeed.