From 537a85453951fce0186feb3525496bb0e314fc5a Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Mon, 29 Jan 2024 17:35:52 +0000 Subject: [PATCH] Consolidate duplicated worlds Signed-off-by: Michael Carroll --- dartsim/src/SDFFeatures_TEST.cc | 15 +- dartsim/src/WorldFeatures_TEST.cc | 6 +- dartsim/src/Worlds.hh | 7 - dartsim/worlds/empty.sdf | 5 - dartsim/worlds/falling.world | 75 ---- dartsim/worlds/shapes.sdf | 191 ---------- dartsim/worlds/shapes_bitmask.sdf | 154 --------- dartsim/worlds/test.world | 383 --------------------- dartsim/worlds/world_with_nested_model.sdf | 75 ---- tpe/plugin/src/SDFFeatures_TEST.cc | 43 ++- tpe/plugin/src/SimulationFeatures_TEST.cc | 26 +- tpe/plugin/src/Worlds.hh | 40 --- tpe/plugin/worlds/nested_model.world | 37 -- tpe/plugin/worlds/shapes.world | 169 --------- tpe/plugin/worlds/shapes_bitmask.sdf | 154 --------- tpe/plugin/worlds/test.world | 328 ------------------ 16 files changed, 48 insertions(+), 1660 deletions(-) delete mode 100644 dartsim/worlds/empty.sdf delete mode 100644 dartsim/worlds/falling.world delete mode 100644 dartsim/worlds/shapes.sdf delete mode 100644 dartsim/worlds/shapes_bitmask.sdf delete mode 100644 dartsim/worlds/test.world delete mode 100644 dartsim/worlds/world_with_nested_model.sdf delete mode 100644 tpe/plugin/src/Worlds.hh delete mode 100644 tpe/plugin/worlds/nested_model.world delete mode 100644 tpe/plugin/worlds/shapes.world delete mode 100644 tpe/plugin/worlds/shapes_bitmask.sdf delete mode 100644 tpe/plugin/worlds/test.world diff --git a/dartsim/src/SDFFeatures_TEST.cc b/dartsim/src/SDFFeatures_TEST.cc index 83e6095cf..eda7a5520 100644 --- a/dartsim/src/SDFFeatures_TEST.cc +++ b/dartsim/src/SDFFeatures_TEST.cc @@ -53,7 +53,8 @@ #include #include -#include "dartsim/src/Worlds.hh" +#include +#include "Worlds.hh" using namespace gz; @@ -314,7 +315,7 @@ INSTANTIATE_TEST_SUITE_P(LoadWorld, SDFFeatures_TEST, // Test that the dartsim plugin loaded all the relevant information correctly. TEST_P(SDFFeatures_TEST, CheckDartsimData) { - WorldPtr world = this->LoadWorld(dartsim::worlds::kTestWorld); + WorldPtr world = this->LoadWorld(common_test::worlds::kTestWorld); ASSERT_NE(nullptr, world); dart::simulation::WorldPtr dartWorld = world->GetDartsimWorld(); @@ -422,7 +423,7 @@ TEST_P(SDFFeatures_TEST, CheckDartsimData) // Test that joint limits are working by running the simulation TEST_P(SDFFeatures_TEST, CheckJointLimitEnforcement) { - WorldPtr world = this->LoadWorld(dartsim::worlds::kTestWorld); + WorldPtr world = this->LoadWorld(common_test::worlds::kTestWorld); ASSERT_NE(nullptr, world); dart::simulation::WorldPtr dartWorld = world->GetDartsimWorld(); @@ -581,7 +582,7 @@ TEST_P(SDFFeatures_TEST, WorldIsParentOrChild) // TEST_P(SDFFeatures_TEST, WorldWithNestedModel) { - WorldPtr world = this->LoadWorld(dartsim::worlds::kWorldWithNestedModelSdf); + WorldPtr world = this->LoadWorld(common_test::worlds::kWorldWithNestedModelSdf); ASSERT_NE(nullptr, world); EXPECT_EQ(2u, world->GetModelCount()); @@ -690,7 +691,7 @@ TEST_P(SDFFeatures_TEST, WorldWithNestedModelJointToWorld) // Test that joint type falls back to fixed if the type is not supported TEST_P(SDFFeatures_TEST, FallbackToFixedJoint) { - WorldPtr world = this->LoadWorld(dartsim::worlds::kTestWorld); + WorldPtr world = this->LoadWorld(common_test::worlds::kTestWorld); ASSERT_NE(nullptr, world); dart::simulation::WorldPtr dartWorld = world->GetDartsimWorld(); @@ -964,7 +965,7 @@ TEST_P(SDFFeatures_FrameSemantics, ExplicitWorldFrames) ///////////////////////////////////////////////// TEST_P(SDFFeatures_TEST, Shapes) { - WorldPtr world = this->LoadWorld(dartsim::worlds::kShapesSdf); + WorldPtr world = this->LoadWorld(common_test::worlds::kShapesWorld); ASSERT_NE(nullptr, world); auto dartWorld = world->GetDartsimWorld(); @@ -973,7 +974,7 @@ TEST_P(SDFFeatures_TEST, Shapes) ASSERT_EQ(5u, dartWorld->getNumSkeletons()); int count{0}; - for (auto name : {"box", "cylinder", "sphere", "capsule", "ellipsoid"}) + for (auto name : {"sphere", "box", "cylinder", "capsule", "ellipsoid"}) { const auto skeleton = dartWorld->getSkeleton(count++); ASSERT_NE(nullptr, skeleton); diff --git a/dartsim/src/WorldFeatures_TEST.cc b/dartsim/src/WorldFeatures_TEST.cc index 9f6fa75ba..fe0eef69a 100644 --- a/dartsim/src/WorldFeatures_TEST.cc +++ b/dartsim/src/WorldFeatures_TEST.cc @@ -32,7 +32,7 @@ #include #include "test/Utils.hh" -#include "Worlds.hh" +#include "test/common_test/Worlds.hh" struct TestFeatureList : gz::physics::FeatureList< gz::physics::CollisionDetector, @@ -83,7 +83,7 @@ TestWorldPtr LoadWorld( ////////////////////////////////////////////////// TEST_F(WorldFeaturesFixture, CollisionDetector) { - const auto world = LoadWorld(this->engine, dartsim::worlds::kEmptySdf); + const auto world = LoadWorld(this->engine, common_test::worlds::kEmptySdf); EXPECT_EQ("ode", world->GetCollisionDetector()); world->SetCollisionDetector("banana"); @@ -105,7 +105,7 @@ TEST_F(WorldFeaturesFixture, CollisionDetector) ////////////////////////////////////////////////// TEST_F(WorldFeaturesFixture, Solver) { - const auto world = LoadWorld(this->engine, dartsim::worlds::kEmptySdf); + const auto world = LoadWorld(this->engine, common_test::worlds::kEmptySdf); EXPECT_EQ("DantzigBoxedLcpSolver", world->GetSolver()); diff --git a/dartsim/src/Worlds.hh b/dartsim/src/Worlds.hh index 0cc2331da..4ffa870da 100644 --- a/dartsim/src/Worlds.hh +++ b/dartsim/src/Worlds.hh @@ -33,17 +33,10 @@ inline std::string DartsimTestWorld(const std::string &_world) namespace dartsim::worlds { const auto kAddedMassSdf = DartsimTestWorld("added_mass.sdf"); -const auto kEmptySdf = DartsimTestWorld("empty.sdf"); -const auto kFallingWorld = DartsimTestWorld("falling.world"); const auto kJointAcrossNestedModelsSdf = DartsimTestWorld("joint_across_nested_models.sdf"); const auto kModelFramesSdf = DartsimTestWorld("model_frames.sdf"); -const auto kShapesSdf = DartsimTestWorld("shapes.sdf"); -const auto kShapesBitmaskWorld = DartsimTestWorld("shapes_bitmask.sdf"); -const auto kTestWorld = DartsimTestWorld("test.world"); const auto kWorldFramesSdf = DartsimTestWorld("world_frames.sdf"); -const auto kWorldWithNestedModelSdf = - DartsimTestWorld("world_with_nested_model.sdf"); const auto kWorldWithNestedModelJointToWorldSdf = DartsimTestWorld("world_with_nested_model_joint_to_world.sdf"); } // namespace dartsim::worlds diff --git a/dartsim/worlds/empty.sdf b/dartsim/worlds/empty.sdf deleted file mode 100644 index 62150c14a..000000000 --- a/dartsim/worlds/empty.sdf +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/dartsim/worlds/falling.world b/dartsim/worlds/falling.world deleted file mode 100644 index 1d2ea2f43..000000000 --- a/dartsim/worlds/falling.world +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - 0 0 2 0 0.78539816339 0 - - 0.0 0.0 0.0 0 0 0 - - - 0.4 - 0 - 0 - 0.4 - 0 - 0.4 - - 1.0 - - - 0.0 0.0 0.0 0 0 0 - - - 1 - - - - - 0.0 0.0 0.0 0 0 0 - - - 1 - - - - - - - true - 0 0 -0.5 0 0 0.78539816339 - - - - 1 - 0 - 0 - 1 - 0 - 1 - - 1.0 - - 0.0 0.0 0.0 0 0 0 - - - - 100 100 1 - - - - - - - - 100 100 1 - - - - - - - diff --git a/dartsim/worlds/shapes.sdf b/dartsim/worlds/shapes.sdf deleted file mode 100644 index 733c82ac2..000000000 --- a/dartsim/worlds/shapes.sdf +++ /dev/null @@ -1,191 +0,0 @@ - - - - - 0 0 0.5 0 0 0 - - - - 0.16666 - 0 - 0 - 0.16666 - 0 - 0.16666 - - 1.0 - - - - - 1 1 1 - - - - - - - - 1 1 1 - - - - 1 0 0 1 - 1 0 0 1 - 1 0 0 1 - - - - - - - 0 -1.5 0.5 0 0 0 - - - - 0.1458 - 0 - 0 - 0.1458 - 0 - 0.125 - - 1.0 - - - - - 0.5 - 1.0 - - - - - - - - 0.5 - 1.0 - - - - 0 1 0 1 - 0 1 0 1 - 0 1 0 1 - - - - - - - 0 1.5 0.5 0 0 0 - - - - 0.1 - 0 - 0 - 0.1 - 0 - 0.1 - - 1.0 - - - - - 0.5 - - - - - - - - 0.5 - - - - 0 0 1 1 - 0 0 1 1 - 0 0 1 1 - - - - - - - 0 -3.0 0.5 0 0 0 - - - - 0.074154 - 0 - 0 - 0.074154 - 0 - 0.018769 - - 1.0 - - - - - 0.2 - 0.6 - - - - - - - 0.2 - 0.6 - - - - 1 1 0 1 - 1 1 0 1 - 1 1 0 1 - - - - - - - 0 3.0 0.5 0 0 0 - - - - 0.068 - 0 - 0 - 0.058 - 0 - 0.026 - - 1.0 - - - - - 0.2 0.3 0.5 - - - - - - - 0.2 0.3 0.5 - - - - 1 0 1 1 - 1 0 1 1 - 1 0 1 1 - - - - - - diff --git a/dartsim/worlds/shapes_bitmask.sdf b/dartsim/worlds/shapes_bitmask.sdf deleted file mode 100644 index 8aa289fce..000000000 --- a/dartsim/worlds/shapes_bitmask.sdf +++ /dev/null @@ -1,154 +0,0 @@ - - - - - true - - - - - 0 0 1 - - - - - - - 0 0 1 - 100 100 - - - - 0.8 0.8 0.8 1 - 0.8 0.8 0.8 1 - 0.8 0.8 0.8 1 - - - - - - - 0 0 10.0 0 0 0 - - - - 1 - 0 - 0 - 1 - 0 - 1 - - 1.0 - - - - - 1 1 1 - - - - - 0x01 - - - - - - - 1 1 1 - - - - 1 0 0 1 - 1 0 0 1 - 1 0 0 1 - - - - - - - 0 0.75 10.0 0 0 0 - - - - 1 - 0 - 0 - 1 - 0 - 1 - - 1.0 - - - - - 1 1 1 - - - - - 0x02 - - - - - - - 1 1 1 - - - - 0 1 0 1 - 0 1 0 1 - 0 1 0 1 - - - - - - - 0 -0.75 10.0 0 0 0 - - - - 1 - 0 - 0 - 1 - 0 - 1 - - 1.0 - - - - - 1 1 1 - - - - - 0x03 - - - - - - - 1 1 1 - - - - 1 1 0 1 - 1 1 0 1 - 1 1 0 1 - - - - - - - diff --git a/dartsim/worlds/test.world b/dartsim/worlds/test.world deleted file mode 100644 index b75496857..000000000 --- a/dartsim/worlds/test.world +++ /dev/null @@ -1,383 +0,0 @@ - - - - - true - - - - - 0 0 1 - 100 100 - - - - - - 100 - 50 - - - - - - false - - - 0 0 1 - 100 100 - - - - 0.9 0.9 0.9 1 - - - - - - 1 0 0 0 0 0 - - - 100 - - - 0 0 0.01 0 0 0 - - - 0.8 - 0.02 - - - - 1 1 0 1 - - - - -0.275 0 1.1 0 0 0 - - - 0.2 0.2 2.2 - - - - 1 1 0 1 - - - - 0 0 0.01 0 0 0 - - - 0.8 - 0.02 - - - - - -0.275 0 1.1 0 0 0 - - - 0.2 0.2 2.2 - - - - - - 1.1 - - - - - - - - 0 0 2.1 -1.5708 0 0 - 0 - - 0 0 0.5 0 0 0 - - - -0.05 0 0 0 1.5708 0 - - - 0.1 - 0.3 - - - - 1 1 0 1 - - - - 0 0 1.0 0 1.5708 0 - - - 0.1 - 0.2 - - - - 1 1 0 1 - - - - 0 0 0.5 0 0 0 - - - 0.1 - 0.9 - - - - 1 1 0 1 - - - - -0.05 0 0 0 1.5708 0 - - - 0.1 - 0.3 - - - - - - 0.1 - - - - - - 0 0 1.0 0 1.5708 0 - - - 0.1 - 0.2 - - - - - 0 0 0.5 0 0 0 - - - 0.1 - 0.9 - - - - - - - 0.25 1.0 2.1 -2 0 0 - 0 - - 0 0 0.5 0 0 0 - - - 0 0 0 0 1.5708 0 - - - 0.08 - 0.3 - - - - 1 1 0 1 - - - - 0 0 0.5 0 0 0 - - - 0.1 - 0.9 - - - - 1 1 0 1 - - - - 0 0 0 0 1.5708 0 - - - 0.08 - 0.3 - - - - - 0 0 0.5 0 0 0 - - - 0.1 - 0.9 - - - - - - - base - upper_link - - 1.0 0 0 - - 3.0 - - - - - - upper_link - lower_link - - 1.0 0 0 - - 3.0 - - - - - - - 0.0 10.0 10.0 0.0 0.0 0.0 - - 0.0 0.0 0.0 0.0 0.0 0.0 - - - - 1.0 - - - - - 0.8 - - - - - - - - 10 0 2 0 0 0 - - - 100 - - - 0 0 0 -1.57 0 0 - - - 0.1 - 0.2 - - - - - - 1 0 0 0 0 0 - - 1 - - - - - 0.1 0.1 0.1 - - - - - - world - base - - - -1 0 0 0 0 0 - base - bar - - 0 1 0 - - -0.5 - 0.5 - 100 - - - - - - - 10 10 2 0 0 0 - - - 100 - - - 0 0 0 -1.57 0 0 - - - 0.1 - 0.2 - - - - - - 0 0 -1 0 0 0 - - 1 - - - - - 0.1 0.1 0.1 - - - - - - world - base - - - 0 0 1 0 0 0 - base - bar - - 0 1 0 - - - - - - - - link0 - link1 - 2 - - - - - - - - link0 - link1 - - - - - link2 - link3 - - - - - link4 - link5 - - - - diff --git a/dartsim/worlds/world_with_nested_model.sdf b/dartsim/worlds/world_with_nested_model.sdf deleted file mode 100644 index 0b71ad0d7..000000000 --- a/dartsim/worlds/world_with_nested_model.sdf +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - 1 2 2 0 0 0 - - 3 1 1 0 0 1.5707 - - - - 2 - - - - - - 0 1 0 1.5707 0 0 - - - - 2 - - - - - - nested_link1 - nested_link2 - - 1 0 0 - - - - - - - - 1 2 3 - - - - - - - 1 2 3 - - - - - - - link1 - nested_model::nested_link1 - - - - - - - - - - - - - - - - - - - - diff --git a/tpe/plugin/src/SDFFeatures_TEST.cc b/tpe/plugin/src/SDFFeatures_TEST.cc index eb619c82d..ec92eb380 100644 --- a/tpe/plugin/src/SDFFeatures_TEST.cc +++ b/tpe/plugin/src/SDFFeatures_TEST.cc @@ -23,7 +23,7 @@ #include #include -#include "Worlds.hh" +#include #include @@ -91,11 +91,11 @@ World LoadWorld(const std::string &_world) // Test that the tpe plugin loaded all the relevant information correctly. TEST(SDFFeatures_TEST, CheckTpeData) { - auto world = LoadWorld(tpe::worlds::kTestWorld); + auto world = LoadWorld(common_test::worlds::kTestWorld); auto tpeWorld = world.GetTpeLibWorld(); ASSERT_NE(nullptr, tpeWorld); - ASSERT_EQ(6u, tpeWorld->GetChildCount()); + ASSERT_EQ(7u, tpeWorld->GetChildCount()); // check model 01 { @@ -254,7 +254,13 @@ TEST(SDFFeatures_TEST, CheckTpeData) link.GetId()); EXPECT_EQ("link", link.GetName()); EXPECT_EQ(math::Pose3d::Zero, link.GetPose()); - EXPECT_EQ(0u, link.GetChildCount()); + EXPECT_EQ(1u, link.GetChildCount()); + + auto &collision = link.GetChildByName("collision1"); + ASSERT_NE(physics::tpelib::Entity::kNullEntity.GetId(), + collision.GetId()); + EXPECT_EQ("collision1", collision.GetName()); + EXPECT_EQ(0u, collision.GetChildCount()); } // check model 04 @@ -364,26 +370,26 @@ TEST(SDFFeatures_TEST, CheckTpeData) // Test that the tpe plugin loaded nested models correctly. TEST(SDFFeatures_TEST, NestedModel) { - auto world = LoadWorld(tpe::worlds::kNestedModelWorld); + auto world = LoadWorld(common_test::worlds::kWorldWithNestedModelSdf); auto tpeWorld = world.GetTpeLibWorld(); ASSERT_NE(nullptr, tpeWorld); - ASSERT_EQ(1u, tpeWorld->GetChildCount()); - EXPECT_EQ(1u, world.GetModelCount()); + ASSERT_EQ(2u, tpeWorld->GetChildCount()); + EXPECT_EQ(2u, world.GetModelCount()); // check top level model physics::tpelib::Entity &model = - tpeWorld->GetChildByName("model"); + tpeWorld->GetChildByName("parent_model"); ASSERT_NE(physics::tpelib::Entity::kNullEntity.GetId(), model.GetId()); - EXPECT_EQ("model", model.GetName()); + EXPECT_EQ("parent_model", model.GetName()); EXPECT_EQ(math::Pose3d::Zero, model.GetPose()); - EXPECT_EQ(2u, model.GetChildCount()); + EXPECT_EQ(4u, model.GetChildCount()); - physics::tpelib::Entity &link = model.GetChildByName("link"); + physics::tpelib::Entity &link = model.GetChildByName("link1"); ASSERT_NE(physics::tpelib::Entity::kNullEntity.GetId(), link.GetId()); - EXPECT_EQ("link", link.GetName()); + EXPECT_EQ("link1", link.GetName()); EXPECT_EQ(math::Pose3d::Zero, link.GetPose()); EXPECT_EQ(1u, link.GetChildCount()); @@ -401,27 +407,26 @@ TEST(SDFFeatures_TEST, NestedModel) nestedModel.GetId()); EXPECT_EQ("nested_model", nestedModel.GetName()); EXPECT_EQ(math::Pose3d(1, 2, 2, 0, 0, 0), nestedModel.GetPose()); - EXPECT_EQ(1u, nestedModel.GetChildCount()); + EXPECT_EQ(2u, nestedModel.GetChildCount()); physics::tpelib::Entity &nestedLink = - nestedModel.GetChildByName("nested_link"); + nestedModel.GetChildByName("nested_link1"); ASSERT_NE(physics::tpelib::Entity::kNullEntity.GetId(), nestedLink.GetId()); - EXPECT_EQ("nested_link", nestedLink.GetName()); + EXPECT_EQ("nested_link1", nestedLink.GetName()); EXPECT_EQ(math::Pose3d(3, 1, 1, 0, 0, 1.5707), nestedLink.GetPose()); EXPECT_EQ(1u, nestedLink.GetChildCount()); physics::tpelib::Entity &nestedCollision = - nestedLink.GetChildByName("nested_collision"); + nestedLink.GetChildByName("nested_collision1"); ASSERT_NE(physics::tpelib::Entity::kNullEntity.GetId(), nestedCollision.GetId()); - EXPECT_EQ("nested_collision", nestedCollision.GetName()); + EXPECT_EQ("nested_collision1", nestedCollision.GetName()); EXPECT_EQ(math::Pose3d::Zero, nestedCollision.GetPose()); // canonical link - physics::tpelib::Model *m = - static_cast(&model); + auto *m = dynamic_cast(&model); physics::tpelib::Entity canLink = m->GetCanonicalLink(); EXPECT_EQ(link.GetId(), canLink.GetId()); } diff --git a/tpe/plugin/src/SimulationFeatures_TEST.cc b/tpe/plugin/src/SimulationFeatures_TEST.cc index 81660996c..ddecee5de 100644 --- a/tpe/plugin/src/SimulationFeatures_TEST.cc +++ b/tpe/plugin/src/SimulationFeatures_TEST.cc @@ -41,9 +41,9 @@ #include #include +#include #include #include -#include "Worlds.hh" #include "EntityManagementFeatures.hh" #include "FreeGroupFeatures.hh" @@ -52,6 +52,7 @@ #include "World.hh" + using namespace gz; struct TestFeatureList : physics::FeatureList< @@ -276,7 +277,7 @@ TEST_P(SimulationFeatures_TEST, StepWorld) return; gzdbg << "Testing library " << library << std::endl; - const auto worlds = LoadWorlds(library, tpe::worlds::kShapesWorld); + const auto worlds = LoadWorlds(library, common_test::worlds::kShapesWorld); for (const auto &world : worlds) { @@ -299,7 +300,7 @@ TEST_P(SimulationFeatures_TEST, ShapeFeatures) if (library.empty()) return; - const auto worlds = LoadWorlds(library, tpe::worlds::kShapesWorld); + const auto worlds = LoadWorlds(library, common_test::worlds::kShapesWorld); for (const auto &world : worlds) { @@ -438,7 +439,7 @@ TEST_P(SimulationFeatures_TEST, FreeGroup) if (library.empty()) return; - const auto worlds = LoadWorlds(library, tpe::worlds::kShapesWorld); + const auto worlds = LoadWorlds(library, common_test::worlds::kShapesWorld); for (const auto &world : worlds) { @@ -486,7 +487,8 @@ TEST_P(SimulationFeatures_TEST, NestedFreeGroup) if (library.empty()) return; - const auto worlds = LoadWorlds(library, tpe::worlds::kNestedModelWorld); + const auto worlds = + LoadWorlds(library, common_test::worlds::kWorldWithNestedModelSdf); for (const auto &world : worlds) { @@ -494,7 +496,7 @@ TEST_P(SimulationFeatures_TEST, NestedFreeGroup) ASSERT_NE(nullptr, tpeWorld); // model free group test - auto model = world->GetModel("model"); + auto model = world->GetModel("parent_model"); ASSERT_NE(nullptr, model); auto freeGroup = model->FindFreeGroup(); ASSERT_NE(nullptr, freeGroup); @@ -504,7 +506,7 @@ TEST_P(SimulationFeatures_TEST, NestedFreeGroup) freeGroup->SetWorldPose(math::eigen3::convert(newPose)); { - auto link = model->GetLink("link"); + auto link = model->GetLink("link1"); ASSERT_NE(nullptr, link); auto frameData = link->FrameDataRelativeToWorld(); EXPECT_EQ(newPose, @@ -513,7 +515,7 @@ TEST_P(SimulationFeatures_TEST, NestedFreeGroup) { auto nestedModel = model->GetNestedModel("nested_model"); ASSERT_NE(nullptr, nestedModel); - auto nestedLink = nestedModel->GetLink("nested_link"); + auto nestedLink = nestedModel->GetLink("nested_link1"); ASSERT_NE(nullptr, nestedLink); // Poses from SDF @@ -536,10 +538,8 @@ TEST_P(SimulationFeatures_TEST, CollideBitmasks) if (library.empty()) return; - const auto worldPath = - gz::common::testing::SourceFile( - "tpe", "plugin", "worlds", "shapes_bitmask.sdf"); - const auto worlds = LoadWorlds(library, tpe::worlds::kShapesBitmaskSdf); + const auto worlds = + LoadWorlds(library, common_test::worlds::kShapesBitmaskWorld); for (const auto &world : worlds) { @@ -583,7 +583,7 @@ TEST_P(SimulationFeatures_TEST, RetrieveContacts) if (library.empty()) return; - const auto worlds = LoadWorlds(library, tpe::worlds::kShapesWorld); + const auto worlds = LoadWorlds(library, common_test::worlds::kShapesWorld); for (const auto &world : worlds) { diff --git a/tpe/plugin/src/Worlds.hh b/tpe/plugin/src/Worlds.hh deleted file mode 100644 index d700ba878..000000000 --- a/tpe/plugin/src/Worlds.hh +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2024 Open Source Robotics Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef TPE_PLUGIN_WORLDS_HH_ -#define TPE_PLUGIN_WORLDS_HH_ - -#include - -#include - -// \brief retrieve a filename from the tpe/plugin/worlds directory -// \param[in] _world filename to retrieve -// \return full path to the request world -inline std::string TpeTestWorld(const std::string &_world) -{ - return gz::common::testing::SourceFile("tpe", "plugin", "worlds", _world); -} - -namespace tpe::worlds -{ -const auto kNestedModelWorld = TpeTestWorld("nested_model.world"); -const auto kShapesWorld = TpeTestWorld("shapes.world"); -const auto kShapesBitmaskSdf = TpeTestWorld("shapes_bitmask.sdf"); -const auto kTestWorld = TpeTestWorld("test.world"); -} // namespace tpe::worlds -#endif // TPE_PLUGIN_WORLDS_HH_ diff --git a/tpe/plugin/worlds/nested_model.world b/tpe/plugin/worlds/nested_model.world deleted file mode 100644 index a2182472a..000000000 --- a/tpe/plugin/worlds/nested_model.world +++ /dev/null @@ -1,37 +0,0 @@ - - - - - true - - 1 2 2 0 0 0 - - 3 1 1 0 0 1.5707 - - - - 2 - - - - - - - - - - 1 2 3 - - - - - - - 1 2 3 - - - - - - - diff --git a/tpe/plugin/worlds/shapes.world b/tpe/plugin/worlds/shapes.world deleted file mode 100644 index cb3bce5d9..000000000 --- a/tpe/plugin/worlds/shapes.world +++ /dev/null @@ -1,169 +0,0 @@ - - - - - 0 1.5 0.5 0 0 0 - - - - 3 - 0 - 0 - 3 - 0 - 3 - - 1.0 - - - - - 1 - - - - - - - 1 - - - - - - - - true - 0 0 0.5 0 0 0 - - - - 1 - 0 - 0 - 1 - 0 - 1 - - 1.0 - - - - - 100 100 1 - - - - - - - 100 100 1 - - - - - - - - 0 -1.5 0.5 0 0 0 - - - - 2 - 0 - 0 - 2 - 0 - 2 - - 2.0 - - - - - 0.5 - 1.1 - - - - - - - 0.5 - 1.1 - - - - - - - - 0 -3.0 0.5 0 0 0 - - - - 0.074154 - 0 - 0 - 0.074154 - 0 - 0.018769 - - 1.0 - - - - - 0.2 - 0.6 - - - - - - - 0.2 - 0.6 - - - - 1 1 0 1 - 1 1 0 1 - 1 1 0 1 - - - - - - - 0 -5 0.7 0 0 0 - - - - 0.068 - 0 - 0 - 0.058 - 0 - 0.026 - - 1.0 - - - - - 0.2 0.3 0.5 - - - - - - - 0.2 0.3 0.5 - - - - - - - diff --git a/tpe/plugin/worlds/shapes_bitmask.sdf b/tpe/plugin/worlds/shapes_bitmask.sdf deleted file mode 100644 index 8aa289fce..000000000 --- a/tpe/plugin/worlds/shapes_bitmask.sdf +++ /dev/null @@ -1,154 +0,0 @@ - - - - - true - - - - - 0 0 1 - - - - - - - 0 0 1 - 100 100 - - - - 0.8 0.8 0.8 1 - 0.8 0.8 0.8 1 - 0.8 0.8 0.8 1 - - - - - - - 0 0 10.0 0 0 0 - - - - 1 - 0 - 0 - 1 - 0 - 1 - - 1.0 - - - - - 1 1 1 - - - - - 0x01 - - - - - - - 1 1 1 - - - - 1 0 0 1 - 1 0 0 1 - 1 0 0 1 - - - - - - - 0 0.75 10.0 0 0 0 - - - - 1 - 0 - 0 - 1 - 0 - 1 - - 1.0 - - - - - 1 1 1 - - - - - 0x02 - - - - - - - 1 1 1 - - - - 0 1 0 1 - 0 1 0 1 - 0 1 0 1 - - - - - - - 0 -0.75 10.0 0 0 0 - - - - 1 - 0 - 0 - 1 - 0 - 1 - - 1.0 - - - - - 1 1 1 - - - - - 0x03 - - - - - - - 1 1 1 - - - - 1 1 0 1 - 1 1 0 1 - 1 1 0 1 - - - - - - - diff --git a/tpe/plugin/worlds/test.world b/tpe/plugin/worlds/test.world deleted file mode 100644 index edbbe74cf..000000000 --- a/tpe/plugin/worlds/test.world +++ /dev/null @@ -1,328 +0,0 @@ - - - - - true - - - - - 0 0 1 - 100 100 - - - - - - 100 - 50 - - - - - - false - - - 0 0 1 - 100 100 - - - - 0.9 0.9 0.9 1 - - - - - - 1 0 0 0 0 0 - - - 100 - - - 0 0 0.01 0 0 0 - - - 0.8 - 0.02 - - - - 1 1 0 1 - - - - -0.275 0 1.1 0 0 0 - - - 0.2 0.2 2.2 - - - - 1 1 0 1 - - - - 0 0 0.01 0 0 0 - - - 0.8 - 0.02 - - - - - -0.275 0 1.1 0 0 0 - - - 0.2 0.2 2.2 - - - - - - 1.1 - - - - - - - - 0 0 2.1 -1.5708 0 0 - 0 - - 0 0 0.5 0 0 0 - - - -0.05 0 0 0 1.5708 0 - - - 0.1 - 0.3 - - - - 1 1 0 1 - - - - 0 0 1.0 0 1.5708 0 - - - 0.1 - 0.2 - - - - 1 1 0 1 - - - - 0 0 0.5 0 0 0 - - - 0.1 - 0.9 - - - - 1 1 0 1 - - - - -0.05 0 0 0 1.5708 0 - - - 0.1 - 0.3 - - - - - - 0.1 - - - - - - 0 0 1.0 0 1.5708 0 - - - 0.1 - 0.2 - - - - - 0 0 0.5 0 0 0 - - - 0.1 - 0.9 - - - - - - - 0.25 1.0 2.1 -2 0 0 - 0 - - 0 0 0.5 0 0 0 - - - 0 0 0 0 1.5708 0 - - - 0.08 - 0.3 - - - - 1 1 0 1 - - - - 0 0 0.5 0 0 0 - - - 0.1 - 0.9 - - - - 1 1 0 1 - - - - 0 0 0 0 1.5708 0 - - - 0.08 - 0.3 - - - - - 0 0 0.5 0 0 0 - - - 0.1 - 0.9 - - - - - - - base - upper_link - - 1.0 0 0 - - 3.0 - - - - - - upper_link - lower_link - - 1.0 0 0 - - 3.0 - - - - - - - 0.0 10.0 10.0 0.0 0.0 0.0 - - 0.0 0.0 0.0 0.0 0.0 0.0 - - - - - 10 0 2 0 0 0 - - - 100 - - - 0 0 0 -1.57 0 0 - - - 0.1 - 0.2 - - - - - - 1 0 0 0 0 0 - - 1 - - - - - 0.1 0.1 0.1 - - - - - - world - base - - - -1 0 0 0 0 0 - base - bar - - 0 1 0 - - -0.5 - 0.5 - 100 - - - - - - - - - link0 - link1 - 2 - - - - - - - - link0 - link1 - - - - - link2 - link3 - - - - - link4 - link5 - - - -