调整整体程序架构,进行功能区分

This commit is contained in:
lyq 2026-01-05 15:47:58 +08:00
parent f0349d21f9
commit f445d3718b
759 changed files with 12664 additions and 15 deletions

View File

@ -12,7 +12,9 @@
"pub_gps_topic": "/zxwl/vehicle/V060003/gps", "pub_gps_topic": "/zxwl/vehicle/V060003/gps",
"remote_topic": "/zxwl/vehicle/V060003/ctrl", "remote_topic": "/zxwl/vehicle/V060003/ctrl",
"mqtt_topic_push_status": "/zxwl/vehicle/V060003/task/status", "mqtt_topic_push_status": "/zxwl/vehicle/V060003/task/status",
"mqtt_topic_sub_task": "/zxwl/vehicle/V060003/task" "mqtt_topic_sub_task": "/zxwl/vehicle/V060003/task",
"info_topic": "/zxwl/vehicle/V060003/info",
"fault_topic": "/zxwl/vehicle/V060003/fault"
}, },
"detect_line_tolerance": 3.06, "detect_line_tolerance": 3.06,
"detect_head_tolerance": 2, "detect_head_tolerance": 2,

138
src/README.md Normal file
View File

@ -0,0 +1,138 @@
# sweeper_200 src 目录结构说明
## 1. 总体说明
sweeper_200 是一个基于 ROS2 的多节点系统,
用于清扫车的感知、定位、控制、作业与平台通信。
src 目录按功能域functional domain对 ROS2 节点进行分组,
用于明确节点职责边界,降低系统复杂度,
并作为系统架构约束的一部分。
新增节点或调整现有节点时,应优先考虑其所属功能域。
---
## 2. 目录分层说明
### base/
底层硬件与接口抽象。
用于放置直接与硬件交互,
或对硬件能力进行抽象的节点与接口包。
职责包括:
- CAN、串口、设备接口
- 底层控制与状态采集
- 硬件能力封装
示例包:
- sweeper_interfaces
- mc
- fu
---
### control/
控制输入与仲裁。
用于放置产生控制意图的节点,
以及多控制源的仲裁逻辑。
职责包括:
- 遥控、远控输入
- 控制权仲裁
- 控制指令标准化
示例包:
- radio_ctrl
- remote_ctrl
- ctrl_arbiter
---
### communication/
平台与外部通信。
用于放置系统与外部平台
(云端、设备服务等)进行通信的节点。
职责包括:
- 设备身份获取与管理
- MQTT、HTTP 通信
- 云端任务同步
示例包:
- identity
- mqtt_report
- task_manager
---
### perception/
感知与定位。
用于放置传感器处理、定位、
环境感知相关节点。
职责包括:
- 雷达、GPS、RTK
- 传感器融合
- 感知数据预处理
示例包:
- rslidar_pointcloud_merger
- rtk
- sub
---
### autonomy/
自动驾驶与作业逻辑。
用于放置路径规划、
作业流程等高层逻辑节点。
职责包括:
- 路径规划
- 作业状态机
- 自动驾驶决策
示例包:
- route
- pl
- airy
---
### execution/
执行与状态发布。
用于向系统外部或平台
发布执行结果与状态信息。
示例包:
- pub_gps
---
### tools/
工具与调试节点(可选)。
---
## 3. 使用原则
- 新增包必须明确所属目录
- 禁止跨层直接依赖
- 系统级通信HTTP、MQTT只允许存在于 communication 目录
---
## 4. 设计说明
目录结构用于表达系统的架构边界,
而不仅是代码整理。
当无法判断一个节点应放入哪个目录时,
通常意味着该节点职责需要重新拆分或澄清。

View File

@ -0,0 +1,25 @@
cmake_minimum_required(VERSION 3.8)
project(vehicle_params)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(std_msgs REQUIRED)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
# comment the line when a copyright and license is added to all source files
set(ament_cmake_copyright_FOUND TRUE)
# the following line skips cpplint (only works in a git repo)
# comment the line when this package is in a git repo and when
# a copyright and license is added to all source files
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()
ament_package()

View File

@ -0,0 +1,21 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>vehicle_params</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="zxwl@44.com">nvidia</maintainer>
<license>TODO: License declaration</license>
<buildtool_depend>ament_cmake</buildtool_depend>
<depend>rclcpp</depend>
<depend>std_msgs</depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<export>
<build_type>ament_cmake</build_type>
</export>
</package>

Some files were not shown because too many files have changed in this diff Show More