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

Use the versioned name of the DART physics plugin #369

Merged
merged 1 commit into from
Jul 2, 2021

Conversation

diegoferigo
Copy link
Collaborator

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:

[Err] [Physics.cc:597] Failed to find plugin [ignition-physics-dartsim-plugin]. Have you checked the IGN_GAZEBO_PHYSICS_ENGINE_PATH environment variable?

Now, investigating a bit on this setup, I realized that there are two locations where the dart plugin in installed:

  1. /usr/lib/x86_64-linux-gnu
  2. /usr/lib/x86_64-linux-gnu/ign-physics-4/engine-plugins/

And this is the relevant content of the two folders:

$ ls -alh /usr/lib/x86_64-linux-gnu
[...]
lrwxrwxrwx   1 root root    40 May  3 16:08 libignition-physics4-dartsim-plugin.so -> libignition-physics4-dartsim-plugin.so.4
lrwxrwxrwx   1 root root    44 May  3 16:08 libignition-physics4-dartsim-plugin.so.4 -> libignition-physics4-dartsim-plugin.so.4.1.0
-rw-r--r--   1 root root  1.9M May  3 16:08 libignition-physics4-dartsim-plugin.so.4.1.0
[...]
ls -alh /usr/lib/x86_64-linux-gnu/ign-physics-4/engine-plugins
lrwxrwxrwx 1 root root   38 May  3 16:08 libignition-physics-dartsim-plugin.so -> libignition-physics4-dartsim-plugin.so
lrwxrwxrwx 1 root root   40 May  3 16:08 libignition-physics4-dartsim-plugin.so -> libignition-physics4-dartsim-plugin.so.4
lrwxrwxrwx 1 root root   44 May  3 16:08 libignition-physics4-dartsim-plugin.so.4 -> libignition-physics4-dartsim-plugin.so.4.1.0
-rw-r--r-- 1 root root 1.9M May  3 16:08 libignition-physics4-dartsim-plugin.so.4.1.0

It can be noticed that in the first case, the unversioned libignition-physics-dartsim-plugin.so symlink is not there. This makes sense since multiple ign-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.

@diegoferigo diegoferigo merged commit a369321 into devel Jul 2, 2021
@diegoferigo diegoferigo deleted the fix/ignition-physics-plugin-name branch July 2, 2021 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants