From d59bee9dc55b6720eb9db4c4124b1937b317cb3e Mon Sep 17 00:00:00 2001 From: minghao-lee <1467864011@qq.com> Date: Tue, 12 May 2026 19:51:41 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=B8=AD=E6=96=87?= =?UTF-8?q?=E6=91=98=E8=A6=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- critical/undergraduate/content/abstractzh.tex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/critical/undergraduate/content/abstractzh.tex b/critical/undergraduate/content/abstractzh.tex index f445fa15..33b0ee96 100644 --- a/critical/undergraduate/content/abstractzh.tex +++ b/critical/undergraduate/content/abstractzh.tex @@ -1,10 +1,12 @@ %!TEX root = ../csuthesis_main.tex % 设置中文摘要 -\keywordscn{智能驾驶\quad 仿真场景\quad 危险场景生成\quad NSGA-II 多目标优化} +\keywordscn{危险驾驶场景\quad 强化学习\quad 场景生成\quad NSGA-II CARLA仿真} %\categorycn{TP391} \begin{abstractzh} -在智能驾驶系统的发展过程中,仿真场景的生成与优化是保障其安全性和可靠性的关键技术手段。本文首先基于自然驾驶数据提取具有代表性的危险场景,构建真实有效的仿真数据基础;随后,采用多维场景融合方法识别典型行车行为(如变道、跟车、邻车切入等),并与动态交通要素结合,生成更加复杂和真实的测试场景。针对现有测试环境中高风险场景覆盖率不足的问题,本文重点引入 NSGA-II 多目标优化算法,通过非支配排序与拥挤度计算,在“最小安全距离”和“碰撞风险”两个目标之间实现 Pareto 最优平衡,有效筛选出多样且具有代表性的高危场景。实验结果表明,与传统随机搜索方法相比,NSGA-II 可将高风险场景覆盖率提高 30\% 以上。最后,设计并实现了一套自动化仿真测试平台,集成场景生成、仿真执行、数据采集与结果分析功能,实现测试流程的自动化和标准化。本文方法显著提升了智能驾驶系统在仿真环境中的安全性验证能力,为未来自动驾驶系统的开发与测试提供了有力技术支撑。 +随着自动驾驶技术的快速发展,如何在复杂交通环境下对自动驾驶系统的安全性进行有效评估,已成为当前研究的重要问题。传统道路测试由于成本高、安全风险大以及难以复现特殊场景等局限性,逐渐被仿真测试所替代。为满足自动驾驶安全测试需求,本文基于CARLA仿真平台,提出了一种面向自动驾驶危险工况的分类与生成方法。 +本文结合人工标注与强化学习技术,对不同类型的危险工况进行识别与分类,并将生成结果转换为符合OpenSCENARIO标准的.xosc场景文件。同时,对恶劣天气、交通违章行为以及多交通参与者交互等典型危险场景特征进行了分析。在此基础上,采用基于人工标注与PPO(Proximal Policy Optimization)强化学习相结合的半自动化数据生成方法,构建了包含加塞、变道、紧急制动、行人横穿道路等十类高危驾驶场景的数据集。 +针对生成场景,本文从场景复现率、危险程度及可重复性等方面建立评价指标体系,并通过图表对实验结果进行分析。实验结果表明,本文提出的方法能够有效提高危险场景生成效率,并生成较为真实的复杂交通场景,为自动驾驶系统的安全测试提供支持。 \end{abstractzh} From bab54db6b7a3de02fe29aff80aed7ebb9f47b8c4 Mon Sep 17 00:00:00 2001 From: minghao-lee <1467864011@qq.com> Date: Tue, 12 May 2026 20:50:14 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=8B=B1=E6=96=87?= =?UTF-8?q?=E6=91=98=E8=A6=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- critical/undergraduate/content/abstracten.tex | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/critical/undergraduate/content/abstracten.tex b/critical/undergraduate/content/abstracten.tex index 14c41036..e604795b 100644 --- a/critical/undergraduate/content/abstracten.tex +++ b/critical/undergraduate/content/abstracten.tex @@ -1,7 +1,9 @@ %!TEX root = ../csuthesis_main.tex -\keywordsen{Intelligent Driving \ \ Simulation Scenarios \ \ Dangerous Scenario Generation \ \ NSGA-II Multi-objective Optimization} +\keywordsen{Hazardous Driving Scenarios \ \ Reinforcement Learning \ \ Scenario Generation \ \ CARLA Simulation} \begin{abstracten} -In the development of intelligent driving systems, the generation and optimization of simulation scenarios play a vital role in ensuring system safety and reliability. This thesis begins by extracting representative hazardous scenarios from naturalistic driving data to establish a realistic simulation foundation. Through multidimensional scenario fusion techniques, typical driving behaviors such as lane changes, car following, and adjacent vehicle cut-ins are identified and integrated with dynamic traffic elements to produce complex and realistic test cases. To address the insufficient coverage of high-risk scenarios, this work emphasizes the adoption of the NSGA-II multi-objective optimization algorithm. By applying non-dominated sorting and crowding distance mechanisms, NSGA-II balances the conflicting objectives of minimum safety distance and collision risk to extract a Pareto-optimal set of critical scenarios. Experimental comparisons demonstrate that NSGA-II outperforms random search, achieving over 30\% improvement in high-risk scenario coverage. Finally, an automated simulation testing platform is developed to support scenario generation, execution, data logging, and result evaluation, enabling a fully automated and standardized testing workflow. The proposed framework significantly enhances safety testing efficiency and effectiveness in simulated environments, providing robust technical support for autonomous driving technology development. +With the rapid development of autonomous driving technology, how to effectively evaluate the safety of autonomous driving systems in complex traffic environments has become an important research issue. Traditional road testing is gradually being replaced by simulation testing due to its high cost, significant safety risks, and difficulty in reproducing special scenarios. To meet the requirements of autonomous driving safety testing, this paper proposes a classification and generation method for hazardous driving scenarios based on the CARLA simulation platform. +This paper combines manual annotation and reinforcement learning techniques to identify and classify different types of hazardous scenarios, and converts the generated scenarios into .xosc files that conform to the OpenSCENARIO standard. In addition, typical hazardous factors, including adverse weather conditions, traffic violations, and interactions among multiple traffic participants, are analyzed. On this basis, a semi-automatic data generation method combining manual annotation and Proximal Policy Optimization (PPO) reinforcement learning is adopted to construct a dataset containing ten types of high-risk driving scenarios, such as vehicle cut-in, lane changing, emergency braking, and pedestrian crossing. +To evaluate the generated scenarios, an evaluation framework is established from multiple aspects, including scenario reproducibility, hazard level, and repeatability, and the experimental results are analyzed through charts and visualizations. The results demonstrate that the proposed method can effectively improve the efficiency of hazardous scenario generation and produce realistic and complex traffic scenarios, thereby providing support for the safety testing of autonomous driving systems. -\end{abstracten} +\end{abstracten} \ No newline at end of file From 75f6f78ccafe3604a85768cad7e18200b44facb1 Mon Sep 17 00:00:00 2001 From: minghao-lee <1467864011@qq.com> Date: Mon, 18 May 2026 16:40:58 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- critical/undergraduate/content/README.md | 63 ++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 critical/undergraduate/content/README.md diff --git a/critical/undergraduate/content/README.md b/critical/undergraduate/content/README.md new file mode 100644 index 00000000..87c64fa2 --- /dev/null +++ b/critical/undergraduate/content/README.md @@ -0,0 +1,63 @@ +# 基于 CARLA 的极端驾驶仿真场景生成算法研究 +## 项目简介 + +研究并实现极端驾驶场景自动生成算法,定义 10 种典型危险驾驶场景,支持手动构建与强化学习(DQN / PPO 系列)自动生成对抗场景,输出标准 OpenSCENARIO (.xosc) 文件。 + +## 技术栈 + +- 仿真平台:hutb (CARLA 2.9.16) +- 语言:Python 3.7 +- 强化学习:DQN、Attention-DQN、PPO、Smooth-PPO +- 场景标准:ASAM OpenSCENARIO 1.2 + +## 项目结构 + +``` +├── config/ 全局固定参数 +├── env/ 仿真交互环境 + 通用奖励 +├── utils/ 工具函数(传感器/评估/几何) +├── scenarios/ 10 种危险场景定义 +├── rl_algorithms/ 强化学习算法 +├── experiments/ 训练/评估/对比入口 +├── osc_exporter/ OpenSCENARIO 导出 +├── tests/ 单元测试 +└── main.py 统一入口 +``` + +## 10 种危险场景 + +| # | 场景 | 类别 | 核心危险 | +|---|------|------|----------| +| 1 | 暴雨跟车 | 极端天气 | 湿滑路面 + 低能见度 | +| 2 | 浓雾巡航 | 极端天气 | 能见度 < 20m | +| 3 | 夜间黑暗行驶 | 极端天气 | 光照 5% | +| 4 | 前车急刹 | 车辆对抗 | 前车 -8m/s² 急刹 | +| 5 | 旁车加塞 | 车辆对抗 | 强行切入自车车道 | +| 6 | 行人横穿 | 行人危险 | 人行道突然横穿 | +| 7 | 鬼探头 | 行人危险 | 货车盲区突然冲出 | +| 8 | 行人闯红灯 | 行人危险 | 违规横穿 | +| 9 | 夜间行人横穿 | 多因素耦合 | 黑暗 + 行人 | +| 10 | 雾天鬼探头 | 多因素耦合 | 浓雾 + 盲区 | + +## 快速开始 + +```bash +# 1. 启动 CARLA 仿真器 +cd D:\hutb\hutb && CarlaUE4.exe + +# 2. 运行项目 +python main.py + +# 或命令行模式 +python main.py train --algo dqn --scenario rain_storm --episodes 500 +python main.py evaluate --algo smooth_ppo --scenario emergency_brake --model models/xxx.pth +python main.py export --scenario ghost_peek +python main.py test --suite all +``` + +## 环境要求 + +- Windows 10 / Ubuntu 18.04+ +- CARLA 0.9.16 (hutb 定制版) +- Python 3.7 +- PyTorch + NumPy + PyYAML + matplotlib From 7f0f80dc927775fd81a2635a254ae213ef0eaf58 Mon Sep 17 00:00:00 2001 From: minghao-lee <1467864011@qq.com> Date: Mon, 18 May 2026 16:54:14 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E8=AF=B4=E6=98=8E=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- critical/undergraduate/content/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/critical/undergraduate/content/README.md b/critical/undergraduate/content/README.md index 87c64fa2..c298eb85 100644 --- a/critical/undergraduate/content/README.md +++ b/critical/undergraduate/content/README.md @@ -61,3 +61,7 @@ python main.py test --suite all - CARLA 0.9.16 (hutb 定制版) - Python 3.7 - PyTorch + NumPy + PyYAML + matplotlib + +## 百度网盘链接 +- 通过网盘分享的文件:carla +- 链接: https://pan.baidu.com/s/1PIzndyc4LrLxvKNImyH9CA?pwd=shju 提取码: shju \ No newline at end of file From d86c1bdb0a06b9dd4efc28a58f5fbec80cfc911d Mon Sep 17 00:00:00 2001 From: minghao-lee <1467864011@qq.com> Date: Mon, 18 May 2026 21:21:48 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- critical/__init__.py | 47 +++++++++++++++++++++++++++++ critical/carla_config.py | 64 ++++++++++++++++++++++++++++++++++++++++ critical/dqn_config.py | 51 ++++++++++++++++++++++++++++++++ critical/ppo_config.py | 55 ++++++++++++++++++++++++++++++++++ 4 files changed, 217 insertions(+) create mode 100644 critical/__init__.py create mode 100644 critical/carla_config.py create mode 100644 critical/dqn_config.py create mode 100644 critical/ppo_config.py diff --git a/critical/__init__.py b/critical/__init__.py new file mode 100644 index 00000000..f4aec1c6 --- /dev/null +++ b/critical/__init__.py @@ -0,0 +1,47 @@ +# config/__init__.py +# 全局配置模块统一入口 —— 仅导出公共固定参数 + +from .carla_config import ( + CARLA_HOST, CARLA_PORT, CARLA_TIMEOUT, + SYNC_MODE, SIMULATION_FPS, FIXED_DELTA_SECONDS, + EGO_VEHICLE_BLUEPRINT, ADV_VEHICLE_BLUEPRINT, + DEFAULT_SPAWN_INDEX, + COLLISION_THRESHOLD, MIN_SAFE_DISTANCE, VEHICLE_MAX_SPEED, + RGB_CAMERA_CONFIG, LIDAR_CONFIG, SENSOR_UPDATE_FPS, + MAX_EPISODE_STEPS, EPISODE_TIMEOUT, + COLLISION_PENALTY, SUCCESS_REWARD, + RESULTS_DIR, MODELS_DIR, LOGS_DIR, + SCENARIOS_OUTPUT_DIR, EVALUATION_OUTPUT_DIR, + COMPARISON_OUTPUT_DIR, PLOTS_OUTPUT_DIR, +) + +from .dqn_config import ( + STATE_SIZE as DQN_STATE_SIZE, + ACTION_SIZE as DQN_ACTION_SIZE, + HIDDEN_SIZES as DQN_HIDDEN_SIZES, + ATTENTION_HEAD_DIM, NUM_ATTENTION_HEADS, ATTENTION_DROPOUT, + LEARNING_RATE as DQN_LR, GAMMA as DQN_GAMMA, + TAU as DQN_TAU, TARGET_UPDATE_FREQ, + MEMORY_SIZE, BATCH_SIZE as DQN_BATCH_SIZE, MIN_REPLAY_SIZE, + EPSILON_START, EPSILON_MIN, EPSILON_DECAY, + TRAIN_EVERY_N_STEPS as DQN_TRAIN_EVERY, + MAX_EPISODES as DQN_MAX_EPISODES, + SAVE_EVERY_N_EPISODES as DQN_SAVE_EVERY, + LOG_EVERY_N_EPISODES as DQN_LOG_EVERY, +) + +from .ppo_config import ( + STATE_SIZE as PPO_STATE_SIZE, + ACTION_SIZE as PPO_ACTION_SIZE, ACTION_STD, + HIDDEN_SIZES as PPO_HIDDEN_SIZES, + ACTOR_HIDDEN, CRITIC_HIDDEN, ACTIVATION as PPO_ACTIVATION, + GAMMA as PPO_GAMMA, LAMBDA as PPO_LAMBDA, + EPS_CLIP, UPDATE_EVERY as PPO_UPDATE_EVERY, + UPDATE_POLICY_TIMES, BATCH_SIZE as PPO_BATCH_SIZE, + LR_ACTOR, LR_CRITIC, + SMOOTH_ENABLED, SMOOTH_EPS_LOW, SMOOTH_EPS_HIGH, SMOOTH_BETA, + VALUE_LOSS_COEF, ENTROPY_COEF, MAX_GRAD_NORM, + MAX_EPISODES as PPO_MAX_EPISODES, + SAVE_EVERY_N_EPISODES as PPO_SAVE_EVERY, + LOG_EVERY_N_EPISODES as PPO_LOG_EVERY, +) diff --git a/critical/carla_config.py b/critical/carla_config.py new file mode 100644 index 00000000..4a88a243 --- /dev/null +++ b/critical/carla_config.py @@ -0,0 +1,64 @@ +# config/carla_config.py +# 全局固定参数:CARLA 连接、地图、车型、传感器通用配置、全局路径 +# 按 config/CLAUDE.md 规范 —— 不写入任何场景差异化内容 + +# ============================================================ +# 1. CARLA 连接公共参数 +# ============================================================ +CARLA_HOST = "localhost" +CARLA_PORT = 2000 +CARLA_TIMEOUT = 30.0 + +# 同步模式(强化学习训练必须) +SYNC_MODE = True +SIMULATION_FPS = 20 +FIXED_DELTA_SECONDS = 1.0 / SIMULATION_FPS + +# ============================================================ +# 2. 全局车辆公共参数 +# ============================================================ +EGO_VEHICLE_BLUEPRINT = "vehicle.tesla.model3" +ADV_VEHICLE_BLUEPRINT = "vehicle.audi.a2" + +# 全局默认生成点索引(场景可覆盖) +DEFAULT_SPAWN_INDEX = 0 + +# 碰撞检测阈值 & 控制频率(所有场景共用) +COLLISION_THRESHOLD = 1.5 # 碰撞判定距离 (m) +MIN_SAFE_DISTANCE = 3.0 # 最小安全距离 (m) +VEHICLE_MAX_SPEED = 80.0 # 最高速度 (km/h) + +# ============================================================ +# 3. 全局传感器公共参数 +# ============================================================ +RGB_CAMERA_CONFIG = { + "image_size_x": "640", + "image_size_y": "480", + "fov": "90.0", +} + +LIDAR_CONFIG = { + "points_per_second": "100000", + "range": "50.0", +} + +SENSOR_UPDATE_FPS = 20 # 传感器采集频率(全局统一) + +# ============================================================ +# 4. 训练全局参数(所有算法共用) +# ============================================================ +MAX_EPISODE_STEPS = 500 +EPISODE_TIMEOUT = 60.0 # 单集超时 (s) +COLLISION_PENALTY = -10.0 # 碰撞惩罚 +SUCCESS_REWARD = 10.0 # 安全完成奖励 + +# ============================================================ +# 5. 全局路径 +# ============================================================ +RESULTS_DIR = "results" +MODELS_DIR = "models" +LOGS_DIR = "logs" +SCENARIOS_OUTPUT_DIR = "results/scenarios" +EVALUATION_OUTPUT_DIR = "results/evaluation" +COMPARISON_OUTPUT_DIR = "results/comparison" +PLOTS_OUTPUT_DIR = "results/plots" diff --git a/critical/dqn_config.py b/critical/dqn_config.py new file mode 100644 index 00000000..72d7c171 --- /dev/null +++ b/critical/dqn_config.py @@ -0,0 +1,51 @@ +# config/dqn_config.py +# DQN / Attention-DQN 超参数配置 + +# ============================================================ +# 环境接口 +# ============================================================ +STATE_SIZE = 6 # [ego_x, ego_y, adv_x, adv_y, ego_speed, distance] +ACTION_SIZE = 4 # 0=无操作, 1=左转, 2=右转, 3=制动 + +# ============================================================ +# 网络结构 +# ============================================================ +HIDDEN_SIZES = [256, 256, 128] # 三层全连接隐藏层 +ACTIVATION = "relu" + +# ============================================================ +# Attention-DQN 专属 +# ============================================================ +ATTENTION_HEAD_DIM = 64 # 每个注意力头的维度 +NUM_ATTENTION_HEADS = 4 # 多头注意力头数 +ATTENTION_DROPOUT = 0.1 + +# ============================================================ +# 训练超参数 +# ============================================================ +LEARNING_RATE = 1e-3 +GAMMA = 0.95 # 折扣因子 +TAU = 0.005 # 目标网络软更新系数 +TARGET_UPDATE_FREQ = 100 # 每 N 步硬更新目标网络 + +# ============================================================ +# 经验回放池 +# ============================================================ +MEMORY_SIZE = 50000 # 回放池容量 +BATCH_SIZE = 128 +MIN_REPLAY_SIZE = 2000 # 开始训练前最少经验条数 + +# ============================================================ +# 探索策略 (ε-greedy) +# ============================================================ +EPSILON_START = 1.0 +EPSILON_MIN = 0.01 +EPSILON_DECAY = 0.995 # 每步乘以该系数 + +# ============================================================ +# 训练控制 +# ============================================================ +TRAIN_EVERY_N_STEPS = 4 # 每 N 步执行一次学习 +MAX_EPISODES = 500 +SAVE_EVERY_N_EPISODES = 100 +LOG_EVERY_N_EPISODES = 10 diff --git a/critical/ppo_config.py b/critical/ppo_config.py new file mode 100644 index 00000000..c5a8876c --- /dev/null +++ b/critical/ppo_config.py @@ -0,0 +1,55 @@ +# config/ppo_config.py +# PPO / Smooth-PPO 超参数配置 + +# ============================================================ +# 环境接口 +# ============================================================ +STATE_SIZE = 6 # [ego_x, ego_y, adv_x, adv_y, ego_speed, distance] +ACTION_SIZE = 4 # 0=无操作, 1=左转, 2=右转, 3=制动 +ACTION_STD = 0.5 # 连续动作空间下初始标准差(离散动作为 softmax 温度) + +# ============================================================ +# 网络结构 (Actor-Critic) +# ============================================================ +HIDDEN_SIZES = [256, 256] # Actor 与 Critic 共享特征提取层 +ACTOR_HIDDEN = [128, 64] # Actor 头部 +CRITIC_HIDDEN = [128, 64] # Critic 头部 +ACTIVATION = "tanh" + +# ============================================================ +# PPO 核心超参数 +# ============================================================ +GAMMA = 0.99 # 折扣因子 +LAMBDA = 0.95 # GAE 平滑系数 +EPS_CLIP = 0.2 # PPO 标准裁剪范围 +UPDATE_EVERY = 2048 # 每收集多少步经验后执行一次策略更新 +UPDATE_POLICY_TIMES = 10 # 每次更新时对同一批数据重复训练轮数 +BATCH_SIZE = 64 # 小批量大小 + +# ============================================================ +# 学习率 +# ============================================================ +LR_ACTOR = 1e-4 +LR_CRITIC = 1e-3 + +# ============================================================ +# Smooth-PPO 专属参数(创新点) +# ============================================================ +SMOOTH_ENABLED = True +SMOOTH_EPS_LOW = 0.1 # 平滑裁剪下界 +SMOOTH_EPS_HIGH = 0.3 # 平滑裁剪上界 +SMOOTH_BETA = 0.5 # 平滑插值系数(0=标准, 1=全平滑) + +# ============================================================ +# 损失权重与正则化 +# ============================================================ +VALUE_LOSS_COEF = 0.5 # 价值损失权重 +ENTROPY_COEF = 0.01 # 熵正则化系数 +MAX_GRAD_NORM = 0.5 # 梯度裁剪阈值 + +# ============================================================ +# 训练控制 +# ============================================================ +MAX_EPISODES = 500 +SAVE_EVERY_N_EPISODES = 100 +LOG_EVERY_N_EPISODES = 10 From 634f3b6353881225f0752d52b1e7d0461b1ca0a4 Mon Sep 17 00:00:00 2001 From: minghao-lee <1467864011@qq.com> Date: Mon, 18 May 2026 21:26:39 +0800 Subject: [PATCH 6/7] 1 --- critical/README.md | 67 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 critical/README.md diff --git a/critical/README.md b/critical/README.md new file mode 100644 index 00000000..c298eb85 --- /dev/null +++ b/critical/README.md @@ -0,0 +1,67 @@ +# 基于 CARLA 的极端驾驶仿真场景生成算法研究 +## 项目简介 + +研究并实现极端驾驶场景自动生成算法,定义 10 种典型危险驾驶场景,支持手动构建与强化学习(DQN / PPO 系列)自动生成对抗场景,输出标准 OpenSCENARIO (.xosc) 文件。 + +## 技术栈 + +- 仿真平台:hutb (CARLA 2.9.16) +- 语言:Python 3.7 +- 强化学习:DQN、Attention-DQN、PPO、Smooth-PPO +- 场景标准:ASAM OpenSCENARIO 1.2 + +## 项目结构 + +``` +├── config/ 全局固定参数 +├── env/ 仿真交互环境 + 通用奖励 +├── utils/ 工具函数(传感器/评估/几何) +├── scenarios/ 10 种危险场景定义 +├── rl_algorithms/ 强化学习算法 +├── experiments/ 训练/评估/对比入口 +├── osc_exporter/ OpenSCENARIO 导出 +├── tests/ 单元测试 +└── main.py 统一入口 +``` + +## 10 种危险场景 + +| # | 场景 | 类别 | 核心危险 | +|---|------|------|----------| +| 1 | 暴雨跟车 | 极端天气 | 湿滑路面 + 低能见度 | +| 2 | 浓雾巡航 | 极端天气 | 能见度 < 20m | +| 3 | 夜间黑暗行驶 | 极端天气 | 光照 5% | +| 4 | 前车急刹 | 车辆对抗 | 前车 -8m/s² 急刹 | +| 5 | 旁车加塞 | 车辆对抗 | 强行切入自车车道 | +| 6 | 行人横穿 | 行人危险 | 人行道突然横穿 | +| 7 | 鬼探头 | 行人危险 | 货车盲区突然冲出 | +| 8 | 行人闯红灯 | 行人危险 | 违规横穿 | +| 9 | 夜间行人横穿 | 多因素耦合 | 黑暗 + 行人 | +| 10 | 雾天鬼探头 | 多因素耦合 | 浓雾 + 盲区 | + +## 快速开始 + +```bash +# 1. 启动 CARLA 仿真器 +cd D:\hutb\hutb && CarlaUE4.exe + +# 2. 运行项目 +python main.py + +# 或命令行模式 +python main.py train --algo dqn --scenario rain_storm --episodes 500 +python main.py evaluate --algo smooth_ppo --scenario emergency_brake --model models/xxx.pth +python main.py export --scenario ghost_peek +python main.py test --suite all +``` + +## 环境要求 + +- Windows 10 / Ubuntu 18.04+ +- CARLA 0.9.16 (hutb 定制版) +- Python 3.7 +- PyTorch + NumPy + PyYAML + matplotlib + +## 百度网盘链接 +- 通过网盘分享的文件:carla +- 链接: https://pan.baidu.com/s/1PIzndyc4LrLxvKNImyH9CA?pwd=shju 提取码: shju \ No newline at end of file From 2e75ec05241a0c16c1af119948444bbdc11feb69 Mon Sep 17 00:00:00 2001 From: minghao-lee <1467864011@qq.com> Date: Mon, 18 May 2026 21:30:30 +0800 Subject: [PATCH 7/7] Delete critical/undergraduate/content/README.md --- critical/undergraduate/content/README.md | 67 ------------------------ 1 file changed, 67 deletions(-) delete mode 100644 critical/undergraduate/content/README.md diff --git a/critical/undergraduate/content/README.md b/critical/undergraduate/content/README.md deleted file mode 100644 index c298eb85..00000000 --- a/critical/undergraduate/content/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# 基于 CARLA 的极端驾驶仿真场景生成算法研究 -## 项目简介 - -研究并实现极端驾驶场景自动生成算法,定义 10 种典型危险驾驶场景,支持手动构建与强化学习(DQN / PPO 系列)自动生成对抗场景,输出标准 OpenSCENARIO (.xosc) 文件。 - -## 技术栈 - -- 仿真平台:hutb (CARLA 2.9.16) -- 语言:Python 3.7 -- 强化学习:DQN、Attention-DQN、PPO、Smooth-PPO -- 场景标准:ASAM OpenSCENARIO 1.2 - -## 项目结构 - -``` -├── config/ 全局固定参数 -├── env/ 仿真交互环境 + 通用奖励 -├── utils/ 工具函数(传感器/评估/几何) -├── scenarios/ 10 种危险场景定义 -├── rl_algorithms/ 强化学习算法 -├── experiments/ 训练/评估/对比入口 -├── osc_exporter/ OpenSCENARIO 导出 -├── tests/ 单元测试 -└── main.py 统一入口 -``` - -## 10 种危险场景 - -| # | 场景 | 类别 | 核心危险 | -|---|------|------|----------| -| 1 | 暴雨跟车 | 极端天气 | 湿滑路面 + 低能见度 | -| 2 | 浓雾巡航 | 极端天气 | 能见度 < 20m | -| 3 | 夜间黑暗行驶 | 极端天气 | 光照 5% | -| 4 | 前车急刹 | 车辆对抗 | 前车 -8m/s² 急刹 | -| 5 | 旁车加塞 | 车辆对抗 | 强行切入自车车道 | -| 6 | 行人横穿 | 行人危险 | 人行道突然横穿 | -| 7 | 鬼探头 | 行人危险 | 货车盲区突然冲出 | -| 8 | 行人闯红灯 | 行人危险 | 违规横穿 | -| 9 | 夜间行人横穿 | 多因素耦合 | 黑暗 + 行人 | -| 10 | 雾天鬼探头 | 多因素耦合 | 浓雾 + 盲区 | - -## 快速开始 - -```bash -# 1. 启动 CARLA 仿真器 -cd D:\hutb\hutb && CarlaUE4.exe - -# 2. 运行项目 -python main.py - -# 或命令行模式 -python main.py train --algo dqn --scenario rain_storm --episodes 500 -python main.py evaluate --algo smooth_ppo --scenario emergency_brake --model models/xxx.pth -python main.py export --scenario ghost_peek -python main.py test --suite all -``` - -## 环境要求 - -- Windows 10 / Ubuntu 18.04+ -- CARLA 0.9.16 (hutb 定制版) -- Python 3.7 -- PyTorch + NumPy + PyYAML + matplotlib - -## 百度网盘链接 -- 通过网盘分享的文件:carla -- 链接: https://pan.baidu.com/s/1PIzndyc4LrLxvKNImyH9CA?pwd=shju 提取码: shju \ No newline at end of file