test: preserve Dev verification contracts through Refactor APIs
This commit is contained in:
@@ -196,6 +196,21 @@ TEST(FiniteRotation,
|
||||
const Matrix left_jacobian = LeftJacobianSO3(phi);
|
||||
EXPECT_TRUE(IsFinite(left_jacobian));
|
||||
|
||||
// Preserve the original complete inverse-action check through the solve API.
|
||||
for (std::size_t column = 0; column < kRotationDimension; ++column) {
|
||||
const Vector3 basis{column == 0 ? 1.0 : 0.0,
|
||||
column == 1 ? 1.0 : 0.0,
|
||||
column == 2 ? 1.0 : 0.0};
|
||||
const auto solved = SpatialMomentSO3(phi, basis);
|
||||
ASSERT_TRUE(solved.HasValue());
|
||||
EXPECT_TRUE(std::isfinite(solved.Value().X()));
|
||||
EXPECT_TRUE(std::isfinite(solved.Value().Y()));
|
||||
EXPECT_TRUE(std::isfinite(solved.Value().Z()));
|
||||
const auto identity_column = Multiply(Transpose(left_jacobian), solved.Value());
|
||||
for (std::size_t row = 0; row < kRotationDimension; ++row)
|
||||
EXPECT_NEAR(identity_column[row], row == column ? 1.0 : 0.0, 1.0e-11);
|
||||
}
|
||||
|
||||
const Vector3 load{0.7, -0.2, 0.4};
|
||||
const auto spatial = SpatialMomentSO3(phi, load);
|
||||
ASSERT_TRUE(spatial.HasValue());
|
||||
|
||||
Reference in New Issue
Block a user