Skip to content

Commit

Permalink
LinkFeatures_TEST: ValidateGraphs in LoadWorld
Browse files Browse the repository at this point in the history
Signed-off-by: Steven Peters <[email protected]>
  • Loading branch information
scpeters committed Jul 9, 2021
1 parent e21c8c9 commit e270f65
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dartsim/src/LinkFeatures_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,15 @@ TestWorldPtr LoadWorld(
{
sdf::Root root;
const sdf::Errors errors = root.Load(_sdfFile);
EXPECT_TRUE(errors.empty());
EXPECT_TRUE(errors.empty()) << errors;
const sdf::World *sdfWorld = root.WorldByIndex(0);
// Make a copy of the world so we can set the gravity property
// TODO(addisu) Add a world property feature to set gravity instead of this
// hack
sdf::World worldCopy;
worldCopy.Load(sdfWorld->Element());
auto graphErrors = worldCopy.ValidateGraphs();
EXPECT_EQ(0u, graphErrors.size()) << graphErrors;

worldCopy.SetGravity(math::eigen3::convert(_gravity));
return _engine->ConstructWorld(worldCopy);
Expand Down

0 comments on commit e270f65

Please sign in to comment.