Skip to content

Commit

Permalink
review feedback for integration test
Browse files Browse the repository at this point in the history
Signed-off-by: Ashton Larkin <ashton@openrobotics.org>
  • Loading branch information
adlarkin committed May 11, 2021
1 parent 982f840 commit 3b80549
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions test/integration/physics_system.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,7 @@ TEST_F(PhysicsSystemFixture, NestedModelIndividualCanonicalLinks)
EXPECT_EQ(6u, postUpModelPoses.size());

auto modelIt = postUpModelPoses.find("model_00");
EXPECT_NE(postUpModelPoses.end(), modelIt);
ASSERT_NE(postUpModelPoses.end(), modelIt);

// link_00 is resting on the ground_box, so it remains stationary. And since
// it is the canonical link of the parent model, model_00, the model frame
Expand All @@ -1338,25 +1338,26 @@ TEST_F(PhysicsSystemFixture, NestedModelIndividualCanonicalLinks)
const double dt = 0.001;
const double zExpected = 0.5 * world->Gravity().Z() * pow(dt * iters, 2);
modelIt = postUpModelPoses.find("model_01");
EXPECT_NE(postUpModelPoses.end(), modelIt);
ASSERT_NE(postUpModelPoses.end(), modelIt);
EXPECT_NEAR(zExpected, modelIt->second.Z(), 1e-2);

// model_10, model_11 and model_12 share the same canonical link (link_11),
// which is a floating link. So, link_11 should fall due to gravity, which
// model_10, model_11 and model_12 share the same canonical link (link_12),
// which is a floating link. So, link_12 should fall due to gravity, which
// also means that the frames for model_10, model_11 and model_12 should fall
auto model10It = postUpModelPoses.find("model_10");
EXPECT_NE(postUpModelPoses.end(), model10It);
ASSERT_NE(postUpModelPoses.end(), model10It);
EXPECT_NEAR(zExpected, model10It->second.Z(), 1e-2);
auto model11It = postUpModelPoses.find("model_11");
EXPECT_NE(postUpModelPoses.end(), model11It);
ASSERT_NE(postUpModelPoses.end(), model11It);
auto model12It = postUpModelPoses.find("model_12");
EXPECT_NE(postUpModelPoses.end(), model12It);
ASSERT_NE(postUpModelPoses.end(), model12It);
// (since model_11 and model_12 are nested, their poses are computed w.r.t.
// model_10)
EXPECT_DOUBLE_EQ(0.0, model11It->second.Z());
EXPECT_DOUBLE_EQ(0.0, model12It->second.Z());
// check the world pose of model_11 and model_12 to make sure the z components
// of these world poses match zExpected
ASSERT_NE(nullptr, ecm);
const auto model11Entity =
ecm->EntityByComponents(components::Name(model11It->first));
ASSERT_NE(kNullEntity, model11Entity);
Expand Down

0 comments on commit 3b80549

Please sign in to comment.