Repository navigation
完成选题,创建模块文件夹 #5173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
完成选题,创建模块文件夹 #5173
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d06d0b2
统计贡献度
qq1115457645 1956e48
Merge branch 'OpenHUTB:main' into main
qq1115457645 19cecaf
add_contribution_actions
qq1115457645 e261c5d
Delete Contribution_analysis.py
qq1115457645 d22c72d
Merge branch 'OpenHUTB:main' into main
qq1115457645 dc9487d
Merge branch 'OpenHUTB:main' into main
qq1115457645 92deaf2
first commit to readme
qq1115457645 2383667
Merge pull request #1 from qq1115457645/modify_3-19
qq1115457645 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,140 @@ | ||
| # 车辆物体检测仿真 | ||
|
|
||
| ## 项目简介 | ||
|
|
||
| 这是一个基于MuJoCo物理引擎的小车物体检测仿真项目。该项目模拟了一辆小车在环境中行驶,并使用LiDAR传感器检测周围物体的功能。 | ||
|
|
||
| ## 功能特性 | ||
|
|
||
| 1. **物理仿真**:基于MuJoCo的真实物理仿真,提供精确的物理规律模拟 | ||
| 2. **小车模型**:包含底盘、车厢和四个圆柱形轮子的更真实小车模型 | ||
| 3. **键盘控制**:支持通过键盘方向键控制小车移动方向 | ||
| 4. **传感器模拟**:LiDAR传感器点云数据生成,模拟真实激光雷达工作原理 | ||
| 5. **物体检测**:检测环境中的障碍物并进行标注 | ||
| 6. **数据保存**:保存点云数据和检测结果,便于后续分析 | ||
| 7. **温度监控**:模拟车内温度变化并可视化,包括热源影响分析 | ||
| 8. **智能空调系统**:根据温度自动开启/关闭空调调节温度,维持舒适环境 | ||
| 9. **温度调节可视化**:生成多种温度调节相关图表,直观展示温控效果 | ||
| 10. **故障自检系统**:实时监测传感器和执行器状态,预防系统故障 | ||
| 11. **故障记录与可视化**:自动生成故障报告和趋势图,便于诊断维护 | ||
|
|
||
| ## 环境要求 | ||
|
|
||
| - Python 3.7+ | ||
| - mujoco | ||
| - numpy | ||
| - pygame | ||
| - windows 10+ | ||
|
|
||
| ``` | ||
| pip install -r requirements.txt | ||
| ``` | ||
|
|
||
| ## 项目结构 | ||
|
|
||
| ``` | ||
| minicarsim/ | ||
| ├── main.py # 主程序 | ||
| ├── README.md # 说明文档 | ||
| ├── models/ | ||
| └── simple_car.xml # 小车和环境模型 | ||
| ``` | ||
|
|
||
| ## 快速开始 | ||
| **1.运行仿真:** | ||
| ```bash | ||
| cd src/minicarsim | ||
| python main.py | ||
| ``` | ||
|
|
||
| 2. 观察可视化窗口中的仿真过程 | ||
|
|
||
| 3. 如需手动控制小车,请使用方向键: | ||
| - 上键:前进 | ||
| - 下键:后退 | ||
| - 左键:左转 | ||
| - 右键:右转 | ||
|
|
||
| 控制界面会显示按键说明和当前控制状态(手动控制或自动避障) | ||
|
|
||
| ## 代码说明 | ||
|
|
||
| ### 主要类和方法 | ||
|
|
||
| - `MojocoDataSim`: 主要的仿真类 | ||
| - `generate_realistic_lidar_data()`: 生成真实的LiDAR点云数据 | ||
| - `detect_objects()`: 检测环境中的物体 | ||
| - `simulate_temperature_data()`: 模拟车内温度变化 | ||
| - `check_and_control_ac()`: 检查并控制空调开关 | ||
| - `handle_keyboard_input()`: 处理键盘输入控制 | ||
| - `run_simulation()`: 运行仿真主循环 | ||
| - `visualize_ac_control()`: 生成空调控制状态图 | ||
| - `generate_temperature_trend()`: 生成温度变化趋势图 | ||
| - `generate_temperature_summary_chart()`: 生成温度调节汇总图 | ||
| - `generate_fault_report()`: 生成故障报告 | ||
| - `visualize_fault_status()`: 生成故障状态图 | ||
| - `generate_health_trend()`: 生成健康趋势图 | ||
|
|
||
| - `FaultMonitor`: 故障监测类 | ||
| - `check_system_health()`: 检查系统整体健康状态 | ||
| - `_check_sensor_health()`: 检查传感器健康状态 | ||
| - `_check_actuator_health()`: 检查执行器健康状态 | ||
|
|
||
| ### 配置参数 | ||
|
|
||
| 在`main.py`中可以调整的主要参数: | ||
|
|
||
| - `LIDAR_PARAMS`: LiDAR传感器参数 | ||
| - `TEMPERATURE_PARAMS`: 温度监控参数 | ||
| - `FAULT_MONITORING_PARAMS`: 故障监测参数 | ||
| - `SIMULATION_FRAMES`: 仿真总帧数 | ||
|
|
||
| ## 模型说明 | ||
|
|
||
| ### simple_car.xml | ||
|
|
||
| 该文件定义了: | ||
| - 地面平面 | ||
| - 小车模型(底盘、车厢和四个圆柱形轮子) | ||
| - 5个彩色障碍物 | ||
| - 传感器安装位置(LiDAR和摄像头) | ||
|
|
||
| ## 数据输出 | ||
|
|
||
| 仿真运行后会产生四类数据: | ||
|
|
||
| 1. **LiDAR点云数据**:保存为`.npy`格式的NumPy数组 | ||
| 2. **物体检测标注**:保存为`.json`格式的标注文件 | ||
| 3. **温度调节可视化图表**: | ||
| - 温度变化趋势图 (`temperature_trend.png`) | ||
| - 温度调节汇总图 (`temperature_summary.png`) | ||
| - 空调控制状态图 (`ac_control_XXXX.png`) | ||
| - 环境温度分布图 (`thermal_map_XXXX.png`) | ||
| 4. **故障监测报告**: | ||
| - 故障详细报告 (`frame_XXXX.json`) | ||
| - 故障状态图 (`fault_status_XXXX.png`) | ||
| - 系统健康趋势图 (`health_trend.png`) | ||
|
|
||
| ## 扩展建议 | ||
|
|
||
| 1. 添加更多类型的传感器(如摄像头) | ||
| 2. 实现更复杂的物体检测算法 | ||
| 3. 添加不同的环境地图 | ||
| 4. 实现自主导航功能 | ||
| 5. 添加更多的车辆控制方式 | ||
| 6. 增强空调控制算法(PID控制等) | ||
| 7. 增加更多类型的故障检测(如通信故障、电源故障等) | ||
|
|
||
| ## 故障排除 | ||
|
|
||
| ### 常见问题 | ||
|
|
||
| 1. **找不到模型文件**:检查`XML_PATH`是否正确 | ||
| 2. **无法显示可视化窗口**:确保已正确安装MuJoCo | ||
| 3. **没有检测到物体**:检查小车与物体之间的距离 | ||
| 4. **温度调节效果不明显**:检查空调功率系数和舒适温度范围设置 | ||
| 5. **没有生成故障报告**:检查故障检测阈值设置 | ||
|
|
||
| ### 支持 | ||
|
|
||
| 如有问题,请提交issue或联系项目维护者。 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| mujoco | ||
| numpy | ||
| pygame |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没有实现的功能不要写文档。
也不能直接用大模型的输出。