MCPcopy Index your code
hub / github.com/OpenDriveLab/TCP

github.com/OpenDriveLab/TCP @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
1,512 symbols 4,841 edges 140 files 983 documented · 65%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

[!IMPORTANT] 🌟 Stay up to date at opendrivelab.com!

TCP - Trajectory-guided Control Prediction for End-to-end Autonomous Driving: A Simple yet Strong Baseline

teaser

Trajectory-guided Control Prediction for End-to-end Autonomous Driving: A Simple yet Strong Baseline
Penghao Wu*, Xiaosong Jia*, Li Chen*, Junchi Yan, Hongyang Li, Yu Qiao
- arXiv Paper, NeurIPS 2022 - Blog in Chinese

PWC

This repository contains the code for the paper Trajectory-guided Control Prediction for End-to-end Autonomous Driving: A Simple yet Strong Baseline.

TCP is a simple unified framework to combine trajectory and control prediction for end-to-end autonomous driving. By time of release in June 17 2022, our method achieves new state-of-the-art on CARLA AD Leaderboard, in which we rank the first in terms of the Driving Score and Infraction Penalty using only a single camera as input.

Setup

Download and setup CARLA 0.9.10.1

mkdir carla
cd carla
wget https://carla-releases.s3.eu-west-3.amazonaws.com/Linux/CARLA_0.9.10.1.tar.gz
wget https://carla-releases.s3.eu-west-3.amazonaws.com/Linux/AdditionalMaps_0.9.10.1.tar.gz
tar -xf CARLA_0.9.10.1.tar.gz
tar -xf AdditionalMaps_0.9.10.1.tar.gz
rm CARLA_0.9.10.1.tar.gz
rm AdditionalMaps_0.9.10.1.tar.gz
cd ..

Clone this repo and build the environment

git clone https://github.com/OpenPerceptionX/TCP.git
cd TCP
conda env create -f environment.yml --name TCP
conda activate TCP
export PYTHONPATH=$PYTHONPATH:PATH_TO_TCP

Dataset

Download our dataset through Huggingface (combine the part with command cat tcp_carla_data_part_* > tcp_carla_data.zip) or GoogleDrive or BaiduYun (提取码 8174). The total size of our dataset is around 115G, make sure you have enough space.

Training

First, set the dataset path in TCP/config.py. Training:

python TCP/train.py --gpus NUM_OF_GPUS

Data Generation

First, launch the carla server,

cd CARLA_ROOT
./CarlaUE4.sh --world-port=2000 -opengl

Set the carla path, routes file, scenario file, and data path for data generation in leaderboard/scripts/data_collection.sh.

Start data collection

sh leaderboard/scripts/data_collection.sh

After the data collecting process, run tools/filter_data.py and tools/gen_data.py to filter out invalid data and pack the data for training.

Evaluation

First, launch the carla server,

cd CARLA_ROOT
./CarlaUE4.sh --world-port=2000 -opengl

Set the carla path, routes file, scenario file, model ckpt, and data path for evaluation in leaderboard/scripts/run_evaluation.sh.

Start the evaluation

sh leaderboard/scripts/run_evaluation.sh

Citation

If you find our repo or our paper useful, please use the following citation:

@inproceedings{wu2022trajectoryguided,
 title={Trajectory-guided Control Prediction for End-to-end Autonomous Driving: A Simple yet Strong Baseline}, 
 author={Penghao Wu and Xiaosong Jia and Li Chen and Junchi Yan and Hongyang Li and Yu Qiao},
 booktitle={NeurIPS},
 year={2022},
}

License

All code within this repository is under Apache License 2.0.

Acknowledgements

Our code is based on several repositories: - Transfuser - Roach - CARLA Leaderboard - Scenario Runner

Core symbols most depended-on inside this repo

get
called by 206
roach/models/ppo_buffer.py
get_location
called by 123
scenario_runner/srunner/scenariomanager/carla_data_provider.py
get_transform
called by 101
scenario_runner/srunner/scenariomanager/carla_data_provider.py
get_map
called by 91
scenario_runner/srunner/scenariomanager/carla_data_provider.py
distance
called by 62
scenario_runner/no_rendering_mode.py
get_world
called by 55
scenario_runner/srunner/scenariomanager/carla_data_provider.py
get_velocity
called by 49
scenario_runner/srunner/scenariomanager/carla_data_provider.py
get_time
called by 47
scenario_runner/srunner/scenariomanager/timer.py

Shape

Method 1,132
Class 231
Function 149

Languages

Python100%

Modules by API surface

scenario_runner/srunner/scenariomanager/scenarioatomics/atomic_behaviors.py128 symbols
scenario_runner/no_rendering_mode.py84 symbols
scenario_runner/srunner/scenariomanager/scenarioatomics/atomic_criteria.py81 symbols
scenario_runner/srunner/scenariomanager/scenarioatomics/atomic_trigger_conditions.py76 symbols
scenario_runner/srunner/scenariomanager/carla_data_provider.py42 symbols
scenario_runner/srunner/metrics/tools/metrics_log.py39 symbols
leaderboard/leaderboard/envs/sensor_interface.py35 symbols
roach/models/distributions.py30 symbols
leaderboard/team_code/base_agent.py30 symbols
leaderboard/team_code/roach_ap_agent.py28 symbols
leaderboard/leaderboard/scenarios/route_scenario.py23 symbols
TCP/resnet.py23 symbols

For agents

$ claude mcp add TCP \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact