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 Namespace Migration : gz-sim #1496

Merged
merged 49 commits into from
May 29, 2022
Merged

ign -> gz Namespace Migration : gz-sim #1496

merged 49 commits into from
May 29, 2022

Conversation

methylDragon
Copy link
Contributor

@chapulina chapulina added 🌱 garden Ignition Garden ign to gz Renaming Ignition to Gazebo. labels May 18, 2022
@chapulina chapulina added the needs upstream release Blocked by a release of an upstream library label May 18, 2022
@methylDragon methylDragon force-pushed the namespace_migration branch 13 times, most recently from b7de1b3 to cf2a4bb Compare May 20, 2022 12:20
@methylDragon
Copy link
Contributor Author

A double free issue appears for new (compared to main) from this PR. But it might be due to/related to #1443

@methylDragon
Copy link
Contributor Author

methylDragon commented May 23, 2022

Two gz-sim tests are failing, but one necessitates no further actions:

101 - INTEGRATION_examples_build (Failed)
195 - INTEGRATION_log_system (Failed)

101 git clones gz-sensors's main branch as part of the test, which is still using ignition::msgs, causing a failing build, it should resolve itself once the gz-sensors namespace migration PR is merged to main

195: Trying to playback unsupported message type ignition.msgs.SerializedStateMap
195 needs an update of the .tlog, since the log is using ignition.msgs when the stack is meant to use gz.msgs

@methylDragon methylDragon force-pushed the namespace_migration branch 2 times, most recently from a2647ff to daff093 Compare May 25, 2022 05:54
Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial review

image

Migration.md Outdated Show resolved Hide resolved
Changelog.md Outdated Show resolved Hide resolved
Migration.md Outdated Show resolved Hide resolved
src/SystemLoader.cc Outdated Show resolved Hide resolved
include/gz/sim/Util.hh Outdated Show resolved Hide resolved
tutorials/migrating_ardupilot_plugin.md Outdated Show resolved Hide resolved
tutorials/migration_plugins.md Outdated Show resolved Hide resolved
src/SystemInternal.hh Outdated Show resolved Hide resolved
src/cmd/cmdgazebo.rb.in Outdated Show resolved Hide resolved
@methylDragon methylDragon force-pushed the namespace_migration branch 2 times, most recently from b1bc54f to 5f6d2b8 Compare May 25, 2022 23:20
Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

include/gz/sim/config.hh.in Outdated Show resolved Hide resolved
include/ignition/gazebo/config.hh Outdated Show resolved Hide resolved
src/gui/resources/GazeboDrawer.qml Outdated Show resolved Hide resolved
@@ -6,20 +6,20 @@
<world name="actors">
<plugin
filename="ignition-gazebo-physics-system"
name="ignition::gazebo::systems::Physics">
name="gz::sim::systems::Physics">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still compiling this, so just leaving a note here that we should check if ignition::gazebo still works.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I just tested it and it doesn't work. But the fix is simple, we need to add aliases like this to every system plugin:

diff --git a/src/systems/physics/Physics.cc b/src/systems/physics/Physics.cc
index b9df0909b..451773597 100644
--- a/src/systems/physics/Physics.cc
+++ b/src/systems/physics/Physics.cc
@@ -3604,3 +3604,5 @@ IGNITION_ADD_PLUGIN(Physics,
                     Physics::ISystemUpdate)
 
 IGNITION_ADD_PLUGIN_ALIAS(Physics, "gz::sim::systems::Physics")
+// Deprecated, remove on version 8
+IGNITION_ADD_PLUGIN_ALIAS(Physics, "ignition::gazebo::systems::Physics")

You can check it worked either by changing a world to load the ignition::gazebo version of the plugin, or with the ign plugin CLI:

$ ign plugin -i -v -p install/lib/libignition-gazebo7-physics-system.so
Loading plugin library file [install/lib/libignition-gazebo7-physics-system.so]
Loader State
        Known Interfaces: 4
                gz::sim::v7::ISystemUpdate
                gz::sim::v7::System
                gz::sim::v7::ISystemReset
                gz::sim::v7::ISystemConfigure
        Known Plugins: 1
                [gz::sim::v7::systems::Physics]
                        has 2 aliases:
                                [gz::sim::systems::Physics]
                                [ignition::gazebo::systems::Physics]
                        implements 4 interfaces:
                                gz::sim::v7::ISystemConfigure
                                gz::sim::v7::ISystemReset
                                gz::sim::v7::ISystemUpdate
                                gz::sim::v7::System

Note the alias

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5c21f04
:>

The specific steps I did are in the commit message

test/integration/deprecated_TEST.cc Outdated Show resolved Hide resolved
test/integration/deprecated_TEST.cc Outdated Show resolved Hide resolved
src/gui/Gui.cc Outdated Show resolved Hide resolved
@@ -6,20 +6,20 @@
<world name="actors">
<plugin
filename="ignition-gazebo-physics-system"
name="ignition::gazebo::systems::Physics">
name="gz::sim::systems::Physics">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I just tested it and it doesn't work. But the fix is simple, we need to add aliases like this to every system plugin:

diff --git a/src/systems/physics/Physics.cc b/src/systems/physics/Physics.cc
index b9df0909b..451773597 100644
--- a/src/systems/physics/Physics.cc
+++ b/src/systems/physics/Physics.cc
@@ -3604,3 +3604,5 @@ IGNITION_ADD_PLUGIN(Physics,
                     Physics::ISystemUpdate)
 
 IGNITION_ADD_PLUGIN_ALIAS(Physics, "gz::sim::systems::Physics")
+// Deprecated, remove on version 8
+IGNITION_ADD_PLUGIN_ALIAS(Physics, "ignition::gazebo::systems::Physics")

You can check it worked either by changing a world to load the ignition::gazebo version of the plugin, or with the ign plugin CLI:

$ ign plugin -i -v -p install/lib/libignition-gazebo7-physics-system.so
Loading plugin library file [install/lib/libignition-gazebo7-physics-system.so]
Loader State
        Known Interfaces: 4
                gz::sim::v7::ISystemUpdate
                gz::sim::v7::System
                gz::sim::v7::ISystemReset
                gz::sim::v7::ISystemConfigure
        Known Plugins: 1
                [gz::sim::v7::systems::Physics]
                        has 2 aliases:
                                [gz::sim::systems::Physics]
                                [ignition::gazebo::systems::Physics]
                        implements 4 interfaces:
                                gz::sim::v7::ISystemConfigure
                                gz::sim::v7::ISystemReset
                                gz::sim::v7::ISystemUpdate
                                gz::sim::v7::System

Note the alias

src/ServerConfig.cc Outdated Show resolved Hide resolved
methylDragon and others added 3 commits May 27, 2022 16:32
Find: IGNITION_ADD_PLUGIN_ALIAS\((.*),$
Replace:
// TODO(CH3): Deprecated, remove on version 8
IGNITION_ADD_PLUGIN_ALIAS($1,
                          "ignition::gazebo::$1")

IGNITION_ADD_PLUGIN_ALIAS($1,

-----------

Find: IGNITION_ADD_PLUGIN_ALIAS(.*)gz::sim::(.*)
Replace:
IGNITION_ADD_PLUGIN_ALIAS$1gz::sim::$2

// TODO(CH3): Deprecated, remove on version 8
IGNITION_ADD_PLUGIN_ALIAS$1ignition::gazebo::$2

-----------

And manual replacements for IGNITION_ADD_PLUGIN_ALIAS($


Signed-off-by: methylDragon <[email protected]>
Co-authored-by: Louise Poubel <[email protected]>
Signed-off-by: methylDragon <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me with 🟢 CI! I pushed a few changes toward the end:

  • Recorded updated rolling shapes log for test
  • Support logs recorded with ignition messages if possible. The levels_log test is still using the old messages, mainly because I didn't know how to record a new log and would probably need to tweak the test. That log was recorded with Blueprint as has been working until now, it would be a shame to stop supporting it instead of doing the 2-line change I did.
  • I fixed the plugin aliases, it looks like at some point some of them got messed up and failed to compile, while others had lost the systems namespace.
  • Updated more instances of ~/.gz path, leaving ~/.ignition/fuel untouched for now

@codecov
Copy link

codecov bot commented May 29, 2022

Codecov Report

Merging #1496 (197b029) into main (aad2019) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1496   +/-   ##
=======================================
  Coverage   35.01%   35.01%           
=======================================
  Files          44       44           
  Lines        2356     2356           
=======================================
  Hits          825      825           
  Misses       1531     1531           
Impacted Files Coverage Δ
src/msgs/peer_info.pb.cc 45.58% <0.00%> (ø)
src/msgs/simulation_step.pb.cc 51.06% <0.00%> (ø)
src/msgs/performer_affinity.pb.cc 27.12% <0.00%> (ø)
src/gui/plugins/copy_paste/moc_CopyPaste.cpp 7.40% <0.00%> (ø)
src/gui/plugins/entity_tree/moc_EntityTree.cpp 6.25% <0.00%> (ø)
src/gui/plugins/modules/moc_EntityContextMenu.cpp 23.07% <0.00%> (ø)
...plugins/transform_control/moc_TransformControl.cpp 2.77% <0.00%> (ø)
...tion-gazebo7-gui_autogen/3YJK5W5UP7/qrc_gazebo.cpp 100.00% <0.00%> (ø)
...ins/component_inspector/moc_ComponentInspector.cpp 9.27% <0.00%> (ø)
...n-gazebo7-gui_autogen/EWIEGA46WW/moc_GuiRunner.cpp 27.58% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aad2019...197b029. Read the comment docs.

@chapulina
Copy link
Contributor

No new test failures or warnings! Merging 🚀

@chapulina chapulina merged commit c7e25be into main May 29, 2022
@chapulina chapulina deleted the namespace_migration branch May 29, 2022 18:03
@chapulina chapulina removed the needs upstream release Blocked by a release of an upstream library label May 29, 2022
@j-rivero j-rivero mentioned this pull request Sep 16, 2022
3 tasks
@@ -59,7 +59,7 @@ struct LoggingPlugin
public: static std::string &RecordPluginName()
{
static std::string recordPluginName =
"ignition::gazebo::systems::LogRecord";
"gz::sim::systems::LogRecord";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed this while testing something else. This change in together with the logic in

name == LoggingPlugin::RecordPluginName())
means sdf fileds with ignition::gazebo::systems::LogRecord won't work in Garden. Can you confirm @methylDragon ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right actually :o
It might be better to do a suffix comparison/regex match for LogRecord$ then :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌱 garden Ignition Garden ign to gz Renaming Ignition to Gazebo.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants