Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/gallery.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ title: 效果展示
![鬼探头](img/scenario_occluded_crossing.gif)
<div align="center"><i>occluded_crossing(鬼探头)播放 6 秒:自车制动停止,行人从遮挡车尾横穿(红圈为行人,12 帧,0.5 秒/帧;底部为口语输入与命中模板)</i></div>

![运行指标](img/scenario_run_metrics.gif)
<div align="center"><i>运行危险度指标:右上角实时显示自车速度、与行人距离与 TTC,末帧汇总碰撞/最小中心距/最小 TTC/最大减速度/末速</i></div>

## 2. 路网布局

![路网布局轮播](https://openhutb.github.io/mcp/img/road_layouts.gif)
Expand Down
Binary file added docs/img/scenario_run_metrics.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions docs/new-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,58 @@ title: New Features

---

## 2026-11 · 运行危险度指标

场景回放此前只给截图和事件,能看出“发生了什么”,但看不出“危险到什么程度”。
本版让播放器在结束时汇总五项指标,`summarize()` 与 `run_scenario_in_carla`
直接给出:

```text
危险度指标:
碰撞:无
最小中心距 3.80 m(t=5.65s,crosser)
最小 TTC 1.41 s(t=2.65s,crosser)
最大减速度 5.78 m/s²(t=3.65s)
自车末速 0.04 m/s(已停止)
```

### 1. 指标口径

| 指标 | 口径 | 用途 |
|---|---|---|
| 碰撞 | 自车碰撞传感器上报,同一实体只记首次接触 | 判定是否发生事故 |
| 最小中心距 | 自车与其余实体的最小中心距离 | 衡量最近接近程度 |
| 最小 TTC | 只统计自车前方实体:纵向距离 / 接近速度 | 纵向冲突的紧迫度 |
| 最大减速度 | 帧间速度差,排除碰撞瞬间的跳变(>20 m/s²) | 制动强度 |
| 自车末速 | 结束时的速度,并给出是否已停止 | 场景是否收敛 |

### 2. 实现说明

- 碰撞用 `sensor.other.collision` 挂在自车上,回调时间取当前播放时刻;
同一次接触会连续多帧上报,按实体去重
- 其余指标逐帧求值取全程极值。TTC 只对自车前方(纵向投影 > 0)且
接近速度 > 0.5 m/s 的实体计算,横穿目标按其纵向距离计
- 结果放在 `play()` 返回值的 `metrics` 字段,`summarize()` 负责排版,
MCP 工具层无需改动

### 3. 效果

![运行指标](img/scenario_run_metrics.gif)
<div align="center"><i>occluded_crossing:右上角实时显示自车速度、与行人的距离和 TTC,末帧汇总本次运行指标</i></div>

### 4. 实测结果

| 场景 | 结果 |
|---|---|
| `occluded_crossing` | 无碰撞,最小中心距 3.80 m,最小 TTC 1.41 s,最大减速度 5.78 m/s² |
| `cut_in_then_brake` | t=7.35 s 与 `cutter` 碰撞,最小 TTC 0.43 s |

### 5. 注意事项

- 最小中心距是质心距离,不是车身间隙;行人等小目标建议结合画面判断
- 无导航网格的生成路网里,行人被撞后会被推开,指标仍记录首次接触

---
## 2026-11 · 鬼探头场景与行人驱动

本版新增 `occluded_crossing` 模板(鬼探头),并修复横穿类场景的两个问题:
Expand Down
Loading