Skip to content

Commit

Permalink
Migrate SDF params
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <methylDragon@gmail.com>
  • Loading branch information
methylDragon committed Jun 27, 2022
1 parent b80e954 commit 1d8028c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,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.


## Gazebo Physics 4.X to 5.X
Expand Down
16 changes: 15 additions & 1 deletion dartsim/src/SDFFeatures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,21 @@ Identity SDFFeatures::ConstructSdfCollision(
math::Vector3d fdir1 = frictionDirectionElem->Get<math::Vector3d>();
aspect->setFirstFrictionDirection(math::eigen3::convert(fdir1));

const std::string kExpressedIn = "ignition:expressed_in";
std::string kExpressedIn = "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;
kExpressedIn = "ignition:expressed_in";
}
}

if (frictionDirectionElem->HasAttribute(kExpressedIn))
{
auto skeleton = bn->getSkeleton();
Expand Down
2 changes: 1 addition & 1 deletion dartsim/worlds/falling.world
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<world name="default">
<plugin
filename="gz-sim-physics-system"
name="gz::gazebo::systems::v0::Physics">
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 @@ ign gazebo --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

0 comments on commit 1d8028c

Please sign in to comment.