StateBlock perturbation helper function for gtests
It would be usefull to have a generic way to perturbate KF stateblocks that are not fixed, which is usually done in factor gtests to test if the problem converges. I have implemented a first version as the functions perturbateIfUnFixed
and perturbateAllIfUnFixed
in the bodydynamics/include/bodydynamics/test/gtest_factor_force_torque.cpp
. For instance, this deals with quaternion stateblocks by defining a random perturbation on the tangent space (a given angle magnitude with random rotation axis) and then applying it using the SO(3) exponential.
I think this would save some code in the numerous gtests across the plugins and therefore should be added to core
. The question is where should I put it? The util_gtest.h
file in core
that could be a good candidate.
What other requirements do think this should have?