Skip to content

Commit

Permalink
nexus_demos, move all files mentioning rmf to new package, parameteri…
Browse files Browse the repository at this point in the history
…ze launch files from integration tests

Signed-off-by: Aaron Chong <[email protected]>
  • Loading branch information
aaronchongth committed Jan 8, 2025
1 parent daf3b2b commit 6c754b0
Show file tree
Hide file tree
Showing 24 changed files with 734 additions and 193 deletions.
25 changes: 25 additions & 0 deletions nexus_demos/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
cmake_minimum_required(VERSION 3.16)
set(PROJECT_NAME nexus_demos)
project(${PROJECT_NAME})

find_package(ament_cmake REQUIRED)

set(CMAKE_CXX_FLAGS "-Wall -Wpedantic")

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

# Refactored from rmf_demos_maps, we just need to download models
file(GLOB_RECURSE traffic_editor_paths "maps/*.building.yaml")
foreach(building_map_path ${traffic_editor_paths})
##############################################################################
# Generate Gz world and download Models
##############################################################################
if (NOT NO_DOWNLOAD_MODELS)
message("DOWNLOADING MODELS WITH COMMAND: ros2 run rmf_building_map_tools building_map_model_downloader ${building_map_path}")
execute_process(
COMMAND ros2 run rmf_building_map_tools building_map_model_downloader ${building_map_path} -e ~/.gazebo/models
)
endif()
endforeach()

ament_package()
43 changes: 43 additions & 0 deletions nexus_demos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# nexus_demos

## Regenerating the simulation world file and nav graph

Source build of `rmf_building_map_tools` is required, at least from commit hash [0d18f59](https://github.com/open-rmf/rmf_traffic_editor/tree/0d18f593356fa2e4de0dbfa297ae1fba66b8e101) onwards.

Generate world file,

```bash
# Source the workspace where rmf_building_map_tools is built

cd ~/ws_nexus/src/nexus/nexus_demos
ros2 run rmf_building_map_tools building_map_generator gazebo \
maps/depot/depot.building.yaml \
maps/depot/depot.world \
maps/depot/models \
--TEMPLATE_WORLD_FILE maps/depot/template/depot_world.sdf \
--SKIP_CAMERA_POSE
```

Generate navigation graphs,

```bash
ros2 run rmf_building_map_tools building_map_generator nav \
maps/depot/depot.building.yaml \
maps/depot/nav_graphs
```

## Build

Build `nexus_demos`,

```bash
colcon build --packages-up-to nexus_demos
```

## Launch

Launch the demo,

```bash
ros2 launch nexus_demos depot.launch.xml headless:=0
```
File renamed without changes.
File renamed without changes.
56 changes: 56 additions & 0 deletions nexus_demos/launch/depot.launch.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version='1.0' ?>

<launch>
<arg name="headless" default="true"/>
<arg name="use_simulator" default="true"/>
<arg name="sim_update_rate" default='100'/>

<!-- RMF Common launch -->
<include file="$(find-pkg-share rmf_demos)/common.launch.xml">
<arg name="headless" value="$(var headless)" />
<arg name="use_sim_time" value="$(var use_simulator)"/>
<arg name="viz_config_file" value ="$(find-pkg-share nexus_demos)/launch/include/depot/depot.rviz"/>
<arg name="config_file" value="$(find-pkg-share nexus_demos)/maps/depot/depot.building.yaml"/>
</include>

<!-- Nexus Common launch -->
<include file="$(find-pkg-share nexus_integration_tests)/launch/common.launch.xml">
<arg name="headless" value="$(var headless)" />
<arg name="use_sim_time" value="$(var use_simulator)"/>
</include>

<!-- DeliveryRobot fleet adapter -->
<group>
<include file="$(find-pkg-share rmf_demos_fleet_adapter)/launch/fleet_adapter.launch.xml">
<arg name="use_sim_time" value="$(var use_sim_time)"/>
<arg name="nav_graph_file" value="$(find-pkg-share nexus_demos)/maps/depot/nav_graphs/0.yaml" />
<arg name="config_file" value="$(find-pkg-share nexus_demos)/config/depot/deliveryRobot_config.yaml"/>
</include>
</group>

<node pkg="nexus_workcell_orchestrator" exec="nexus_workcell_orchestrator" name="rmf_nexus_transporter" output="both">
<param name="capabilities" value="[nexus::capabilities::RMFRequestCapability]"/>
<param name="bt_path" value="$(find-pkg-share nexus_integration_tests)/config/rmf_bts"/>
</node>

<!-- Simulator launch -->
<include if="$(var use_simulator)" file="$(find-pkg-share rmf_demos_gz)/simulation.launch.xml">
<arg name="headless" value="$(var headless)" />
<arg name="map_package" value="nexus_demos" />
<arg name="map_name" value="depot" />
<arg name="gazebo_version" value="8" />
<arg name="sim_update_rate" value="$(var sim_update_rate)"/>
</include>

<!-- Bringup from integration tests -->
<!-- TODO(luca) should we move the integration launch here instead? -->
<include file="$(find-pkg-share nexus_integration_tests)/launch/launch.py">
<!-- Set as true to make it auto bringup and remove all the extra rviz launches -->
<arg name="headless" value="true" />
<arg name="use_sim_time" value="$(var use_simulator)"/>
<arg name="main_bt_package" value="nexus_demos"/>
<arg name="main_bt_filename" value="main_rmf.xml"/>
<arg name="remap_task_types" value="{pick_and_place_rmf: [place_on_amr, pick_from_amr]}"/>
</include>

</launch>
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 6c754b0

Please sign in to comment.