ROS2与Open-RMF仿真教程#Jazzy版#-Hotel World场景示例
文章说明
- 本教程主要介绍Open-RMF运行Hotel World场景示例
- 测试环境:
Ubuntu 24.04+ROS2 Jazzy+Gazebo Harmonic 8.9.0
操作步骤
Hotel World场景这由大堂和两层客房组成,配备两部电梯、多扇门,以及三个共四台机器人的车队- 展示了多支能力各异的机器人队列在多层建筑中的协同工作与集成
- 新开终端,打开
Hotel World仿真场景
$ ros2 launch rmf_demos_gz hotel.launch.xml server_uri:="ws://localhost:8000/_internal"

- 新开终端,启动rmf-web的后端程序
$ cd ~/ros2_rmf_ws/src/rmf-web/packages/api-server
$ pnpm start
- 新开终端,启动rmf-web的前端程序
$ cd ~/ros2_rmf_ws/src/rmf-web/packages/rmf-dashboard-framework
$ pnpm start:example examples/demo
- 现在打开浏览器,地址栏上输入
http://localhost:5173/

测试任务
- 下面执行两个测试任务作为示例
- 执行一个巡逻任务,巡逻
restaurant和L3_master_suite两个地点一次
$ ros2 run rmf_demos_tasks dispatch_patrol -p restaurant L3_master_suite -n 1 --use_sim_time
[INFO] [1755588906.408952805] [task_requester]: Using Sim Time
[INFO] [1755588906.415330192] [task_requester]: Using 'dispatch_task_request'
Json msg payload:
{
"type": "dispatch_task_request",
"request": {
"unix_millis_request_time": 0,
"unix_millis_earliest_start_time": 0,
"requester": "rmf_demos_tasks",
"category": "patrol",
"description": {
"places": [
"restaurant",
"L3_master_suite"
],
"rounds": 1
}
}
}
Got response:
{'state': {'booking': {'id': 'patrol.dispatch-dabd21456e', 'requester': 'rmf_demos_tasks', 'unix_millis_earliest_start_time': 0, 'unix_millis_request_time': 0}, 'category': 'patrol', 'detail': {'places': ['restaurant', 'L3_master_suite'], 'rounds': 1}, 'dispatch': {'errors': [], 'status': 'queued'}, 'status': 'queued', 'unix_millis_start_time': 0}, 'success': True}

- 执行一个清扫任务,清扫
clean_lobby地点
$ ros2 run rmf_demos_tasks dispatch_clean -cs clean_lobby --use_sim_time
[INFO] [1755589008.093761108] [task_requester]: Using Sim Time
[INFO] [1755589008.098664054] [task_requester]: Using 'dispatch_task_request'
Json msg payload:
{
"type": "dispatch_task_request",
"request": {
"unix_millis_request_time": 0,
"unix_millis_earliest_start_time": 0,
"requester": "rmf_demos_tasks",
"category": "compose",
"description": {
"category": "clean",
"phases": [
{
"activity": {
"category": "sequence",
"description": {
"activities": [
{
"category": "go_to_place",
"description": "clean_lobby"
},
{
"category": "perform_action",
"description": {
"unix_millis_action_duration_estimate": 60000,
"category": "clean",
"expected_finish_location": "clean_lobby",
"description": {
"zone": "clean_lobby"
},
"use_tool_sink": true
}
}
]
}
}
}
]
}
}
}

演示视频
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


















