PUBLIC: In mju_normalize4, don't normalize if norm is less than mjMINVAL away from 1.

This makes mj_forward calls idempotent if warmstart is disabled and quats in qpos are normalized.

PiperOrigin-RevId: 564442666
Change-Id: I9c43add82bcfb4101c19fbfbfc8c30091b8906d5
This commit is contained in:
Yuval Tassa
2023-09-11 11:08:08 -07:00
committed by Copybara-Service
parent 860f7b376a
commit 2b192cebb6
3 changed files with 48 additions and 2 deletions
+1 -1
View File
@@ -104,7 +104,7 @@ TEST_F(InverseTest, DiscreteInverseMatch) {
// depending on mjENBL_INVDISCRETE flag, expect mismatch to be small/large
if (invdiscrete) {
mjtNum epsilon = 1e-10;
mjtNum epsilon = 1e-9;
EXPECT_LT(data->solver_fwdinv[0], epsilon);
EXPECT_LT(data->solver_fwdinv[1], epsilon);
} else {