How autonomousvision/navsim works
Based on our review of both the file tree and the README, NAVSIM is a data‐driven simulation and benchmarking tool for autonomous vehicles. Its purpose is to simulate simplified bird’s eye view scenes to compute meaningful evaluation metrics (like progress and time to collision) under a “non-reactive” or open-loop simulation setup. This system helps to benchmark end-to-end autonomous driving policies while keeping the simulation efficient and closely aligned with closed-loop conditions.
Major Components
• Agents and Policies:
– Represented by the “navsim/agents” and “navsim/traffic_agents_policies” directories.
– Include various agent implementations (e.g., ConstantVelocity, EgoStatusMLP, Human, Transfuser variants).
– Indicate how agent selection and behavior configurations are handled through YAML files in the configuration directories.
• Planning Engine:
– Found under “navsim/planning”. This component includes several submodules for scenario building, simulation, metric caching, training, and even a dedicated “pdm_planner” that handles scoring and simulation proposals.
– Highlight the “scenario_builder”, “simulation”, “training”, “metric_caching”, and “pdm_scoring” parts.
• Data and Common Utilities:
– The “navsim/common” folder encapsulates shared dataclasses, dataloader utilities, and enumerations.
– This component underpins configuration management (via “navsim/planning/script/config”) and helps interconnect many parts of the system.
• Evaluation and Benchmarking:
– Modules inside “navsim/evaluate” (like pdm_score) work on gathering metrics.
– Scripts in “scripts/evaluation” and “scripts/submission” orchestrate evaluation workflows and leaderboard submissions.
• Visualization:
– Managed under “navsim/visualization”, which includes modules to display BEV (bird’s eye view), camera views, LiDAR, and plotting functions.
• External/Operational Scripts and Deployment:
– The “scripts”, “download”, and configuration files (e.g., environment.yml, setup.py, GitHub workflows) support installation, data acquisition, and CI/CD.
– They represent the “glue” that enables the simulation, training, and evaluation to run in real-world scenarios.
Relationships and Interactions
• Data Flow – Illustrate how raw input data (from sensor logs or pre-downloaded datasets) enters the system via the dataloader (common utilities) and is preprocessed before being fed to the agent modules.
• Simulation-to-Evaluation – After simulating an episode, outputs (such as vehicle states, progress metrics, or collision indicators) are passed to the metric caching and evaluation modules for scoring (e.g., via PDM Score).
• Feedback for Training – For training purposes, there is a pipeline where simulation data is leveraged to train or validate models. This is defined through scripts and configurations under “navsim/planning/training” and related YAML files.
• Visualization Overlays – The visualization components take simulation outputs to render BEV images, camera views, or other plots that help interpret system behavior.
Architectural Patterns and Design Principles
• Modular Design – The system is clearly engineered to separate concerns: different modules for agents, planning, evaluation, and visualization.
• Configuration-Driven Architecture – With extensive use of YAML configuration files in “navsim/planning/script/config”, the system is highly flexible for parameter tuning and support of different simulation scenarios.
• Script-Oriented Orchestration – External scripts (in the “scripts” directory) are used to build, run, and deploy the pipelines. This reflects a design that supports both development and production environments.
• Extensibility – Each module (agent, planning, evaluation) is designed in a pluggable manner, which is evident by the abstract classes and multiple implementations found within the code structure.