Use the versioned name of the DART physics plugin #369
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In some setups, we recommend users to export the
IGN_GAZEBO_PHYSICS_ENGINE_PATH
environment variable.Working on a downstream project which CI installs Ignition Gazebo from the PPA, I found out that I have to manually set this env variable because otherwise the plugin is not found, generating this error:
Now, investigating a bit on this setup, I realized that there are two locations where the dart plugin in installed:
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/ign-physics-4/engine-plugins/
And this is the relevant content of the two folders:
It can be noticed that in the first case, the unversioned
libignition-physics-dartsim-plugin.so
symlink is not there. This makes sense since multipleign-physics
versions could be installed side-by-side and they all share the/usr/lib/x86_64-linux-gnu
folder.Though, when we load the plugin, we use this unversioned name of the shared library:
https://github.com/robotology/gym-ignition/blob/fcf705e246c697f7bd5728ca3e018837c9800421/scenario/src/gazebo/src/World.cpp#L244-L251
I suspect that the
/usr/lib/x86_64-linux-gnu/ign-physics-<version>/engine-plugins/
is not always added in the search path by default, therefore there are cases where the loading could fail. This would not happen if we use the versioned name.This PR updates our logic to always use the versioned name of the library.