Skip to content

Commit

Permalink
Use environment hooks for plugins / assets (#262)
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Della Vedova <[email protected]>
  • Loading branch information
luca-della-vedova authored Sep 25, 2024
1 parent 95b7335 commit 2c4dc55
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions rmf_demos_assets/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ project(rmf_demos_assets)

find_package(ament_cmake REQUIRED)

ament_environment_hooks("${CMAKE_CURRENT_SOURCE_DIR}/hooks/${PROJECT_NAME}.dsv.in")

install(
DIRECTORY models
DESTINATION share/${PROJECT_NAME}
Expand Down
1 change: 1 addition & 0 deletions rmf_demos_assets/hooks/rmf_demos_assets.dsv.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
prepend-non-duplicate;GZ_SIM_RESOURCE_PATH;share/rmf_demos_assets/models
8 changes: 3 additions & 5 deletions rmf_demos_gz/launch/simulation.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
<arg name="gazebo_version" default='8'/>

<let name="world_path" value="$(find-pkg-share $(var map_package))/maps/$(var map_name)/$(var map_name).world" />
<let name="model_path" value="$(find-pkg-share $(var map_package))/maps/$(var map_name)/models:$(find-pkg-share $(var map_package))/maps/$(var map_name)/models:$(find-pkg-share rmf_demos_assets)/models:$(env HOME)/.gazebo/models" />
<let name="plugin_path" value="$(find-pkg-prefix rmf_robot_sim_gz_plugins)/lib/rmf_robot_sim_gz_plugins:$(find-pkg-prefix rmf_building_sim_gz_plugins)/lib/rmf_building_sim_gz_plugins" />
<let name="model_path" value="$(find-pkg-share $(var map_package))/maps/$(var map_name)/models:$(env HOME)/.gazebo/models" />

<!-- Use crowd sim if `use_crowdsim` is true-->
<let name="menge_resource_path" if="$(var use_crowdsim)" value="$(find-pkg-share $(var map_package))/maps/$(var map_name)/config_resource"/>
Expand All @@ -17,10 +16,9 @@
<let name="gz_headless" if="$(var headless)" value="-s"/>
<let name="gz_headless" unless="$(var headless)" value="" />

<!-- TODO(luca) Remove the manual concatenation of GZ_SIM_RESOURCE_PATH and just use environment hooks -->
<executable cmd="gz sim --force-version $(var gazebo_version) $(var gz_headless) -r -v 3 $(var world_path)" output="both">
<env name="GZ_SIM_RESOURCE_PATH" value="$(var model_path):$(var world_path)" />
<env name="GZ_SIM_SYSTEM_PLUGIN_PATH" value="$(var plugin_path)"/>
<env name="GZ_GUI_PLUGIN_PATH" value="$(var plugin_path)"/>
<env name="GZ_SIM_RESOURCE_PATH" value="$(env GZ_SIM_RESOURCE_PATH):$(var model_path)" />
<env name="MENGE_RESOURCE_PATH" value="$(var menge_resource_path)"/>
</executable>

Expand Down

0 comments on commit 2c4dc55

Please sign in to comment.