How aise-cps-research/teach-to-crash-paper-package works
This repository is a CARLA-based research harness for generating, mutating, executing, and evaluating safety-critical driving scenarios. The main workflow iteratively asks a Student/Teacher LLM pair for scenario changes, runs them in CARLA, and records safety outcomes; separate batch-search and ChatScene-to-PAFOT paths provide non-LLM search and prompt-driven scenario generation. The README documents the major flows and shared modules; sampled source is partial, so some internal links are omitted where ownership is not established.
Main entry points: teach_to_crash.py Teach-to-Crash Loop · tests.py Batch Search Runner · run_chatscene_scenarios.py ChatScene Replay · generate_scenarios_chatscene.py PAFOT Conversion
Components 20
LLM Scenario Search
- Teach-to-Crash Loop
teach_to_crash.py - Scenario Candidates
Simulation and Metrics
- Ego Vehicle
ego.py - Safety Evaluation
liability.py - Simulation Utilities
utility.py - Single Scenario Replay
run_scenario.py - Run Results
Batch PAFOT Search
- Batch Search Runner
tests.py - Genetic Mutator
mutator.py
ChatScene Replication
- Prompt Generation
chatscene_replication/generate_chatscene_descriptions.py - PAFOT Conversion
chatscene_replication/generate_scenarios_chatscene.py - Bundled PAFOT
chatscene_replication/pafot - ChatScene Replay
chatscene_replication/run_chatscene_scenarios.py
API and Navigation
- Student/Teacher API
student_teacher_api.py - Driving Agents
agents/navigation/basic_agent.py - PID Control
agents/navigation/controller.py
Other components
- Researcher
- OpenAI Models
- CARLA Simulator
- ChatScene
Connections 30
- Researcher → Teach-to-Crash Loop: starts loop
- Teach-to-Crash Loop → Student/Teacher API: requests prompts
- Student/Teacher API → OpenAI Models: forwards prompts
- OpenAI Models → Student/Teacher API: returns responses
- Student/Teacher API → Teach-to-Crash Loop: returns guidance
- Teach-to-Crash Loop → Scenario Candidates: generates candidates
- Teach-to-Crash Loop → CARLA Simulator: runs scenarios
- Teach-to-Crash Loop → Safety Evaluation: evaluates safety
- Teach-to-Crash Loop → Ego Vehicle: controls ego
- Teach-to-Crash Loop → Run Results: records metrics
- Researcher → Batch Search Runner: starts search
- Batch Search Runner → Genetic Mutator: mutates candidates
- Batch Search Runner → Safety Evaluation: evaluates scenarios
- Batch Search Runner → CARLA Simulator: simulates scenarios
- Batch Search Runner → Run Results: writes results
- Researcher → Single Scenario Replay: starts replay
- Single Scenario Replay → CARLA Simulator: runs scenario
- Single Scenario Replay → Safety Evaluation: measures safety
- Prompt Generation → ChatScene: requests descriptions
- ChatScene → Prompt Generation: returns prompts
- Prompt Generation → PAFOT Conversion: provides descriptions
- PAFOT Conversion → ChatScene: requests plans
- ChatScene → PAFOT Conversion: returns plans
- PAFOT Conversion → Bundled PAFOT: formats scenarios
- Researcher → ChatScene Replay: starts replay
- ChatScene Replay → Bundled PAFOT: loads scenarios
- ChatScene Replay → CARLA Simulator: runs scenarios
- ChatScene Replay → Safety Evaluation: measures safety
- Driving Agents → PID Control: computes control
- PID Control → CARLA Simulator: applies vehicle control