Open osrf-migration opened 8 years ago
Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).
I think one is supposed to source the gazebo setup.sh
file before modifying the GAZEBO_
variables. Maybe not the best approach
Original comment by Silvio Traversaro (Bitbucket: traversaro).
If the setup.sh
needs to be sourced before modifying the Gazebo environmental variables (as mentioned in the components tutorial ) it would be nice to mention this in the plugins hello world tutorial that probably introduced the GAZEBO_PLUGIN_PATH
variable to most developers of Gazebo plugins.
Original comment by Louise Poubel (Bitbucket: chapulina, GitHub: chapulina).
I had no idea it would be possible to do it by sourcing the setup file first. I agree that we should mention this in some tutorial.
Is there a downside to making it work without the setup file though? I guess there are cases when the user wants to override the default path?
As a reference, on Ignition we don't let the environment variables prevent the official resources from being found / loaded. So setting IGN_GAZEBO_RESOURCE_PATH
won't break any core usage, because we always lookup the install paths, and there's no need to source a setup file.
My suggestion to resolve this issue would be to do the same here. That is, always prepend the env var to the compile time paths, instead of overriding them. That would be done here:
Original report (archived issue) by Louise Poubel (Bitbucket: chapulina, GitHub: chapulina).
By default, plugins shipped with Gazebo work without the need to set extra environment variables. For example, insert
Submarine (buoyant)
from the insert tab and it floats.But when you want to use custom plugins and set the
GAZEBO_PLUGIN_PATH
environment variable, for example:Then the default plugins stop working. Trying to insert the submarine now prints this message:
[Err] [Plugin.hh:165] Failed to load plugin libBuoyancyPlugin.so: libBuoyancyPlugin.so: cannot open shared object file: No such file or directory
This is because, if
GAZEBO_PLUGIN_PATH
is set, we ignore the compile-time path, in SystemPaths::UpdatePluginPaths()