Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ign -> gz Shared Lib Migration : gz-physics #356

Merged
merged 5 commits into from
Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ release will remove the deprecated code.
1. Header files under `ignition/...` are deprecated and will be removed in future versions.
Use `gz/...` instead.

1. The shared libraries have `gz` where there used to be `ignition`.
1. Using the un-migrated version is still possible due to tick-tocks, but will be removed in future versions.

1. The following `IGN_` / `IGNITION_` prefixed macros are deprecated and will be removed in future versions.
Additionally, they will only be available when including the corresponding `ignition/...` header.
Use the `GZ_` prefix instead.
Expand All @@ -26,6 +29,8 @@ release will remove the deprecated code.
1. `IGNITION_PHYSICS_CONST_GET_ERROR` (hard-tocked, inside detail header)
1. `IGNITION_UNITTEST_EXPECTDATA_ACCESS` (hard-tocked, inside test and detail headers)
1. `IGNITION_PHYSICS_DEFINE_COORDINATE_SPACE` (hard-tocked, inside detail header)
1. The `ignition:expressed_in` SDF attribute is deprecated and will be removed.
Please use `gz:expressed_in` instead.

### Breaking Changes

Expand Down
20 changes: 17 additions & 3 deletions dartsim/src/SDFFeatures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -829,12 +829,26 @@ Identity SDFFeatures::ConstructSdfCollision(
math::Vector3d fdir1 = frictionDirectionElem->Get<math::Vector3d>();
aspect->setFirstFrictionDirection(math::eigen3::convert(fdir1));

const std::string kExpressedIn = "ignition:expressed_in";
if (frictionDirectionElem->HasAttribute(kExpressedIn))
std::string expressedIn = "gz:expressed_in";

// TODO(CH3): Deprecated. Remove on tock.
// Try deprecated ignition:expressed_in attribute
// if gz:expressed_in attribute is missing
if (!frictionDirectionElem->HasAttribute("gz:expressed_in"))
{
if (frictionDirectionElem->HasAttribute("ignition:expressed_in"))
{
gzwarn << "The `ignition:expressed_in` attribute is deprecated. "
<< "Please use `gz:expressed_in` instead." << std::endl;
expressedIn = "ignition:expressed_in";
}
}

if (frictionDirectionElem->HasAttribute(expressedIn))
{
auto skeleton = bn->getSkeleton();
auto directionFrameBodyNode = skeleton->getBodyNode(
frictionDirectionElem->Get<std::string>(kExpressedIn));
frictionDirectionElem->Get<std::string>(expressedIn));
if (nullptr != directionFrameBodyNode)
{
aspect->setFirstFrictionDirectionFrame(directionFrameBodyNode);
Expand Down
4 changes: 2 additions & 2 deletions dartsim/worlds/falling.world
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<sdf version="1.6">
<world name="default">
<plugin
filename="libgz-sim-physics-system.so"
name="gz::gazebo::systems::v0::Physics">
filename="gz-sim-physics-system"
name="gz::sim::systems::v0::Physics">
</plugin>
<model name="sphere">
<pose>0 0 2 0 0.78539816339 0</pose>
Expand Down
2 changes: 1 addition & 1 deletion tutorials/04-switching-physics-engines.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ gz sim --physics-engine CustomEngine
### From C++ API

All features available through the command line are also available through
[gz::gazebo::ServerConfig](https://gazebosim.org/api/gazebo/4.0/classignition_1_1gazebo_1_1ServerConfig.html).
[gz::sim::ServerConfig](https://gazebosim.org/api/gazebo/4.0/classignition_1_1gazebo_1_1ServerConfig.html).
When instantiating a server programmatically, a physics engine can be passed to
the constructor, for example:

Expand Down