Skip to content

Commit e5912c3

Browse files
yuvaltassacopybara-github
authored andcommitted
Use tolerance to compare quaternion components in UserObjectsTest.Inertial
Fixes #2515 PiperOrigin-RevId: 742704324 Change-Id: Ib26891e43128e66d2ac1840ed574285781fb12a5
1 parent a02a27d commit e5912c3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/user/user_objects_test.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2508,7 +2508,8 @@ TEST_F(UserObjectsTest, Inertial) {
25082508
mjtNum quat[4];
25092509
const mjtNum euler[3] = {3, 4, 5};
25102510
mju_euler2Quat(quat, euler, "xyz");
2511-
EXPECT_EQ(AsVector(m->body_iquat+4, 4), AsVector(quat, 4));
2511+
EXPECT_THAT(AsVector(m->body_iquat+4, 4),
2512+
Pointwise(DoubleNear(1e-8), AsVector(quat, 4)));
25122513

25132514
EXPECT_EQ(m->body_mass[2], 2);
25142515
EXPECT_THAT(AsVector(m->body_ipos+6, 3), ElementsAre(1, 2, 3));

0 commit comments

Comments
 (0)