Skip to content

Commit

Permalink
Vendor RMF launch files, remove building_map_tools
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
  • Loading branch information
luca-della-vedova committed Jan 10, 2025
1 parent c9f4726 commit 161b2a4
Show file tree
Hide file tree
Showing 13 changed files with 510 additions and 406 deletions.
77 changes: 1 addition & 76 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 @@ -176,79 +176,4 @@ if(BUILD_TESTING)
endif()
endif()

# Taken from rmf_demos_maps
file(GLOB_RECURSE traffic_editor_paths "maps/*.building.yaml")

foreach(path ${traffic_editor_paths})

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

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

##############################################################################
# Generate Gz world and download Models
##############################################################################

message("BUILDING WORLDFILE WITH COMMAND: ros2 run rmf_building_map_tools building_map_generator gazebo ${map_path} ${output_world_path} ${output_model_dir}")
if (NO_DOWNLOAD_MODELS)
add_custom_command(
DEPENDS ${map_path}
COMMAND ros2 run rmf_building_map_tools building_map_generator gazebo ${map_path} ${output_world_path} ${output_model_dir}
OUTPUT ${output_world_path}
)
else()
message("DOWNLOADING MODELS WITH COMMAND: ros2 run rmf_building_map_tools building_map_model_downloader ${map_path}")
add_custom_command(
DEPENDS ${map_path}
COMMAND ros2 run rmf_building_map_tools building_map_generator gazebo ${map_path} ${output_world_path} ${output_model_dir}
COMMAND ros2 run rmf_building_map_tools building_map_model_downloader ${map_path} -e ~/.gazebo/models
OUTPUT ${output_world_path}
)
endif()

##############################################################################
# generate the navmesh and required files for crowd simulation for gz
##############################################################################
set(crowd_sim_config_resource ${output_dir}/config_resource/)

add_custom_command(
OUTPUT ${world_name}_crowdsim
COMMAND ros2 run rmf_building_map_tools building_crowdsim ${map_path} ${crowd_sim_config_resource} ${output_world_path}
DEPENDS ${output_world_path}
)

# This will initiate both custom commands: ${output_world_path} and ${world_name}_crowdsim
add_custom_target(generate_${world_name}_crowdsim ALL
DEPENDS ${world_name}_crowdsim
)

##############################################################################
# Generate the nav graphs
##############################################################################

set(output_nav_graphs_dir ${output_dir}/nav_graphs/)
set(output_nav_graphs_phony ${output_nav_graphs_dir}/phony)
add_custom_command(
OUTPUT ${output_nav_graphs_phony}
COMMAND ros2 run rmf_building_map_tools building_map_generator nav ${map_path} ${output_nav_graphs_dir}
DEPENDS ${map_path}
)

add_custom_target(generate_${output_world_name}_nav_graphs ALL
DEPENDS ${output_nav_graphs_phony}
)

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

endforeach()

ament_package()
46 changes: 46 additions & 0 deletions nexus_integration_tests/config/rmf/deliveryRobot_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# FLEET CONFIG =================================================================
# RMF Fleet parameters

rmf_fleet:
name: "deliveryRobot"
limits:
linear: [0.7, 0.75] # velocity, acceleration
angular: [0.6, 2.0] # velocity, acceleration
profile: # Robot profile is modelled as a circle
footprint: 0.6 # radius in m
vicinity: 0.8 # radius in m
reversible: True # whether robots in this fleet can reverse
# TODO Update battery parameters with actual specs
battery_system:
voltage: 24.0 # V
capacity: 40.0 # Ahr
charging_current: 8.8 # A
mechanical_system:
mass: 70.0 # kg
moment_of_inertia: 40.0 #kgm^2
friction_coefficient: 0.22
ambient_system:
power: 20.0 # W
tool_system:
power: 0.0 # W
recharge_threshold: 0.10 # Battery level below which robots in this fleet will not operate
recharge_soc: 1.0 # Battery level to which robots in this fleet should be charged up to during recharging tasks
max_delay: 15.0 # allowed seconds of delay of the current itinerary before it gets interrupted and replanned
publish_fleet_state: 10.0 # Publish frequency for fleet state, ensure that it is same as robot_state_update_frequency
account_for_battery_drain: True
task_capabilities: # Specify the types of RMF Tasks that robots in this fleet are capable of performing
loop: True
delivery: True
finishing_request: "charge" # [park, charge, nothing]
robots:
deliveryRobot1:
charger: "deliveryRobotCharger1"
deliveryRobot2:
charger: "deliveryRobotCharger2"

fleet_manager:
ip: "127.0.0.1"
port: 22012
user: "some_user"
password: "some_password"
robot_state_update_frequency: 10.0
98 changes: 98 additions & 0 deletions nexus_integration_tests/config/rmf/depot.building.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
coordinate_system: reference_image
crowd_sim:
agent_groups:
- {agents_name: [deliveryRobot1, deliveryRobot2], agents_number: 2, group_id: 0, profile_selector: external_agent, state_selector: external_static, x: 0, y: 0}
agent_profiles:
- {ORCA_tau: 1, ORCA_tauObst: 0.40000000000000002, class: 1, max_accel: 0, max_angle_vel: 0, max_neighbors: 10, max_speed: 0, name: external_agent, neighbor_dist: 5, obstacle_set: 1, pref_speed: 0, r: 0.25}
enable: 0
goal_sets: []
model_types: []
obstacle_set: {class: 1, file_name: L1_navmesh.nav, type: nav_mesh}
states:
- {final: 1, goal_set: -1, name: external_static, navmesh_file_name: ""}
transitions: []
update_time_step: 0.10000000000000001
graphs:
{}
levels:
L1:
drawing:
filename: depot_scan.png
elevation: 0
lanes:
- [14, 15, {bidirectional: [4, true], demo_mock_floor_name: [1, ""], demo_mock_lift_name: [1, ""], graph_idx: [2, 0], mutex: [1, ""], orientation: [1, ""], speed_limit: [3, 0]}]
- [14, 18, {bidirectional: [4, true], demo_mock_floor_name: [1, ""], demo_mock_lift_name: [1, ""], graph_idx: [2, 0], mutex: [1, ""], orientation: [1, ""], speed_limit: [3, 0]}]
- [19, 15, {bidirectional: [4, true], demo_mock_floor_name: [1, ""], demo_mock_lift_name: [1, ""], graph_idx: [2, 0], mutex: [1, ""], orientation: [1, ""], speed_limit: [3, 0]}]
- [22, 17, {bidirectional: [4, true], demo_mock_floor_name: [1, ""], demo_mock_lift_name: [1, ""], graph_idx: [2, 0], mutex: [1, ""], orientation: [1, ""], speed_limit: [3, 0]}]
- [20, 22, {bidirectional: [4, true], demo_mock_floor_name: [1, ""], demo_mock_lift_name: [1, ""], graph_idx: [2, 0], mutex: [1, ""], orientation: [1, ""], speed_limit: [3, 0]}]
- [21, 22, {bidirectional: [4, true], demo_mock_floor_name: [1, ""], demo_mock_lift_name: [1, ""], graph_idx: [2, 0], mutex: [1, ""], orientation: [1, ""], speed_limit: [3, 0]}]
- [22, 23, {bidirectional: [4, true], demo_mock_floor_name: [1, ""], demo_mock_lift_name: [1, ""], graph_idx: [2, 0], mutex: [1, ""], orientation: [1, ""], speed_limit: [3, 0]}]
- [17, 16, {bidirectional: [4, true], demo_mock_floor_name: [1, ""], demo_mock_lift_name: [1, ""], graph_idx: [2, 0], mutex: [1, ""], orientation: [1, ""], speed_limit: [3, 0]}]
- [16, 24, {bidirectional: [4, true], demo_mock_floor_name: [1, ""], demo_mock_lift_name: [1, ""], graph_idx: [2, 0], mutex: [1, ""], orientation: [1, ""], speed_limit: [3, 0]}]
- [24, 25, {bidirectional: [4, true], demo_mock_floor_name: [1, ""], demo_mock_lift_name: [1, ""], graph_idx: [2, 0], mutex: [1, ""], orientation: [1, ""], speed_limit: [3, 0]}]
- [15, 26, {bidirectional: [4, true], demo_mock_floor_name: [1, ""], demo_mock_lift_name: [1, ""], graph_idx: [2, 0], mutex: [1, ""], orientation: [1, ""], speed_limit: [3, 0]}]
- [26, 27, {bidirectional: [4, true], demo_mock_floor_name: [1, ""], demo_mock_lift_name: [1, ""], graph_idx: [2, 0], mutex: [1, ""], orientation: [1, ""], speed_limit: [3, 0]}]
- [27, 23, {bidirectional: [4, true], demo_mock_floor_name: [1, ""], demo_mock_lift_name: [1, ""], graph_idx: [2, 0], mutex: [1, ""], orientation: [1, ""], speed_limit: [3, 0]}]
- [16, 28, {bidirectional: [4, true], demo_mock_floor_name: [1, ""], demo_mock_lift_name: [1, ""], graph_idx: [2, 0], mutex: [1, ""], orientation: [1, ""], speed_limit: [3, 0]}]
- [23, 29, {bidirectional: [4, true], demo_mock_floor_name: [1, ""], demo_mock_lift_name: [1, ""], graph_idx: [2, 0], mutex: [1, ""], orientation: [1, ""], speed_limit: [3, 0]}]
- [29, 30, {bidirectional: [4, true], demo_mock_floor_name: [1, ""], demo_mock_lift_name: [1, ""], graph_idx: [2, 0], mutex: [1, ""], orientation: [1, ""], speed_limit: [3, 0]}]
- [29, 18, {bidirectional: [4, true], demo_mock_floor_name: [1, ""], demo_mock_lift_name: [1, ""], graph_idx: [2, 0], mutex: [1, ""], orientation: [1, ""], speed_limit: [3, 0]}]
- [24, 31, {bidirectional: [4, true], demo_mock_floor_name: [1, ""], demo_mock_lift_name: [1, ""], graph_idx: [2, 0], mutex: [1, ""], orientation: [1, ""], speed_limit: [3, 0]}]
- [31, 18, {bidirectional: [4, true], demo_mock_floor_name: [1, ""], demo_mock_lift_name: [1, ""], graph_idx: [2, 0], mutex: [1, ""], orientation: [1, ""], speed_limit: [3, 0]}]
- [32, 33, {bidirectional: [4, true], demo_mock_floor_name: [1, ""], demo_mock_lift_name: [1, ""], graph_idx: [2, 0], mutex: [1, ""], orientation: [1, ""], speed_limit: [3, 0]}]
- [33, 34, {bidirectional: [4, true], demo_mock_floor_name: [1, ""], demo_mock_lift_name: [1, ""], graph_idx: [2, 0], mutex: [1, ""], orientation: [1, ""], speed_limit: [3, 0]}]
- [34, 35, {bidirectional: [4, true], demo_mock_floor_name: [1, ""], demo_mock_lift_name: [1, ""], graph_idx: [2, 0], mutex: [1, ""], orientation: [1, ""], speed_limit: [3, 0]}]
- [35, 36, {bidirectional: [4, true], demo_mock_floor_name: [1, ""], demo_mock_lift_name: [1, ""], graph_idx: [2, 0], mutex: [1, ""], orientation: [1, ""], speed_limit: [3, 0]}]
- [25, 33, {bidirectional: [4, true], demo_mock_floor_name: [1, ""], demo_mock_lift_name: [1, ""], graph_idx: [2, 0], mutex: [1, ""], orientation: [1, ""], speed_limit: [3, 0]}]
- [34, 18, {bidirectional: [4, true], demo_mock_floor_name: [1, ""], demo_mock_lift_name: [1, ""], graph_idx: [2, 0], mutex: [1, ""], orientation: [1, ""], speed_limit: [3, 0]}]
layers:
{}
measurements:
- [0, 1, {distance: [3, 30.199999999999999]}]
models:
- {dispensable: false, model_name: OpenRobotics/FoodCourtTable1, name: OpenRobotics/FoodCourtTable1, static: true, x: 152.75, y: 95.497, yaw: 3.1415999999999999, z: 0}
- {dispensable: false, model_name: OpenRobotics/FoodCourtTable1, name: OpenRobotics/FoodCourtTable1, static: true, x: 152.67400000000001, y: 114.333, yaw: 3.1415999999999999, z: 0}
- {dispensable: false, model_name: OpenRobotics/FoodCourtTable1, name: OpenRobotics/FoodCourtTable1, static: true, x: 152.773, y: 133.21299999999999, yaw: 3.1415999999999999, z: 0}
- {dispensable: false, model_name: OpenRobotics/FoodCourtTable1, name: OpenRobotics/FoodCourtTable1, static: true, x: 152.874, y: 171.666, yaw: 3.1415999999999999, z: 0}
- {dispensable: false, model_name: OpenRobotics/FoodCourtTable1, name: OpenRobotics/FoodCourtTable1, static: true, x: 152.941, y: 209.636, yaw: -3.1415999999999999, z: 0}
- {dispensable: false, model_name: OpenRobotics/FoodCourtTable1, name: OpenRobotics/FoodCourtTable1, static: true, x: 152.941, y: 190.61699999999999, yaw: 3.1415999999999999, z: 0}
vertices:
- [0.104, 307.17000000000002, 0, ""]
- [604.029, 307.00799999999998, 0, ""]
- [2.0099999999999998, 1.994, 0, ""]
- [602.91899999999998, 1.0029999999999999, 0, ""]
- [603.96900000000005, 301.74000000000001, 0, ""]
- [1.7090000000000001, 304.33499999999998, 0, ""]
- [147.125, 72.120000000000005, 0, ""]
- [157.90799999999999, 72.030000000000001, 0, ""]
- [158.08799999999999, 82.813999999999993, 0, ""]
- [146.76499999999999, 82.903999999999996, 0, ""]
- [147.178, 222.09899999999999, 0, ""]
- [158.00399999999999, 222.04900000000001, 0, ""]
- [158.05500000000001, 233.12899999999999, 0, ""]
- [147.02600000000001, 233.02699999999999, 0, ""]
- [266.71499999999997, 281.97899999999998, 0, ""]
- [336.75999999999999, 281.38200000000001, 0, ""]
- [386.298, 26.616, 0, ""]
- [531.37300000000005, 25.829000000000001, 0, ""]
- [269.13, 166.73500000000001, 0, ""]
- [336.38900000000001, 243.58099999999999, 0, "", {is_holding_point: [4, true]}]
- [565.23000000000002, 112.59399999999999, 0, deliveryRobotCharger1, {is_charger: [4, true], is_holding_point: [4, true], is_parking_spot: [4, true], spawn_robot_name: [1, deliveryRobot1], spawn_robot_type: [1, DeliveryRobot]}]
- [565.84900000000005, 136.12799999999999, 0, deliveryRobotCharger2, {is_charger: [4, true], is_holding_point: [4, true], is_parking_spot: [4, true], spawn_robot_name: [1, deliveryRobot2], spawn_robot_type: [1, DeliveryRobot]}]
- [531.54300000000001, 124.38500000000001, 0, ""]
- [530.75400000000002, 166.578, 0, ""]
- [312.75099999999998, 26.198, 0, ""]
- [183.06100000000001, 26.294, 0, ""]
- [564.48400000000004, 281.22500000000002, 0, ""]
- [564.399, 166.97300000000001, 0, ""]
- [386.291, 67.531999999999996, 0, "", {is_holding_point: [4, true]}]
- [448.29300000000001, 167.16200000000001, 0, ""]
- [448.29300000000001, 197.09399999999999, 0, "", {is_holding_point: [4, true]}]
- [313.17000000000002, 124.905, 0, ""]
- [169.52799999999999, 94.926000000000002, 0, workcell_1, {is_holding_point: [4, true], is_parking_spot: [4, false], pickup_dispenser: [1, workcell_1]}]
- [182.399, 94.969999999999999, 0, ""]
- [182.173, 151.29400000000001, 0, ""]
- [182.316, 208.959, 0, ""]
- [169.35300000000001, 209.273, 0, workcell_2, {dropoff_ingestor: [1, workcell_2], is_holding_point: [4, true], is_parking_spot: [4, false], pickup_dispenser: [1, workcell_2]}]
lifts: {}
name: depot
72 changes: 72 additions & 0 deletions nexus_integration_tests/config/rmf/depot.world
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<sdf version="1.7">
<world name="sim_world">
<physics name="10ms" type="ode">
<max_step_size>0.01</max_step_size>
<real_time_factor>1.0</real_time_factor>
</physics>
<plugin filename="libgz-sim-physics-system.so" name="gz::sim::systems::Physics">
</plugin>
<plugin filename="libgz-sim-user-commands-system.so" name="gz::sim::systems::UserCommands">
</plugin>
<plugin filename="libgz-sim-scene-broadcaster-system.so" name="gz::sim::systems::SceneBroadcaster">
</plugin>
<scene>
<ambient>1 1 1</ambient>
<background>0.8 0.8 0.8</background>
<grid>false</grid>
</scene>
<light type="directional" name="sun">
<cast_shadows>true</cast_shadows>
<pose>0 0 10 0 0 0</pose>
<diffuse>1 1 1 1</diffuse>
<specular>0.2 0.2 0.2 1</specular>
<attenuation>
<range>1000</range>
<constant>0.09</constant>
<linear>0.001</linear>
<quadratic>0.001</quadratic>
</attenuation>
<direction>-0.5 0.1 -0.9</direction>
</light>
<model name="ground_plane">
<static>true</static>
<link name="link">
<collision name="collision">
<geometry>
<plane>
<normal>0 0 1</normal>
<size>100 100</size>
</plane>
</geometry>
</collision>
<visual name="visual">
<geometry>
<plane>
<normal>0 0 1</normal>
<size>100 100</size>
</plane>
</geometry>
<material>
<ambient>0.8 0.8 0.8 1</ambient>
<diffuse>0.8 0.8 0.8 1</diffuse>
<specular>0.8 0.8 0.8 1</specular>
</material>
</visual>
</link>
</model>
<include>
<name>deliveryRobot1</name>
<uri>https://fuel.gazebosim.org/1.0/Open-RMF/models/DeliveryRobot</uri>
<pose>28.2650087111177 -5.6303989363968405 0.0 0 0 -2.804903289267812</pose>
</include>
<include>
<name>deliveryRobot2</name>
<uri>https://fuel.gazebosim.org/1.0/Open-RMF/models/DeliveryRobot</uri>
<pose>28.29596255361046 -6.807245025612636 0.0 0 0 2.811792456645858</pose>
</include>
<rmf_charger_waypoints name="charger_waypoints">
<rmf_vertex name="deliveryRobotCharger1" x="28.2650087111177" y="-5.6303989363968405" level="L1" />
<rmf_vertex name="deliveryRobotCharger2" x="28.29596255361046" y="-6.807245025612636" level="L1" />
</rmf_charger_waypoints>
</world>
</sdf>
Loading

0 comments on commit 161b2a4

Please sign in to comment.