[G1-Sync] Manual knowledge update
This commit is contained in:
@@ -2,61 +2,240 @@
|
||||
id: wiki-2026-0508-dynamic-environment-handling
|
||||
title: Dynamic Environment Handling
|
||||
category: 10_Wiki/Topics
|
||||
status: needs_review
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [P-Reinforce-AI-DYNAMIC-ENV]
|
||||
aliases: [dynamic environment, AV dynamic obstacles, MOT, scene flow, motion forecasting]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 0.96
|
||||
tags: [Dynamic Environment, Autonomous Driving, Adaptation, AI]
|
||||
confidence_score: 0.92
|
||||
verification_status: applied
|
||||
tags: [autonomous-driving, robotics, perception, motion-forecasting, mot, dynamic-objects]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-04-20
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
|
||||
tech_stack:
|
||||
language: Python / C++
|
||||
framework: Apollo / Autoware / NuScenes
|
||||
---
|
||||
|
||||
# [[Dynamic-Environment-Handling|Dynamic-Environment-Handling]] (동적 환경 대응)
|
||||
# Dynamic Environment Handling
|
||||
|
||||
## 📌 한 줄 통찰 (The Karpathy Summary)
|
||||
> "세상은 멈춰 있지 않다." 비, 눈, 안개, 갑자기 뛰어드는 아이처럼 끊임없이 변하는 현실 세계의 변덕에 실시간으로 적응하는 AI의 회복 탄력성이다.
|
||||
## 매 한 줄
|
||||
> **"매 static map 의 X — 매 moving object + 매 changing scene 의 reason"**. 매 autonomous driving 의 critical: 매 vehicle, pedestrian, cyclist, weather, occlusion. 매 modern: 매 transformer-based motion forecasting (Waymo MotionLM, Apollo).
|
||||
|
||||
## 📖 구조화된 지식 (Synthesized Content)
|
||||
- **Robust Perception**:
|
||||
- 센서 노이즈나 기상 악화 상황에서도 사물을 정확히 인식하는 강건한 시각 시스템.
|
||||
- **Real-time Path Planning**:
|
||||
- 장애물이 나타날 때마다 수 밀리초(ms) 이내에 새로운 안전 경로를 계산하는 기술.
|
||||
- **Domain Adaptation**:
|
||||
- 시뮬레이션 환경(Sim)과 실제 도로 환경(Real)의 차이를 메꾸어, 가상에서 배운 지식을 현실에서도 유효하게 만드는 전이 학습 기법.
|
||||
## 매 핵심
|
||||
|
||||
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
|
||||
- 모든 시나리오를 미리 학습시키는 것은 불가능하다. 최근에는 '세계 모델(World Model)'을 통해 AI가 물리 법칙을 이해하게 함으로써, 처음 보는 돌발 상황에서도 상식적인 수준의 대응을 하도록 유도하는 연구가 대세다.
|
||||
### 매 problem
|
||||
- **Static**: 매 building, lane.
|
||||
- **Dynamic**: 매 vehicle, pedestrian, weather, occlusion.
|
||||
- **Challenge**: 매 prediction + uncertainty.
|
||||
|
||||
## 🔗 지식 연결 (Graph)
|
||||
- Related: [[Autonomous-Vehicle-Path-Planning|Autonomous-Vehicle-Path-Planning]] , [[Reliability_Safety_First|Reliability_Safety_First]]
|
||||
- Foundation: Computational Thinking
|
||||
### 매 pipeline
|
||||
1. **Detection**: 매 3D bbox / pointcloud cluster.
|
||||
2. **Tracking** (MOT): 매 ID 의 frame 의 maintain.
|
||||
3. **Prediction**: 매 future trajectory.
|
||||
4. **Planning**: 매 prediction 의 incorporate.
|
||||
|
||||
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
|
||||
### 매 method
|
||||
- **Detection**: PointPillars, CenterPoint, BEVFusion.
|
||||
- **MOT**: SORT, DeepSORT, ByteTrack, JDE.
|
||||
- **Prediction**: VectorNet, MTR, MotionLM, Wayformer.
|
||||
- **Joint**: 매 perception + prediction unified.
|
||||
|
||||
**언제 이 지식을 쓰는가:**
|
||||
- *(TODO)*
|
||||
### 매 modern AI
|
||||
- **End-to-end**: 매 sensor → trajectory.
|
||||
- **Transformer**: 매 multi-agent attention.
|
||||
- **Diffusion forecasting**: 매 multi-modal future.
|
||||
- **Foundation model**: 매 driving simulator (DriveGPT).
|
||||
|
||||
**언제 쓰면 안 되는가:**
|
||||
- *(TODO)*
|
||||
### 매 응용
|
||||
1. **Autonomous driving**: 매 highway + urban.
|
||||
2. **Robotics**: 매 mobile robot.
|
||||
3. **Drone**: 매 obstacle avoid.
|
||||
4. **AR**: 매 dynamic occlusion.
|
||||
5. **Sports analytics**: 매 player tracking.
|
||||
|
||||
## 🧪 검증 상태 (Validation)
|
||||
## 💻 패턴
|
||||
|
||||
- **정보 상태:** needs_review
|
||||
- **출처 신뢰도:** A
|
||||
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
|
||||
### MOT (ByteTrack-style)
|
||||
```python
|
||||
class ByteTrack:
|
||||
def __init__(self, high_thresh=0.5, low_thresh=0.1):
|
||||
self.tracks = []
|
||||
self.high = high_thresh
|
||||
self.low = low_thresh
|
||||
|
||||
def update(self, detections):
|
||||
# 매 1. high-conf 의 match (Hungarian + IoU)
|
||||
high_dets = [d for d in detections if d.score > self.high]
|
||||
matched_high, unmatched_tracks = match_iou(self.tracks, high_dets)
|
||||
|
||||
# 매 2. unmatched track + low-conf det 의 match (recover)
|
||||
low_dets = [d for d in detections if self.low < d.score <= self.high]
|
||||
matched_low, _ = match_iou(unmatched_tracks, low_dets)
|
||||
|
||||
# 매 3. update + new track
|
||||
for t, d in matched_high + matched_low:
|
||||
t.update(d)
|
||||
for d in [d for d in high_dets if d not in matched]:
|
||||
self.tracks.append(Track(d))
|
||||
```
|
||||
|
||||
## 🧬 중복 검사 (Duplicate Check)
|
||||
### Kalman filter (track state)
|
||||
```python
|
||||
class TrackKF:
|
||||
def __init__(self, init_bbox):
|
||||
# 매 state: [x, y, vx, vy, w, h]
|
||||
self.x = np.array([*init_bbox.center, 0, 0, init_bbox.w, init_bbox.h])
|
||||
self.P = np.eye(6) * 10
|
||||
self.F = np.eye(6); self.F[0, 2] = self.F[1, 3] = 1 # 매 dt=1
|
||||
self.H = np.eye(4, 6)
|
||||
self.Q = np.eye(6) * 0.1
|
||||
self.R = np.eye(4) * 1
|
||||
|
||||
def predict(self):
|
||||
self.x = self.F @ self.x
|
||||
self.P = self.F @ self.P @ self.F.T + self.Q
|
||||
|
||||
def update(self, measurement):
|
||||
z = np.array([*measurement.center, measurement.w, measurement.h])
|
||||
y = z - self.H @ self.x
|
||||
S = self.H @ self.P @ self.H.T + self.R
|
||||
K = self.P @ self.H.T @ np.linalg.inv(S)
|
||||
self.x += K @ y
|
||||
self.P = (np.eye(6) - K @ self.H) @ self.P
|
||||
```
|
||||
|
||||
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
|
||||
- **처리 방식:** UPDATE (자동 정규화)
|
||||
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
|
||||
### Motion forecasting (Vector-style)
|
||||
```python
|
||||
class MotionPredictor(nn.Module):
|
||||
"""매 simplified VectorNet."""
|
||||
def __init__(self, hidden=64):
|
||||
super().__init__()
|
||||
self.poly_enc = nn.Linear(6, hidden) # 매 polyline encoder
|
||||
self.attn = nn.MultiheadAttention(hidden, 4)
|
||||
self.decoder = nn.Linear(hidden, 60) # 매 30 timesteps × (x,y)
|
||||
|
||||
def forward(self, polylines):
|
||||
# 매 polylines: [B, N, T, 6] (x, y, vx, vy, type, idx)
|
||||
B, N, T, _ = polylines.shape
|
||||
feats = self.poly_enc(polylines).max(dim=2).values # 매 [B, N, hidden]
|
||||
attn_out, _ = self.attn(feats, feats, feats)
|
||||
ego_feat = attn_out[:, 0] # 매 ego 의 first
|
||||
return self.decoder(ego_feat).reshape(B, 30, 2)
|
||||
```
|
||||
|
||||
## 🕓 변경 이력 (Changelog)
|
||||
### Multi-modal prediction (Gaussian mixture)
|
||||
```python
|
||||
class MultiModalPredictor(nn.Module):
|
||||
def __init__(self, K=6, T=30):
|
||||
super().__init__()
|
||||
self.K = K
|
||||
self.head_mean = nn.Linear(64, K * T * 2)
|
||||
self.head_var = nn.Linear(64, K * T * 2)
|
||||
self.head_pi = nn.Linear(64, K)
|
||||
|
||||
def forward(self, feat):
|
||||
means = self.head_mean(feat).reshape(-1, self.K, 30, 2)
|
||||
vars = self.head_var(feat).exp().reshape(-1, self.K, 30, 2)
|
||||
pi = self.head_pi(feat).softmax(-1)
|
||||
return means, vars, pi
|
||||
```
|
||||
|
||||
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|
||||
|------|-----------|-----------|--------|
|
||||
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
|
||||
### Risk-aware planning
|
||||
```python
|
||||
def safe_speed(predicted_trajectories, ego_path, dt=0.1):
|
||||
"""매 prediction 의 risk 의 minimum 의 follow."""
|
||||
min_safe_v = float('inf')
|
||||
for t in range(30):
|
||||
for traj in predicted_trajectories:
|
||||
if intersects(ego_path[t], traj[t], radius=2.0):
|
||||
tt = t * dt
|
||||
if tt > 0:
|
||||
min_safe_v = min(min_safe_v, ego_path[t].dist / tt)
|
||||
return min_safe_v
|
||||
```
|
||||
|
||||
### Occlusion handling
|
||||
```python
|
||||
def handle_occlusion(tracks, current_dets, max_age=10):
|
||||
for t in tracks:
|
||||
if not t.matched:
|
||||
t.age += 1
|
||||
if t.age > max_age:
|
||||
t.delete()
|
||||
else:
|
||||
# 매 predict-only mode
|
||||
t.kf.predict()
|
||||
t.is_visible = False
|
||||
return [t for t in tracks if not t.deleted]
|
||||
```
|
||||
|
||||
### Weather degradation handling
|
||||
```python
|
||||
def adapt_to_weather(sensor_data, weather):
|
||||
if weather == 'rain':
|
||||
# 매 lidar noise ↑ → 매 detection threshold ↑
|
||||
return {'detection_threshold': 0.7, 'fusion_weight_camera': 0.3}
|
||||
elif weather == 'fog':
|
||||
# 매 camera 의 unreliable
|
||||
return {'detection_threshold': 0.6, 'fusion_weight_camera': 0.1}
|
||||
return {'detection_threshold': 0.5, 'fusion_weight_camera': 0.5}
|
||||
```
|
||||
|
||||
### CARLA simulation (test rig)
|
||||
```python
|
||||
import carla
|
||||
client = carla.Client('localhost', 2000)
|
||||
world = client.get_world()
|
||||
settings = world.get_settings()
|
||||
settings.synchronous_mode = True
|
||||
settings.fixed_delta_seconds = 0.05
|
||||
world.apply_settings(settings)
|
||||
|
||||
# 매 spawn dynamic actors
|
||||
for spawn_point in world.get_map().get_spawn_points()[:50]:
|
||||
bp = world.get_blueprint_library().find('vehicle.tesla.model3')
|
||||
actor = world.try_spawn_actor(bp, spawn_point)
|
||||
if actor: actor.set_autopilot(True)
|
||||
```
|
||||
|
||||
## 매 결정 기준
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| Highway | Long-horizon (5s) prediction |
|
||||
| Urban | Multi-agent + intent |
|
||||
| Pedestrian | Short-horizon, multi-modal |
|
||||
| Heavy occlusion | Long max_age, predict-only |
|
||||
| Adverse weather | Sensor fusion reweight |
|
||||
| Real-time | <100ms latency budget |
|
||||
|
||||
**기본값**: 매 BEV detection + ByteTrack + transformer multi-modal predict + risk-aware plan.
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[Autonomous-Driving]] · [[Robotics-Perception]]
|
||||
- 변형: [[Multi-Object-Tracking]] · [[Motion-Forecasting]] · [[Behavior-Prediction]]
|
||||
- 응용: [[Apollo]] · [[Autoware]] · [[CARLA]]
|
||||
- Adjacent: [[BEV-Perception]] · [[End-to-End-Driving]] · [[Diffusion-Forecasting]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: 매 AV planning. 매 robot mobile. 매 dynamic scene.
|
||||
**언제 X**: 매 static map only. 매 stationary robot.
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **Single-modal predict**: 매 future 의 multi modes 의 ignore.
|
||||
- **Track without filter**: 매 noise.
|
||||
- **Fixed weather config**: 매 degradation 의 adapt X.
|
||||
- **Detection without ID**: 매 association 의 lose.
|
||||
- **No occlusion handling**: 매 ghost track.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (NuScenes, Waymo Open, MOTChallenge).
|
||||
- 신뢰도 A.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-04-20 | Auto-reinforced |
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — MOT + prediction + 매 ByteTrack / KF / VectorNet / risk plan code |
|
||||
|
||||
Reference in New Issue
Block a user