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 environment hooks for plugins / assets #262

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

luca-della-vedova
Copy link
Member

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:

(find-pkg-share $(var map_package))/maps/$(var map_name)/models

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):

<include>
  <name>building_L1</name>
  <uri>model://building_L1</uri>
  <pose>0 0 0.0 0 0 0</pose>
</include>

However, if we want this to work with hooks and, for example, add find-pkg-share $(var map_package))/maps to an environment hook, the uri 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:

<uri>model://office/models/building_L1</uri>

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

Signed-off-by: Luca Della Vedova <lucadellavr@gmail.com>
Copy link
Member

@arjo129 arjo129 left a comment

Choose a reason for hiding this comment

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

Tested. Seems to be working correctly.

@arjo129 arjo129 merged commit 2c4dc55 into main Sep 25, 2024
3 checks passed
@arjo129 arjo129 deleted the luca/use_hooks_for_variables branch September 25, 2024 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants