Skip to content

Commit

Permalink
Move maps into config/rmf
Browse files Browse the repository at this point in the history
Signed-off-by: Yadunund <yadunund@gmail.com>
  • Loading branch information
Yadunund committed Jan 22, 2025
1 parent 285def7 commit 43ec932
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions nexus_integration_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ add_custom_target(generate_zenoh_bridge_configs ALL
COMMAND ros2 run nexus_network_configuration nexus_network_configuration -n ${nexus_network_cfg_path} -o ${zenoh_cfg_output_dir}
)

install(DIRECTORY launch config rviz scripts maps DESTINATION share/${PROJECT_NAME})
install(DIRECTORY launch config rviz scripts DESTINATION share/${PROJECT_NAME})
# Install the zenoh config directory containing generated configs.
message("zenoh_cfg_output_dir: " ${zenoh_cfg_output_dir})
install(DIRECTORY ${zenoh_cfg_output_dir} DESTINATION share/${PROJECT_NAME}/config/)
Expand Down Expand Up @@ -178,15 +178,15 @@ endif()

# Modified from rmf_demos_maps
# Get absolute path of the building map
set(building_map "maps/depot/depot.building.yaml")
set(building_map "config/rmf/maps/depot/depot.building.yaml")
get_filename_component(building_map_path ${building_map} REALPATH)

# Get the output world name
string(REGEX REPLACE "\\.[^.]*\.[^.]*$" "" no_extension_path ${building_map_path})
string(REGEX MATCH "[^\/]+$" world_name ${no_extension_path})

set(output_world_name ${world_name})
set(output_dir ${CMAKE_CURRENT_BINARY_DIR}/maps/${output_world_name})
set(output_dir ${CMAKE_CURRENT_BINARY_DIR}/config/rmf/maps/${output_world_name})
set(output_world_path ${output_dir}/${output_world_name}.world)
set(output_model_dir ${output_dir}/models)

Expand All @@ -199,15 +199,15 @@ message("REPLACING ROBOT MODELS WITH THOSE FROM FUEL")
if (NO_DOWNLOAD_MODELS)
add_custom_command(
DEPENDS ${building_map_path}
COMMAND ros2 run rmf_building_map_tools building_map_generator gazebo ${building_map_path} ${output_world_path} ${output_model_dir} --TEMPLATE_WORLD_FILE ${CMAKE_CURRENT_SOURCE_DIR}/maps/depot/depot_template.sdf --SKIP_CAMERA_POSE
COMMAND ros2 run rmf_building_map_tools building_map_generator gazebo ${building_map_path} ${output_world_path} ${output_model_dir} --TEMPLATE_WORLD_FILE ${CMAKE_CURRENT_SOURCE_DIR}/config/rmf/maps/depot/depot_template.sdf --SKIP_CAMERA_POSE
COMMAND sed -i 's|<uri>model:\/\/DeliveryRobot<\/uri>|<uri>https:\/\/fuel.gazebosim.org\/1.0\/Open-RMF\/models\/DeliveryRobotWithConveyor<\/uri>|g' ${output_world_path}
OUTPUT ${output_world_path}
)
else()
message("DOWNLOADING MODELS WITH COMMAND: ros2 run rmf_building_map_tools building_map_model_downloader ${building_map_path}")
add_custom_command(
DEPENDS ${building_map_path}
COMMAND ros2 run rmf_building_map_tools building_map_generator gazebo ${building_map_path} ${output_world_path} ${output_model_dir} --TEMPLATE_WORLD_FILE ${CMAKE_CURRENT_SOURCE_DIR}/maps/depot/depot_template.sdf --SKIP_CAMERA_POSE
COMMAND ros2 run rmf_building_map_tools building_map_generator gazebo ${building_map_path} ${output_world_path} ${output_model_dir} --TEMPLATE_WORLD_FILE ${CMAKE_CURRENT_SOURCE_DIR}/config/rmf/maps/depot/depot_template.sdf --SKIP_CAMERA_POSE
COMMAND sed -i 's|<uri>model:\/\/DeliveryRobot<\/uri>|<uri>https:\/\/fuel.gazebosim.org\/1.0\/Open-RMF\/models\/DeliveryRobotWithConveyor<\/uri>|g' ${output_world_path}
COMMAND ros2 run rmf_building_map_tools building_map_model_downloader ${building_map_path} -e ~/.gazebo/models
OUTPUT ${output_world_path}
Expand All @@ -232,7 +232,7 @@ add_custom_target(generate_${output_world_name}_nav_graphs ALL

install(
DIRECTORY ${output_dir}
DESTINATION share/${PROJECT_NAME}/maps
DESTINATION share/${PROJECT_NAME}/config/rmf/maps
)

ament_package()
8 changes: 4 additions & 4 deletions nexus_integration_tests/launch/rmf_transporter.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<!-- Building Map -->
<group>
<node pkg="rmf_building_map_tools" exec="building_map_server" args="$(find-pkg-share nexus_integration_tests)/maps/$(var building_map_name)/$(var building_map_name).building.yaml">
<node pkg="rmf_building_map_tools" exec="building_map_server" args="$(find-pkg-share nexus_integration_tests)/config/rmf/maps/$(var building_map_name)/$(var building_map_name).building.yaml">
<param name="use_sim_time" value="$(var use_simulator)"/>
</node>
</group>
Expand Down Expand Up @@ -50,7 +50,7 @@
<group>
<include file="$(find-pkg-share rmf_demos_fleet_adapter)/launch/fleet_adapter.launch.xml">
<arg name="use_sim_time" value="$(var use_simulator)"/>
<arg name="nav_graph_file" value="$(find-pkg-share nexus_integration_tests)/maps/$(var building_map_name)/nav_graphs/0.yaml" />
<arg name="nav_graph_file" value="$(find-pkg-share nexus_integration_tests)/config/rmf/maps/$(var building_map_name)/nav_graphs/0.yaml" />
<arg name="config_file" value="$(find-pkg-share nexus_integration_tests)/config/rmf/deliveryRobot_config.yaml"/>
</include>
</group>
Expand All @@ -63,8 +63,8 @@
<!-- Simulator launch -->
<let name="gz_headless" if="$(var headless)" value="-s"/>
<let name="gz_headless" unless="$(var headless)" value="" />
<let name="world_path" value="$(find-pkg-share nexus_integration_tests)/maps/$(var building_map_name)/$(var building_map_name).world" />
<let name="model_path" value="$(find-pkg-share nexus_integration_tests)/maps/$(var building_map_name)/models" />
<let name="world_path" value="$(find-pkg-share nexus_integration_tests)/config/rmf/maps/$(var building_map_name)/$(var building_map_name).world" />
<let name="model_path" value="$(find-pkg-share nexus_integration_tests)/config/rmf/maps/$(var building_map_name)/models" />

<executable if="$(var use_simulator)" cmd="gz sim $(var gz_headless) -r -v 3 $(var world_path) -z $(var sim_update_rate)" output="both">
<env name="GZ_SIM_RESOURCE_PATH" value="$(var model_path):$(var world_path)" />
Expand Down

0 comments on commit 43ec932

Please sign in to comment.