Skip to content

Commit

Permalink
Leave ignition as primary in headers to fix ABI
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <[email protected]>
  • Loading branch information
methylDragon committed Aug 26, 2022
1 parent 49d45d2 commit 34f14fd
Show file tree
Hide file tree
Showing 213 changed files with 1,056 additions and 1,048 deletions.
2 changes: 1 addition & 1 deletion dartsim/include/gz/physics/dartsim/World.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <gz/physics/FeatureList.hh>

namespace gz {
namespace ignition {
namespace physics {
namespace dartsim {

Expand Down
2 changes: 1 addition & 1 deletion dartsim/src/Base.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <gz/common/Console.hh>
#include <gz/physics/Implements.hh>

namespace gz {
namespace ignition {
namespace physics {
namespace dartsim {

Expand Down
2 changes: 1 addition & 1 deletion dartsim/src/Base_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "EntityManagementFeatures.hh"
#include "SDFFeatures.hh"

using namespace gz::physics;
using namespace ignition::physics;



Expand Down
50 changes: 25 additions & 25 deletions dartsim/src/Collisions_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,43 +35,43 @@

#include <gz/common/MeshManager.hh>

using TestFeatureList = gz::physics::FeatureList<
gz::physics::LinkFrameSemantics,
gz::physics::ForwardStep,
gz::physics::GetEntities,
gz::physics::ConstructEmptyWorldFeature,
gz::physics::ConstructEmptyModelFeature,
gz::physics::ConstructEmptyLinkFeature,
gz::physics::mesh::AttachMeshShapeFeature,
gz::physics::AttachPlaneShapeFeature,
gz::physics::SetFreeJointRelativeTransformFeature,
gz::physics::AttachFixedJointFeature
using TestFeatureList = ignition::physics::FeatureList<
ignition::physics::LinkFrameSemantics,
ignition::physics::ForwardStep,
ignition::physics::GetEntities,
ignition::physics::ConstructEmptyWorldFeature,
ignition::physics::ConstructEmptyModelFeature,
ignition::physics::ConstructEmptyLinkFeature,
ignition::physics::mesh::AttachMeshShapeFeature,
ignition::physics::AttachPlaneShapeFeature,
ignition::physics::SetFreeJointRelativeTransformFeature,
ignition::physics::AttachFixedJointFeature
>;

using TestWorldPtr = gz::physics::World3dPtr<TestFeatureList>;
using TestEnginePtr = gz::physics::Engine3dPtr<TestFeatureList>;
using TestWorldPtr = ignition::physics::World3dPtr<TestFeatureList>;
using TestEnginePtr = ignition::physics::Engine3dPtr<TestFeatureList>;

using WorldConstructor = std::function<TestWorldPtr(const TestEnginePtr&)>;

std::unordered_set<TestWorldPtr> LoadWorlds(
const std::string &_library,
const WorldConstructor &_constructor)
{
gz::plugin::Loader loader;
ignition::plugin::Loader loader;
loader.LoadLib(_library);

const std::set<std::string> pluginNames =
gz::physics::FindFeatures3d<TestFeatureList>::From(loader);
ignition::physics::FindFeatures3d<TestFeatureList>::From(loader);

std::unordered_set<TestWorldPtr> worlds;
for (const std::string &name : pluginNames)
{
gz::plugin::PluginPtr plugin = loader.Instantiate(name);
ignition::plugin::PluginPtr plugin = loader.Instantiate(name);

std::cout << " -- Plugin name: " << name << std::endl;

auto engine =
gz::physics::RequestEngine3d<TestFeatureList>::From(plugin);
ignition::physics::RequestEngine3d<TestFeatureList>::From(plugin);
EXPECT_NE(nullptr, engine);

worlds.insert(_constructor(engine));
Expand All @@ -86,11 +86,11 @@ class Collisions_TEST
{};

INSTANTIATE_TEST_CASE_P(PhysicsPlugins, Collisions_TEST,
::testing::ValuesIn(gz::physics::test::g_PhysicsPluginLibraries),); // NOLINT
::testing::ValuesIn(ignition::physics::test::g_PhysicsPluginLibraries),); // NOLINT

TestWorldPtr ConstructMeshPlaneWorld(
const gz::physics::Engine3dPtr<TestFeatureList> &_engine,
const gz::common::Mesh &_mesh)
const ignition::physics::Engine3dPtr<TestFeatureList> &_engine,
const ignition::common::Mesh &_mesh)
{
auto world = _engine->ConstructEmptyWorld("world");

Expand All @@ -109,7 +109,7 @@ TestWorldPtr ConstructMeshPlaneWorld(
model = world->ConstructEmptyModel("plane");
link = model->ConstructEmptyLink("link");

link->AttachPlaneShape("plane", gz::physics::LinearVector3d::UnitZ());
link->AttachPlaneShape("plane", ignition::physics::LinearVector3d::UnitZ());
link->AttachFixedJoint(nullptr);

return world;
Expand All @@ -122,7 +122,7 @@ TEST_P(Collisions_TEST, MeshAndPlane)
return;

const std::string meshFilename = IGNITION_PHYSICS_RESOURCE_DIR "/chassis.dae";
auto &meshManager = *gz::common::MeshManager::Instance();
auto &meshManager = *ignition::common::MeshManager::Instance();
auto *mesh = meshManager.Load(meshFilename);

std::cout << "Testing library " << library << std::endl;
Expand All @@ -138,9 +138,9 @@ TEST_P(Collisions_TEST, MeshAndPlane)
EXPECT_NEAR(
0.0, link->FrameDataRelativeToWorld().pose.translation()[2], 1e-6);

gz::physics::ForwardStep::Output output;
gz::physics::ForwardStep::State state;
gz::physics::ForwardStep::Input input;
ignition::physics::ForwardStep::Output output;
ignition::physics::ForwardStep::State state;
ignition::physics::ForwardStep::Input input;
for (std::size_t i = 0; i < 1000; ++i)
{
world->Step(output, state, input);
Expand Down
2 changes: 1 addition & 1 deletion dartsim/src/CustomFeatures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include "CustomFeatures.hh"

namespace gz {
namespace ignition {
namespace physics {
namespace dartsim {

Expand Down
2 changes: 1 addition & 1 deletion dartsim/src/CustomFeatures.hh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "Base.hh"

namespace gz {
namespace ignition {
namespace physics {
namespace dartsim {

Expand Down
18 changes: 9 additions & 9 deletions dartsim/src/CustomMeshShape.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@
#include <gz/common/Console.hh>
#include <gz/common/SubMesh.hh>

namespace gz {
namespace ignition {
namespace physics {
namespace dartsim {

namespace {
/////////////////////////////////////////////////
unsigned int CheckNumVerticesPerFaces(
const gz::common::SubMesh &_inputSubmesh,
const ignition::common::SubMesh &_inputSubmesh,
const unsigned int _submeshIndex,
const std::string &_path)
{
using namespace gz::common;
using namespace ignition::common;

const SubMesh::PrimitiveType type = _inputSubmesh.SubMeshPrimitiveType();

Expand Down Expand Up @@ -76,9 +76,9 @@ unsigned int CheckNumVerticesPerFaces(

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

const SubMesh::PrimitiveType type = _inputSubmesh.SubMeshPrimitiveType();

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

/////////////////////////////////////////////////
CustomMeshShape::CustomMeshShape(
const gz::common::Mesh &_input,
const ignition::common::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 gz::common::SubMeshPtr &inputSubmesh =
const ignition::common::SubMeshPtr &inputSubmesh =
_input.SubMeshByIndex(i).lock();

scene->mMeshes[i] = nullptr;
Expand Down Expand Up @@ -205,11 +205,11 @@ CustomMeshShape::CustomMeshShape(

for (unsigned int j = 0; j < numVertices; ++j)
{
const gz::math::Vector3d &v = inputSubmesh->Vertex(j);
const ignition::math::Vector3d &v = inputSubmesh->Vertex(j);
for (unsigned int k = 0; k < 3; ++k)
mesh->mVertices[j][k] = static_cast<ai_real>(v[k]);

const gz::math::Vector3d &n = inputSubmesh->Normal(j);
const ignition::math::Vector3d &n = inputSubmesh->Normal(j);
for (unsigned int k = 0; k < 3; ++k)
mesh->mNormals[j][k] = static_cast<ai_real>(n[k]);
}
Expand Down
6 changes: 3 additions & 3 deletions dartsim/src/CustomMeshShape.hh
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@
#include <dart/dynamics/MeshShape.hpp>
#include <gz/common/Mesh.hh>

namespace gz {
namespace ignition {
namespace physics {
namespace dartsim {

/// \brief This class creates a custom derivative of dartsim's MeshShape class
/// which allows an gz::common::Mesh to be converted into a MeshShape that
/// which allows an ignition::common::Mesh to be converted into a MeshShape that
/// can be used by dartsim.
class CustomMeshShape : public dart::dynamics::MeshShape
{
public: CustomMeshShape(
const gz::common::Mesh &_input,
const ignition::common::Mesh &_input,
const Eigen::Vector3d &_scale);
};

Expand Down
2 changes: 1 addition & 1 deletion dartsim/src/EntityManagementFeatures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <dart/collision/CollisionFilter.hpp>
#include <dart/collision/CollisionObject.hpp>

namespace gz {
namespace ignition {
namespace physics {
namespace dartsim {

Expand Down
2 changes: 1 addition & 1 deletion dartsim/src/EntityManagementFeatures.hh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "Base.hh"

namespace gz {
namespace ignition {
namespace physics {
namespace dartsim {

Expand Down
42 changes: 21 additions & 21 deletions dartsim/src/EntityManagement_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@
#include "KinematicsFeatures.hh"
#include "ShapeFeatures.hh"

struct TestFeatureList : gz::physics::FeatureList<
gz::physics::dartsim::EntityManagementFeatureList,
gz::physics::dartsim::JointFeatureList,
gz::physics::dartsim::KinematicsFeatureList,
gz::physics::dartsim::ShapeFeatureList
struct TestFeatureList : ignition::physics::FeatureList<
ignition::physics::dartsim::EntityManagementFeatureList,
ignition::physics::dartsim::JointFeatureList,
ignition::physics::dartsim::KinematicsFeatureList,
ignition::physics::dartsim::ShapeFeatureList
> { };

TEST(EntityManagement_TEST, ConstructEmptyWorld)
{
gz::plugin::Loader loader;
ignition::plugin::Loader loader;
loader.LoadLib(dartsim_plugin_LIB);

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

auto engine =
gz::physics::RequestEngine3d<TestFeatureList>::From(dartsim);
ignition::physics::RequestEngine3d<TestFeatureList>::From(dartsim);
ASSERT_NE(nullptr, engine);

auto world = engine->ConstructEmptyWorld("empty world");
Expand Down Expand Up @@ -97,7 +97,7 @@ TEST(EntityManagement_TEST, ConstructEmptyWorld)
prismatic->SetVelocity(0, zVel);
prismatic->SetAcceleration(0, zAcc);

const gz::physics::FrameData3d childData =
const ignition::physics::FrameData3d childData =
child->FrameDataRelativeToWorld();

const Eigen::Vector3d childPosition = childData.pose.translation();
Expand All @@ -120,7 +120,7 @@ TEST(EntityManagement_TEST, ConstructEmptyWorld)
childSpherePose.translate(Eigen::Vector3d(0.0, yPos, 0.0));
auto sphere = child->AttachSphereShape("child sphere", 1.0, childSpherePose);

const gz::physics::FrameData3d sphereData =
const ignition::physics::FrameData3d sphereData =
sphere->FrameDataRelativeToWorld();

const Eigen::Vector3d spherePosition = sphereData.pose.translation();
Expand All @@ -138,7 +138,7 @@ TEST(EntityManagement_TEST, ConstructEmptyWorld)
EXPECT_DOUBLE_EQ(0.0, sphereAcceleration.y());
EXPECT_DOUBLE_EQ(zAcc, sphereAcceleration.z());

const gz::physics::FrameData3d relativeSphereData =
const ignition::physics::FrameData3d relativeSphereData =
sphere->FrameDataRelativeTo(*child);
const Eigen::Vector3d relativeSpherePosition =
relativeSphereData.pose.translation();
Expand All @@ -150,7 +150,7 @@ TEST(EntityManagement_TEST, ConstructEmptyWorld)
meshLink->AttachFixedJoint(child, "fixed");

const std::string meshFilename = IGNITION_PHYSICS_RESOURCE_DIR "/chassis.dae";
auto &meshManager = *gz::common::MeshManager::Instance();
auto &meshManager = *ignition::common::MeshManager::Instance();
auto *mesh = meshManager.Load(meshFilename);

auto meshShape = meshLink->AttachMeshShape("chassis", *mesh);
Expand All @@ -167,11 +167,11 @@ TEST(EntityManagement_TEST, ConstructEmptyWorld)
EXPECT_NEAR(meshShapeSize[1], 0.3831, 1e-4);
EXPECT_NEAR(meshShapeSize[2], 0.1956, 1e-4);

const gz::math::Pose3d pose(0, 0, 0.2, 0, 0, 0);
const gz::math::Vector3d scale(0.5, 1.0, 0.25);
const ignition::math::Pose3d pose(0, 0, 0.2, 0, 0, 0);
const ignition::math::Vector3d scale(0.5, 1.0, 0.25);
auto meshShapeScaled = meshLink->AttachMeshShape("small_chassis", *mesh,
gz::math::eigen3::convert(pose),
gz::math::eigen3::convert(scale));
ignition::math::eigen3::convert(pose),
ignition::math::eigen3::convert(scale));
const auto meshShapeScaledSize = meshShapeScaled->GetSize();

// Note: dartsim uses assimp for storing mesh data, and assimp by default uses
Expand All @@ -187,14 +187,14 @@ TEST(EntityManagement_TEST, ConstructEmptyWorld)

TEST(EntityManagement_TEST, RemoveEntities)
{
gz::plugin::Loader loader;
ignition::plugin::Loader loader;
loader.LoadLib(dartsim_plugin_LIB);

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

auto engine =
gz::physics::RequestEngine3d<TestFeatureList>::From(dartsim);
ignition::physics::RequestEngine3d<TestFeatureList>::From(dartsim);
ASSERT_NE(nullptr, engine);

auto world = engine->ConstructEmptyWorld("empty world");
Expand Down
2 changes: 1 addition & 1 deletion dartsim/src/FreeGroupFeatures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <dart/constraint/ConstraintSolver.hpp>
#include <dart/dynamics/FreeJoint.hpp>

namespace gz {
namespace ignition {
namespace physics {
namespace dartsim {

Expand Down
2 changes: 1 addition & 1 deletion dartsim/src/FreeGroupFeatures.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include "Base.hh"

namespace gz {
namespace ignition {
namespace physics {
namespace dartsim {

Expand Down
2 changes: 1 addition & 1 deletion dartsim/src/JointFeatures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "JointFeatures.hh"

namespace gz {
namespace ignition {
namespace physics {
namespace dartsim {

Expand Down
2 changes: 1 addition & 1 deletion dartsim/src/JointFeatures.hh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "Base.hh"

namespace gz {
namespace ignition {
namespace physics {
namespace dartsim {

Expand Down
Loading

0 comments on commit 34f14fd

Please sign in to comment.