|
|
пре 1 недеља | |
|---|---|---|
| .. | ||
| Skill | пре 2 недеља | |
| config_node | пре 1 недеља | |
| environment_node | пре 2 недеља | |
| interfaces | пре 2 недеља | |
| largemodel | пре 1 недеља | |
| nav_simulator | пре 2 недеља | |
| README.md | пре 2 недеља | |
| config.md | пре 1 недеља | |
机器人智能决策系统,基于 ROS2 构建,包含配置管理、环境感知、导航模拟和大模型服务等核心节点。
PlannerNode2/
├── config_node/ # 配置管理节点
├── environment_node/ # 环境感知节点
├── nav_simulator/ # 导航模拟节点
├── largemodel/ # 大模型服务节点
├── README.md # 本文档
功能说明
/ai/config topic发布话题
| 话题名称 | 类型 | 说明 |
|---|---|---|
/ai/config |
std_msgs/String |
配置数据 (JSON 格式) |
配置内容
启动方式
ros2 launch config_node config_node.launch.py
参数说明
| 参数名 | 类型 | 默认值 | 说明 |
|---|---|---|---|
config_file |
string | config/database.yaml |
数据库配置文件路径 |
refresh_interval |
double | 1.0 |
配置刷新间隔 (秒) |
use_mock_data |
bool | True |
是否使用模拟数据 |
use_yaml_fallback |
bool | True |
是否使用 YAML fallback |
topic_name |
string | /ai/config |
配置发布话题 |
功能说明
config_node 获取配置订阅话题
| 话题名称 | 类型 | 说明 |
|---|---|---|
/ai/config |
std_msgs/String |
配置数据 (来自 config_node) |
发布话题
| 话题名称 | 类型 | 说明 |
|---|---|---|
/ai/env |
std_msgs/String |
环境数据 (JSON 格式) |
环境数据结构
{
"timestamp": "2026-05-12T15:02:26",
"battery": {
"level": 85,
"voltage": 12.6,
"is_charging": false,
"capacity_wh": 5000,
"current_ma": -500
},
"temperature": {
"indoor": 25.5,
"outdoor": 28.0,
"unit": "celsius",
"humidity": 60
},
"weather": {
"condition": "sunny",
"description": "晴",
"temperature": 28,
"humidity": 65,
"wind_speed": 3.5
},
"map": {
"points": [
{"id": "A", "name": "办公室", "position": {"x": 1.633, "y": 3.490, "z": 0.0}},
{"id": "B", "name": "酒店大堂", "position": {"x": 2.436, "y": -0.574, "z": 0.0}},
{"id": "C", "name": "园区", "position": {"x": 0.024, "y": -1.820, "z": 0.0}}
]
}
}
启动方式
ros2 launch environment_node environment.launch.py
参数说明
| 参数名 | 类型 | 默认值 | 说明 |
|---|---|---|---|
config_topic |
string | /ai/config |
配置订阅话题 |
environment_topic |
string | /ai/env |
环境发布话题 |
use_mock_data |
bool | True |
是否使用模拟数据 |
功能说明
map_mapping.yaml 中的导航点配置发布话题
| 话题名称 | 类型 | 说明 |
|---|---|---|
/tf |
tf2_msgs/TFMessage |
TF 变换 |
服务/动作
| 名称 | 类型 | 说明 |
|---|---|---|
/navigate_to_pose |
nav2_msgs/NavigateToPose |
导航到目标点 |
动作请求格式
使用 geometry_msgs/PoseStamped 指定目标位置和朝向。
启动方式
ros2 launch nav_simulator nav_simulator.launch.py
参数说明
| 参数名 | 类型 | 默认值 | 说明 |
|---|---|---|---|
map_mapping_file |
string | largemodel/config/map_mapping.yaml |
地图导航点配置文件 |
initial_x |
double | 0.0 |
初始 X 坐标 |
initial_y |
double | 0.0 |
初始 Y 坐标 |
initial_z |
double | 0.0 |
初始 Z 坐标 |
initial_yaw |
double | 0.0 |
初始朝向角 (弧度) |
move_speed |
double | 0.5 |
移动速度 (m/s) |
tf_publish_rate |
double | 10.0 |
TF 发布频率 (Hz) |
simulate_move |
bool | True |
是否模拟移动过程 |
地图配置文件格式
A:
position:
x: 1.633
y: 3.490
z: 0.0
orientation:
yaw: 0.0
B:
position:
x: 2.436
y: -0.574
z: 0.0
orientation:
yaw: 1.57
功能说明
相关文档
详见 largemodel/README.md
# 启动 config_node
ros2 launch config_node config_node.launch.py
# 启动 environment_node
ros2 launch environment_node environment.launch.py
# 启动 nav_simulator
ros2 launch nav_simulator nav_simulator.launch.py
# 启动 largemodel
ros2 launch largemodel largemodel_control.launch.py
# 查看发布的环境数据
ros2 topic echo /ai/env
# 查看发布的配置
ros2 topic echo /ai/config
# 使用命令行发送导航目标
ros2 action send_goal /navigate_to_pose nav2_msgs/action/NavigateToPose "{pose: {header: {frame_id: 'map'}, pose: {position: {x: 1.633, y: 3.490, z: 0.0}, orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}}}}"
sunrise
| 日期 | 版本 | 更新内容 |
|---|---|---|
| 2026-05-12 | 1.0.0 | 初始版本,包含 config_node、environment_node、nav_simulator |