Use environment hooks for plugins / assets #262
Merged
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.
New feature implementation
Implemented feature
Use environment hooks instead of manually creating environment variables for launching gazebo simulations.
Implementation description
Needs open-rmf/rmf_simulation#136.
Brings us 90% of the way there to only using hooks for setting variables (the remaining TODO is not fully straightforward and might require changes on
rmf_traffic_editor
so left it for now, more explanation below).Both plugins (with upstream
rmf_simulation
PR) and rmf_demos_assets (with this PR) will set environment variables to make lookups easier.This reduces boilerplate on the launch file and also makes it easier for third parties to use these packages without having to manually set their environment variables.
There is a remaining TODO because for each map we add to the path:
This makes it possible for the root level world file to be able to lookup the level meshes that come in the format (example from office world):
However, if we want this to work with hooks and, for example, add
find-pkg-share $(var map_package))/maps
to an environment hook, theuri
should change to the subfolder which doesn't quite look as clean. I'm also not 100% sure it would be able to find its submeshes:For this reason I left this as a TODO, I also left the
.gazebo/models
here since it's probably not a good idea to add that to the path of users when our packages are built