修改README.md

This commit is contained in:
Tian jianyong 2024-11-16 15:17:58 +08:00
parent d5721d5575
commit d6c709a89b
2 changed files with 144 additions and 159 deletions

43
.gitignore vendored Normal file
View File

@ -0,0 +1,43 @@
# Build directories
build/
out/
cmake-build-*/
# IDE directories
.idea/
.vscode/
*.swp
*.swo
# Compiled files
*.o
*.obj
*.exe
*.dll
*.so
*.dylib
# CMake generated files
CMakeCache.txt
CMakeFiles/
cmake_install.cmake
Makefile
# Python cache files
__pycache__/
*.py[cod]
# macOS system files
.DS_Store
.AppleDouble
.LSOverride
# Log files
*.log
# Dependency directories
/vendor/
/third_party/
# Test generated files
Testing/

260
README.md
View File

@ -1,186 +1,128 @@
# 机场地面交通管制系统
# 机场地面碰撞预警系统
这是一个用于机场地面交通管制的碰撞避障系统使用C++17开发。
## 项目简介
## 依赖项
该系统用于监测和预警机场地面航空器与车辆之间的潜在碰撞风险。通过实时采集和分析位置数据,为机场运营提供安全保障。
- CMake 3.15+
- C++17 编译器
- Boost
## 功能特性
- 实时数据采集:获取航空器和车辆的位置信息
- 碰撞风险检测:基于安全距离进行碰撞风险评估
- 运动参数计算:自动计算速度和航向信息
- 坐标转换:支持地理坐标和平面坐标转换
- 日志记录:详细的运行日志和警告信息
## 系统架构
- 数据采集模块:从数据源获取位置信息
- 碰撞检测模块:分析潜在的碰撞风险
- 坐标转换模块:处理不同坐标系统
- 核心数据类型:定义基础的数据结构
## 开发环境
- C++17
- CMake 3.10+
- Boost 1.86.0
- nlohmann_json
- Python 3.x (用于模拟数据服务器)
- Flask (Python包用于模拟数据服务器)
- Google Test
## 安装依赖
### 1. 安装系统依赖
## 构建说明
```bash
# Ubuntu/Debian
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
libboost-all-dev \
nlohmann-json3-dev \
python3 \
python3-pip
# 创建构建目录
mkdir build && cd build
# CentOS/RHEL
sudo yum install -y \
gcc-c++ \
cmake \
boost-devel \
nlohmann-json-devel \
python3 \
python3-pip
```
### 2. 安装Python依赖
```bash
pip3 install flask
```
### 3. MacOS
```bash
brew install cmake
brew install boost
brew install nlohmann-json
# 安装 Python如果需要
brew install python3
# 安装 Flask用于模拟服务器
pip3 install flask
# 检查版本
cmake --version
brew list boost
brew list nlohmann-json
python3 --version
pip3 list | grep Flask
```
## 构建和运行
### 1. 启动模拟数据服务器
```bash
# 在项目根目录下
cd tools
python3 mock_server.py
```
模拟服务器将在 <http://localhost:8080/api/vehicles> 提供飞行器和车辆的位置数据。
### 2. 构建项目
```bash
# 在项目根目录下
mkdir build
cd build
# 配置项目
cmake ..
make -j4
# 编译
make
# 运行测试
./bin/unit_tests
```
### 3. 运行程序
## 测试框架
```bash
# 在build目录下
./airport_collision_avoidance
```
- 使用 Google Test 进行单元测试
- 测试覆盖:
- 基础数据类型
- 碰撞检测逻辑
- 数据采集功能
- HTTP 数据源
- Mock 服务器用于测试
## 数据格式
模拟服务器提供的数据格式示例:
```json
{
"vehicles": [
{
"id": "AIRCRAFT_1",
"type": "AIRCRAFT",
"position": {
"x": 1000.0,
"y": 1000.0
},
"velocity": {
"x": 5.0,
"y": 3.0
},
"heading": 45.0,
"timestamp": 1234567890,
"altitude": 500.0
},
{
"id": "VEHICLE_1",
"type": "VEHICLE",
"position": {
"x": 500.0,
"y": 500.0
},
"velocity": {
"x": 2.0,
"y": 1.0
},
"heading": 90.0,
"timestamp": 1234567890,
"altitude": 0.0
}
]
}
```
## 项目结构
## 目录结构
```mermaid
graph TD
A[项目根目录] --> B[CMakeLists.txt]
A --> C[README.md]
A --> D[src/]
D --> E[main.cpp]
D --> F[core/]
D --> G[collector/]
D --> H[detector/]
D --> I[command/]
D --> J[network/]
D --> K[types/]
K --> L[concurrent/]
A --> M[tools/]
M --> N[mock_server.py]
A[ObstacleAvoidance] --> B[src]
A --> C[tests]
A --> D[tools]
A --> E[docs]
A --> F[build]
B --> BA[collector]
B --> BB[detector]
B --> BC[network]
B --> BD[spatial]
B --> BE[types]
B --> BF[utils]
B --> BG[core]
BA --> BAA[DataCollector.h/cpp]
BA --> BAB[DataSource.h]
BB --> BBA[CollisionDetector.h/cpp]
BC --> BCA[HTTPDataSource.h/cpp]
BC --> BCB[ConnectionConfig.h]
BD --> BDA[CoordinateConverter.h/cpp]
BE --> BEA[BasicTypes.h/cpp]
BF --> BFA[Logger.h/cpp]
BG --> BGA[System.h/cpp]
C --> CA[BasicTypesTest.cpp]
C --> CB[CollisionDetectorTest.cpp]
C --> CC[DataCollectorTest.cpp]
C --> CD[HTTPDataSourceTest.cpp]
D --> DA[mock_server.py]
```
## 开发说明
## 配置说明
1. 模拟服务器每秒更新一次数据
2. 系统每100ms获取一次数据
3. 支持飞行器和地面车辆两种类型
4. 实时显示位置、速度、航向等信息
- 数据源配置:
- 主机localhost
- 端口8080
- API路径
- /api/getCurrentFlightPositions
- /api/getCurrentVehiclePositions
## 故障排除
- 安全参数:
- 水平安全距离50米
- 垂直安全距离50米
- 最大速度限制:
- 航空器100米/秒
- 车辆30米/秒
1. 如果无法连接到模拟服务器,请检查:
- 模拟服务器是否正在运行
- 端口8080是否被占用
- 防火墙设置
## 开发团队
2. 如果编译失败,请检查:
- 是否安装了所有依赖
- CMake版本是否满足要求
- 编译器是否支持C++17
## 注意事项
1. 模拟服务器仅用于开发和测试
2. 生产环境请使用实际的数据源
3. 默认配置适用于本地开发环境
- 项目负责人:[田建勇]
- 开发人员:[赵豪、陈横、刘青宇]
## 许可证
[添加许可证信息]
[License Type]
## 联系方式
## 版本历史
[添加联系方式]
- v1.0.0 (2024-11-15)
- 初始版本发布
- 基本功能实现
- 单元测试框架搭建