Skip to content

Commit

Permalink
Remove redundant namespace references
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <[email protected]>
  • Loading branch information
methylDragon committed Aug 9, 2022
1 parent 635f18a commit fc838dc
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 64 deletions.
8 changes: 4 additions & 4 deletions dartsim/src/JointFeatures_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

using namespace ignition;

using TestFeatureList = ignition::physics::FeatureList<
using TestFeatureList = physics::FeatureList<
physics::dartsim::RetrieveWorld,
physics::AttachFixedJointFeature,
physics::DetachJointFeature,
Expand All @@ -74,14 +74,14 @@ class JointFeaturesFixture : public ::testing::Test
{
protected: void SetUp() override
{
ignition::plugin::Loader loader;
plugin::Loader loader;
loader.LoadLib(dartsim_plugin_LIB);

ignition::plugin::PluginPtr dartsim =
plugin::PluginPtr dartsim =
loader.Instantiate("ignition::physics::dartsim::Plugin");

this->engine =
ignition::physics::RequestEngine3d<TestFeatureList>::From(dartsim);
physics::RequestEngine3d<TestFeatureList>::From(dartsim);
ASSERT_NE(nullptr, this->engine);
}
protected: TestEnginePtr engine;
Expand Down
8 changes: 4 additions & 4 deletions dartsim/src/KinematicsFeatures_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

using namespace ignition;

using TestFeatureList = ignition::physics::FeatureList<
using TestFeatureList = physics::FeatureList<
physics::ForwardStep,
physics::GetEntities,
physics::JointFrameSemantics,
Expand All @@ -57,14 +57,14 @@ class KinematicsFeaturesFixture : public ::testing::Test
{
protected: void SetUp() override
{
ignition::plugin::Loader loader;
plugin::Loader loader;
loader.LoadLib(dartsim_plugin_LIB);

ignition::plugin::PluginPtr dartsim =
plugin::PluginPtr dartsim =
loader.Instantiate("ignition::physics::dartsim::Plugin");

this->engine =
ignition::physics::RequestEngine3d<TestFeatureList>::From(dartsim);
physics::RequestEngine3d<TestFeatureList>::From(dartsim);
ASSERT_NE(nullptr, this->engine);
}
protected: TestEnginePtr engine;
Expand Down
14 changes: 7 additions & 7 deletions dartsim/src/LinkFeatures_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ class LinkFeaturesFixture : public ::testing::Test
{
protected: void SetUp() override
{
ignition::plugin::Loader loader;
plugin::Loader loader;
loader.LoadLib(dartsim_plugin_LIB);

ignition::plugin::PluginPtr dartsim =
plugin::PluginPtr dartsim =
loader.Instantiate("ignition::physics::dartsim::Plugin");

this->engine =
ignition::physics::RequestEngine3d<TestFeatureList>::From(dartsim);
physics::RequestEngine3d<TestFeatureList>::From(dartsim);
ASSERT_NE(nullptr, this->engine);
}
protected: TestEnginePtr engine;
Expand Down Expand Up @@ -102,7 +102,7 @@ class AssertVectorApprox
const char *_mExpr, const char *_nExpr, Eigen::Vector3d _m,
Eigen::Vector3d _n)
{
if (ignition::physics::test::Equal(_m, _n, this->tol))
if (physics::test::Equal(_m, _n, this->tol))
return ::testing::AssertionSuccess();

return ::testing::AssertionFailure()
Expand Down Expand Up @@ -134,9 +134,9 @@ TEST_F(LinkFeaturesFixture, LinkForceTorque)
linkSDF.SetInertial({massMatrix, math::Pose3d::Zero});
auto link = model->ConstructLink(linkSDF);

ignition::physics::ForwardStep::Input input;
ignition::physics::ForwardStep::State state;
ignition::physics::ForwardStep::Output output;
physics::ForwardStep::Input input;
physics::ForwardStep::State state;
physics::ForwardStep::Output output;

AssertVectorApprox vectorPredicate(1e-4);

Expand Down
22 changes: 11 additions & 11 deletions dartsim/src/ShapeFeatures_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

using namespace ignition;

using TestFeatureList = ignition::physics::FeatureList<
using TestFeatureList = physics::FeatureList<
physics::dartsim::RetrieveWorld,
physics::AttachFixedJointFeature,
physics::AddLinkExternalForceTorque,
Expand Down Expand Up @@ -85,14 +85,14 @@ class ShapeFeaturesFixture : public ::testing::Test
{
protected: void SetUp() override
{
ignition::plugin::Loader loader;
plugin::Loader loader;
loader.LoadLib(dartsim_plugin_LIB);

ignition::plugin::PluginPtr dartsim =
plugin::PluginPtr dartsim =
loader.Instantiate("ignition::physics::dartsim::Plugin");

this->engine =
ignition::physics::RequestEngine3d<TestFeatureList>::From(dartsim);
physics::RequestEngine3d<TestFeatureList>::From(dartsim);
ASSERT_NE(nullptr, this->engine);
}
protected: TestEnginePtr engine;
Expand Down Expand Up @@ -128,7 +128,7 @@ class AssertVectorApprox
const char *_mExpr, const char *_nExpr, Eigen::Vector3d _m,
Eigen::Vector3d _n)
{
if (ignition::physics::test::Equal(_m, _n, this->tol))
if (physics::test::Equal(_m, _n, this->tol))
return ::testing::AssertionSuccess();

return ::testing::AssertionFailure()
Expand Down Expand Up @@ -160,9 +160,9 @@ TEST_F(ShapeFeaturesFixture, PrimarySlipCompliance)

AssertVectorApprox vectorPredicate(1e-4);

ignition::physics::ForwardStep::Input input;
ignition::physics::ForwardStep::State state;
ignition::physics::ForwardStep::Output output;
physics::ForwardStep::Input input;
physics::ForwardStep::State state;
physics::ForwardStep::Output output;

// Check that link is at rest
{
Expand Down Expand Up @@ -223,9 +223,9 @@ TEST_F(ShapeFeaturesFixture, SecondarySlipCompliance)

AssertVectorApprox vectorPredicate(1e-4);

ignition::physics::ForwardStep::Input input;
ignition::physics::ForwardStep::State state;
ignition::physics::ForwardStep::Output output;
physics::ForwardStep::Input input;
physics::ForwardStep::State state;
physics::ForwardStep::Output output;

// Check that link is at rest
{
Expand Down
2 changes: 1 addition & 1 deletion src/FeatureList_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ TEST(FeatureList_TEST, ConflictsAndRequirements)

// This is a regression test. We need to make sure that this FeatureList
// compiles.
ignition::physics::FeatureList<OnlyConflictWith1, TestRequiresFeatureA>();
FeatureList<OnlyConflictWith1, TestRequiresFeatureA>();
}

TEST(FeatureList_TEST, Hierarchy)
Expand Down
50 changes: 25 additions & 25 deletions test/integration/DoublePendulum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@ void DoublePendulum_TEST(ignition::plugin::PluginPtr _plugin)

auto world = engine->GetWorld(0);

ignition::physics::ForwardStep::State state;
ignition::physics::ForwardStep::Output output;
ignition::physics::ForwardStep::Input input;
ForwardStep::State state;
ForwardStep::Output output;
ForwardStep::Input input;

const std::chrono::duration<double> dt(std::chrono::milliseconds(1));
ignition::physics::TimeStep &timeStep =
input.Get<ignition::physics::TimeStep>();
TimeStep &timeStep =
input.Get<TimeStep>();
timeStep.dt = dt.count();

ignition::physics::GeneralizedParameters &efforts =
input.Get<ignition::physics::GeneralizedParameters>();
GeneralizedParameters &efforts =
input.Get<GeneralizedParameters>();
efforts.dofs.push_back(0);
efforts.dofs.push_back(1);
efforts.forces.push_back(0.0);
Expand All @@ -78,11 +78,11 @@ void DoublePendulum_TEST(ignition::plugin::PluginPtr _plugin)
// No input on the first step, let's just see the output
world->Step(output, state, input);

ASSERT_TRUE(output.Has<ignition::physics::JointPositions>());
const auto positions0 = output.Get<ignition::physics::JointPositions>();
ASSERT_TRUE(output.Has<JointPositions>());
const auto positions0 = output.Get<JointPositions>();

ASSERT_TRUE(output.Has<ignition::physics::WorldPoses>());
const auto poses0 = output.Get<ignition::physics::WorldPoses>();
ASSERT_TRUE(output.Has<WorldPoses>());
const auto poses0 = output.Get<WorldPoses>();

// the double pendulum is initially fully inverted
// and angles are defined as zero in this state
Expand Down Expand Up @@ -116,7 +116,7 @@ void DoublePendulum_TEST(ignition::plugin::PluginPtr _plugin)
unsigned int settleSteps = settleTime / dt;
for (unsigned int i = 0; i < settleSteps; ++i)
{
auto positions = output.Get<ignition::physics::JointPositions>();
auto positions = output.Get<JointPositions>();
double error0 = positions.positions[positions.dofs[0]] - target10;
double error1 = positions.positions[positions.dofs[1]] - target11;

Expand All @@ -127,15 +127,15 @@ void DoublePendulum_TEST(ignition::plugin::PluginPtr _plugin)
}

// expect joints are near target positions
ASSERT_TRUE(output.Has<ignition::physics::JointPositions>());
auto positions1 = output.Get<ignition::physics::JointPositions>();
ASSERT_TRUE(output.Has<JointPositions>());
auto positions1 = output.Get<JointPositions>();
double angle10 = positions1.positions[positions1.dofs[0]];
double angle11 = positions1.positions[positions1.dofs[1]];
EXPECT_NEAR(target10, angle10, 1e-5);
EXPECT_NEAR(target11, angle11, 1e-3);

ASSERT_TRUE(output.Has<ignition::physics::WorldPoses>());
const auto poses1 = output.Get<ignition::physics::WorldPoses>();
ASSERT_TRUE(output.Has<WorldPoses>());
const auto poses1 = output.Get<WorldPoses>();
ASSERT_EQ(2u, poses1.entries.size());
for (const auto & worldPose : poses1.entries)
{
Expand All @@ -151,7 +151,7 @@ void DoublePendulum_TEST(ignition::plugin::PluginPtr _plugin)
}

// test recording the state and repeatability
ignition::physics::ForwardStep::State bookmark = state;
ForwardStep::State bookmark = state;
std::vector<double> errorHistory0;
std::vector<double> errorHistory1;

Expand All @@ -168,7 +168,7 @@ void DoublePendulum_TEST(ignition::plugin::PluginPtr _plugin)

for (unsigned int i = 0; i < settleSteps; ++i)
{
auto positions = output.Get<ignition::physics::JointPositions>();
auto positions = output.Get<JointPositions>();
double error0 = positions.positions[positions.dofs[0]] - target20;
double error1 = positions.positions[positions.dofs[1]] - target21;
errorHistory0.push_back(error0);
Expand All @@ -181,16 +181,16 @@ void DoublePendulum_TEST(ignition::plugin::PluginPtr _plugin)
}

// expect joints are near target positions again
ASSERT_TRUE(output.Has<ignition::physics::JointPositions>());
auto positions2 = output.Get<ignition::physics::JointPositions>();
ASSERT_TRUE(output.Has<JointPositions>());
auto positions2 = output.Get<JointPositions>();
double angle20 = positions2.positions[positions2.dofs[0]];
double angle21 = positions2.positions[positions2.dofs[1]];
EXPECT_NEAR(target20, angle20, 1e-4);
EXPECT_NEAR(target21, angle21, 1e-3);

// // Go back to the bookmarked state and run through the steps again.
// ignition::physics::SetState *setState =
// _plugin->QueryInterface<ignition::physics::SetState>();
// SetState *setState =
// _plugin->QueryInterface<SetState>();
// ASSERT_TRUE(setState);
// setState->SetStateTo(bookmark);

Expand All @@ -205,7 +205,7 @@ void DoublePendulum_TEST(ignition::plugin::PluginPtr _plugin)

// for (unsigned int i = 0; i < settleSteps; ++i)
// {
// auto positions = output.Get<ignition::physics::JointPositions>();
// auto positions = output.Get<JointPositions>();
// double error0 = positions.positions[positions.dofs[0]] - target20;
// double error1 = positions.positions[positions.dofs[1]] - target21;
// EXPECT_DOUBLE_EQ(error0, errorHistory0[i]);
Expand All @@ -218,8 +218,8 @@ void DoublePendulum_TEST(ignition::plugin::PluginPtr _plugin)
// }

// // expect joints are near target positions again
// ASSERT_TRUE(output.Has<ignition::physics::JointPositions>());
// auto positions3 = output.Get<ignition::physics::JointPositions>();
// ASSERT_TRUE(output.Has<JointPositions>());
// auto positions3 = output.Get<JointPositions>();
// double angle30 = positions3.positions[positions3.dofs[0]];
// double angle31 = positions3.positions[positions3.dofs[1]];
// EXPECT_DOUBLE_EQ(angle20, angle30);
Expand Down
8 changes: 4 additions & 4 deletions test/integration/FeatureSystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ TEST(FeatureSystem, MockPluginInvalidFeatures)
{
// mismatch between 2d and 3d
mock::MockEngine3dPtr engine =
ignition::physics::RequestEngine3d<mock::MockFeatureList>::From(
RequestEngine3d<mock::MockFeatureList>::From(
LoadMockPlugin("mock::EntitiesPlugin2d"));
EXPECT_EQ(nullptr, engine);
}
Expand All @@ -52,7 +52,7 @@ TEST(FeatureSystem, MockPluginInvalidFeatures)
TEST(FeatureSystem, MockPlugin)
{
mock::MockEngine3dPtr engine =
ignition::physics::RequestEngine3d<mock::MockFeatureList>::From(
RequestEngine3d<mock::MockFeatureList>::From(
LoadMockPlugin("mock::EntitiesPlugin3d"));

EXPECT_EQ("Only one engine", engine->Name());
Expand Down Expand Up @@ -116,7 +116,7 @@ TEST(FeatureSystem, MockPlugin)
TEST(FeatureSystem, MockCenterOfMass3d)
{
mock::MockEngine3dPtr engine =
ignition::physics::RequestEngine3d<mock::MockFeatureList>::From(
RequestEngine3d<mock::MockFeatureList>::From(
LoadMockPlugin("mock::EntitiesPlugin3d"));

mock::MockWorld3dPtr world = engine->GetWorld("Some world");
Expand Down Expand Up @@ -166,7 +166,7 @@ TEST(FeatureSystem, MockCenterOfMass3d)
TEST(FeatureSystem, MockCenterOfMass2d)
{
mock::MockEngine2dPtr engine =
ignition::physics::RequestEngine2d<mock::MockFeatureList>::From(
RequestEngine2d<mock::MockFeatureList>::From(
LoadMockPlugin("mock::EntitiesPlugin2d"));

mock::MockWorld2dPtr world = engine->GetWorld("Some world");
Expand Down
6 changes: 3 additions & 3 deletions tpe/lib/src/CollisionDetector_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ TEST(CollisionDetector, CheckCollisions)
Entity &collisionAEnt = linkA->AddCollision();
Collision *collisionA = static_cast<Collision *>(&collisionAEnt);
BoxShape boxShapeA;
boxShapeA.SetSize(ignition::math::Vector3d(4, 4, 4));
boxShapeA.SetSize(math::Vector3d(4, 4, 4));
collisionA->SetShape(boxShapeA);

// model B
Expand Down Expand Up @@ -255,7 +255,7 @@ TEST(CollisionDetector, CheckStaticCollisionFiltering)
Entity &collisionAEnt = linkA->AddCollision();
Collision *collisionA = static_cast<Collision *>(&collisionAEnt);
BoxShape boxShapeA;
boxShapeA.SetSize(ignition::math::Vector3d(4, 4, 4));
boxShapeA.SetSize(math::Vector3d(4, 4, 4));
collisionA->SetShape(boxShapeA);

// model B
Expand All @@ -266,7 +266,7 @@ TEST(CollisionDetector, CheckStaticCollisionFiltering)
Entity &collisionBEnt = linkB->AddCollision();
Collision *collisionB = static_cast<Collision *>(&collisionBEnt);
BoxShape boxShapeB;
boxShapeB.SetSize(ignition::math::Vector3d(4, 4, 4));
boxShapeB.SetSize(math::Vector3d(4, 4, 4));
collisionB->SetShape(boxShapeB);

// check collisions
Expand Down
8 changes: 4 additions & 4 deletions tpe/lib/src/Collision_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ TEST(Collision, BoxShape)
{
Collision collision;
BoxShape boxShape;
boxShape.SetSize(ignition::math::Vector3d(0.5, 0.5, 0.5));
boxShape.SetSize(math::Vector3d(0.5, 0.5, 0.5));
collision.SetShape(boxShape);
auto result = collision.GetShape();
ASSERT_NE(nullptr, result);
EXPECT_EQ(ignition::math::Vector3d(0.25, 0.25, 0.25),
EXPECT_EQ(math::Vector3d(0.25, 0.25, 0.25),
result->GetBoundingBox().Max());
}

Expand All @@ -78,7 +78,7 @@ TEST(Collision, CylinderShape)
collision.SetShape(cylinderShape);
auto result = collision.GetShape();
ASSERT_NE(nullptr, result);
EXPECT_EQ(ignition::math::Vector3d(2.0, 2.0, 1.5),
EXPECT_EQ(math::Vector3d(2.0, 2.0, 1.5),
result->GetBoundingBox().Max());
}

Expand All @@ -91,7 +91,7 @@ TEST(Collision, SphereShape)
collision.SetShape(sphereShape);
auto result = collision.GetShape();
ASSERT_NE(nullptr, result);
EXPECT_EQ(ignition::math::Vector3d(2.0, 2.0, 2.0),
EXPECT_EQ(math::Vector3d(2.0, 2.0, 2.0),
result->GetBoundingBox().Max());
}

Expand Down
2 changes: 1 addition & 1 deletion tpe/plugin/src/ShapeFeatures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ LinearVector3d ShapeFeatures::GetMeshShapeScale(
Identity ShapeFeatures::AttachMeshShape(
const Identity &_linkID,
const std::string &_name,
const ignition::common::Mesh &_mesh,
const common::Mesh &_mesh,
const Pose3d &_pose,
const LinearVector3d &_scale)
{
Expand Down

0 comments on commit fc838dc

Please sign in to comment.