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 93ad694
Show file tree
Hide file tree
Showing 14 changed files with 86 additions and 86 deletions.
8 changes: 4 additions & 4 deletions dartsim/src/CustomMeshShape.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace dartsim {
namespace {
/////////////////////////////////////////////////
unsigned int CheckNumVerticesPerFaces(
const ignition::common::SubMesh &_inputSubmesh,
const SubMesh &_inputSubmesh,
const unsigned int _submeshIndex,
const std::string &_path)
{
Expand Down Expand Up @@ -76,7 +76,7 @@ unsigned int CheckNumVerticesPerFaces(

/////////////////////////////////////////////////
unsigned int GetPrimitiveType(
const ignition::common::SubMesh &_inputSubmesh)
const SubMesh &_inputSubmesh)
{
using namespace ignition::common;

Expand All @@ -97,7 +97,7 @@ unsigned int GetPrimitiveType(

/////////////////////////////////////////////////
CustomMeshShape::CustomMeshShape(
const ignition::common::Mesh &_input,
const Mesh &_input,
const Eigen::Vector3d &_scale)
: dart::dynamics::MeshShape(_scale, nullptr)
{
Expand All @@ -123,7 +123,7 @@ CustomMeshShape::CustomMeshShape(
// Fill in submesh contents
for (unsigned int i = 0; i < numSubMeshes; ++i)
{
const ignition::common::SubMeshPtr &inputSubmesh =
const SubMeshPtr &inputSubmesh =
_input.SubMeshByIndex(i).lock();

scene->mMeshes[i] = nullptr;
Expand Down
10 changes: 5 additions & 5 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 =
loader.Instantiate("ignition::physics::dartsim::Plugin");
plugin::PluginPtr dartsim =
loader.Instantiate("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
10 changes: 5 additions & 5 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 =
loader.Instantiate("ignition::physics::dartsim::Plugin");
plugin::PluginPtr dartsim =
loader.Instantiate("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
34 changes: 17 additions & 17 deletions dartsim/src/LinkFeatures_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@

#include "test/Utils.hh"

struct TestFeatureList : ignition::physics::FeatureList<
ignition::physics::AddLinkExternalForceTorque,
ignition::physics::ForwardStep,
ignition::physics::sdf::ConstructSdfWorld,
ignition::physics::sdf::ConstructSdfModel,
ignition::physics::sdf::ConstructSdfLink,
ignition::physics::GetEntities,
ignition::physics::GetLinkBoundingBox,
ignition::physics::GetModelBoundingBox
struct TestFeatureList : physics::FeatureList<
physics::AddLinkExternalForceTorque,
physics::ForwardStep,
physics::sdf::ConstructSdfWorld,
physics::sdf::ConstructSdfModel,
physics::sdf::ConstructSdfLink,
physics::GetEntities,
physics::GetLinkBoundingBox,
physics::GetModelBoundingBox
> { };

using namespace ignition;
Expand All @@ -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 =
loader.Instantiate("ignition::physics::dartsim::Plugin");
plugin::PluginPtr dartsim =
loader.Instantiate("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
24 changes: 12 additions & 12 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 =
loader.Instantiate("ignition::physics::dartsim::Plugin");
plugin::PluginPtr dartsim =
loader.Instantiate("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
Loading

0 comments on commit 93ad694

Please sign in to comment.