Skip to content

Commit 08fa387

Browse files
authored
Sim demo with models from fuel using template sdf (#62)
* Working with the same commands Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * Basic demo works with models Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * Moving enclosures, removing in-between, using nested models, moving camera Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * Use new released rmf_building_map_tools args, clean up, moved waypoints, added dispenser/ingestor Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * Clean up duplicated and unused files, use rmf_transporter Signed-off-by: Aaron Chong <aaronchongth@gmail.com> * Remove duplicated depot Signed-off-by: Aaron Chong <aaronchongth@gmail.com> --------- Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
1 parent 1795826 commit 08fa387

8 files changed

Lines changed: 561 additions & 360 deletions

File tree

nexus_integration_tests/CMakeLists.txt

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ add_custom_target(generate_zenoh_bridge_configs ALL
115115
COMMAND ros2 run nexus_network_configuration nexus_network_configuration -n ${nexus_network_cfg_path} -o ${zenoh_cfg_output_dir}
116116
)
117117

118-
install(DIRECTORY launch config rviz scripts DESTINATION share/${PROJECT_NAME})
118+
install(DIRECTORY launch config rviz scripts maps DESTINATION share/${PROJECT_NAME})
119119
# Install the zenoh config directory containing generated configs.
120120
message("zenoh_cfg_output_dir: " ${zenoh_cfg_output_dir})
121121
install(DIRECTORY ${zenoh_cfg_output_dir} DESTINATION share/${PROJECT_NAME}/config/)
@@ -176,4 +176,63 @@ if(BUILD_TESTING)
176176
endif()
177177
endif()
178178

179+
# Modified from rmf_demos_maps
180+
# Get absolute path of the building map
181+
set(building_map "maps/depot/depot.building.yaml")
182+
get_filename_component(building_map_path ${building_map} REALPATH)
183+
184+
# Get the output world name
185+
string(REGEX REPLACE "\\.[^.]*\.[^.]*$" "" no_extension_path ${building_map_path})
186+
string(REGEX MATCH "[^\/]+$" world_name ${no_extension_path})
187+
188+
set(output_world_name ${world_name})
189+
set(output_dir ${CMAKE_CURRENT_BINARY_DIR}/maps/${output_world_name})
190+
set(output_world_path ${output_dir}/${output_world_name}.world)
191+
set(output_model_dir ${output_dir}/models)
192+
193+
##############################################################################
194+
# Generate Gz world, download Models, change robot to use Fuel model
195+
##############################################################################
196+
197+
message("BUILDING WORLDFILE WITH COMMAND: ros2 run rmf_building_map_tools building_map_generator gazebo ${building_map_path} ${output_world_path} ${output_model_dir}")
198+
message("REPLACING ROBOT MODELS WITH THOSE FROM FUEL")
199+
if (NO_DOWNLOAD_MODELS)
200+
add_custom_command(
201+
DEPENDS ${building_map_path}
202+
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
203+
COMMAND sed -i 's|<uri>model:\/\/DeliveryRobot<\/uri>|<uri>https:\/\/fuel.gazebosim.org\/1.0\/Open-RMF\/models\/DeliveryRobot<\/uri>|g' ${output_world_path}
204+
OUTPUT ${output_world_path}
205+
)
206+
else()
207+
message("DOWNLOADING MODELS WITH COMMAND: ros2 run rmf_building_map_tools building_map_model_downloader ${building_map_path}")
208+
add_custom_command(
209+
DEPENDS ${building_map_path}
210+
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
211+
COMMAND sed -i 's|<uri>model:\/\/DeliveryRobot<\/uri>|<uri>https:\/\/fuel.gazebosim.org\/1.0\/Open-RMF\/models\/DeliveryRobot<\/uri>|g' ${output_world_path}
212+
COMMAND ros2 run rmf_building_map_tools building_map_model_downloader ${building_map_path} -e ~/.gazebo/models
213+
OUTPUT ${output_world_path}
214+
)
215+
endif()
216+
217+
##############################################################################
218+
# Generate the nav graphs
219+
##############################################################################
220+
221+
set(output_nav_graphs_dir ${output_dir}/nav_graphs/)
222+
set(output_nav_graphs_phony ${output_nav_graphs_dir}/phony)
223+
add_custom_command(
224+
OUTPUT ${output_nav_graphs_phony}
225+
COMMAND ros2 run rmf_building_map_tools building_map_generator nav ${building_map_path} ${output_nav_graphs_dir}
226+
DEPENDS ${building_map_path} ${output_world_path}
227+
)
228+
229+
add_custom_target(generate_${output_world_name}_nav_graphs ALL
230+
DEPENDS ${output_nav_graphs_phony}
231+
)
232+
233+
install(
234+
DIRECTORY ${output_dir}
235+
DESTINATION share/${PROJECT_NAME}/maps
236+
)
237+
179238
ament_package()

nexus_integration_tests/config/rmf/depot.world

Lines changed: 0 additions & 72 deletions
This file was deleted.

nexus_integration_tests/config/rmf/nav_graphs/0.yaml

Lines changed: 0 additions & 229 deletions
This file was deleted.

0 commit comments

Comments
 (0)