How mczhi/dtpp works
Main Components
• Data Processing & Ingestion:
• “data_process.py” module along with “data_utils.py” and “data_process.py”. These scripts process the raw nuPlan dataset (NuScenes-like) and maps, preparing the data for both training and testing.
• Data input points (e.g., paths to nuPlan dataset & maps as documented in the README).
• Model Training:
• “train.py” and “train_utils.py”, which handle the training of the DTPP model using PyTorch.
• Loading or saving of the pre-trained model (base_model.pth).
• Prediction and Planning Subsystems:
• Modules such as “planner.py”, “planner_utils.py”, “path_planner.py”, “trajectory_tree_planner.py”, “scenario_tree_prediction.py”, and “prediction_modules.py”. These components:
° Handle the tree-based planning logic and prediction function.
° Include optimization or evaluation strategies (joint conditional prediction and cost evaluation).
• Specialized modules like “spline_planner.py” and “bezier_path.py” for generating and smoothing trajectories.
• Observation Processing:
• “obs_adapter.py”, which likely serves as an adapter for fusing sensor data or external observations into the planning workflow.
• Common and Utility Functions:
• “common_utils.py” as responsible for shared utilities used throughout the project.
• Testing and Simulation:
• “test.py” and include “test_scenario.yaml” for testing the planning framework, particularly in nuPlan simulation scenarios.
External Dependencies and Environment Setup
• The nuPlan dataset and devkit (external dependency modules) which feed into the data processing and testing modules.
• The use of PyTorch (with version specifics) which is central in the training and inference pipeline.
• Environment variables (e.g., NUPLAN_EXP_ROOT) can be annotated in a “Configuration/Environment” section.
• Data flow from the nuPlan dataset/maps into the Data Processing module.
• Processed data moving into the Training module, where the PyTorch-based DTPP model is trained.
• The trained model (stored as base_model.pth) being utilized by the Prediction and Planning modules.
• Data flow from these modules into the Testing/Simulation module, which interacts with nuPlan scenarios.
Architectural Patterns
• Modular Decomposition:
• Distinct modules (data, training, planning, prediction) to clearly delineate responsibilities.
• Integration with External Systems:
• Separate components that interface with the nuPlan devkit and dataset.
• End-to-End Pipeline:
Putting It All Together
° Input Data (nuPlan dataset, map files) → Data Processing modules → Training module (with PyTorch and environment setup) → Model storage (base_model.pth) → Prediction & Planning modules (including separate nodes for bezier path, spline, and tree-based planning) → Testing and simulation scenarios.