Package: pgdrive
PGDrive: an open-ended driving simulator with infinite scenes[  📺Website| 🏗Github Repo| 📜Documentation| 🎓Paper]Welcome to PGDrive! PGDrive is an driving simulator with many key features, including:🎏Lightweight: Extremely easy to download, install and run in almost all platforms.📷Realistic: Accurate physics simulation and multiple sensory inputs.🚀Efficient: Up to 500 simulation step per second and easy to parallel.🗺Open-ended: Support generating infinite scenes and configuring various traffic, vehicle, and environmental settings.🛠 Quick StartPlease install PGDrive via:pipinstallpgdriveIf you wish to contribute to this project or make some modification, you can clone the latest version of PGDrive locally and install via:gitclonehttps://github.com/decisionforce/pgdrive.gitcdpgdrive
pipinstall-e.You can verify the installation and efficiency of PGDrive via running:python-mpgdrive.examples.profile_pgdriveThe above script is supposed to be runnable in all places.
Note that please do not run the above command in the folder that has a sub-folder called./pgdrive.🚕 ExamplesPlease run the following line to drive the car in the environment manually with keyboard!python-mpgdrive.examples.enjoy_manualYou can also enjoy a journey carrying out by our professional driver pretrained from reinforcement learning!python-mpgdrive.examples.enjoy_expertA fusion of expert and manual controller,
where the expect will try to rescue the manually controlled vehicle from danger,
can be experienced via:python-mpgdrive.examples.enjoy_saverTo show the main feature, procedural generation, we provide a script to show BIG:python-mpgdrive.examples.render_bigNote that the above three scripts can not be run in headless machine.Please refer to the installation guideline in documentation for more information.Running the following line allows you to draw the generated maps:python-mpgdrive.examples.draw_mapsTo build the environment in python script, you can simply run:importpgdrive# Import this package to register the environment!importgymenv=gym.make("PGDrive-v0",config=dict(use_render=True))# env = pgdrive.PGDriveEnv(config=dict(environment_num=100))  # Or build environment from classenv.reset()foriinrange(1000):obs,reward,done,info=env.step(env.action_space.sample())# Use random policyenv.render()ifdone:env.reset()env.close()We also prepare a Colab which demonstrates some basic usage of PGDrive as follows:📦 Predefined environment setsWe also define several Gym environment names, so user can start training in the minimalist manner:importgymimportpgdrive# Register the environmentenv=gym.make("PGDrive-v0")The following table presents some predefined environment names.Gym Environment NameRandom Seed RangeNumber of MapsCommentsPGDrive-test-v0[0, 200)200Test set, not change for all experiments.PGDrive-validation-v0[200, 1000)800Validation set.PGDrive-v0[1000, 1100)100Default training setting, for quick start.PGDrive-10envs-v0[1000, 1100)10Training environment with 10 maps.PGDrive-1000envs-v0[1000, 1100)1000Training environment with 1000 maps.PGDrive-training0-v0[3000, 4000)1000First set of 1000 environments.PGDrive-training1-v0[5000, 6000)1000Second set of 1000 environments.PGDrive-training2-v0[7000, 8000)1000Thirds set of 1000 environments....More map set can be added in response to the requests🏫 DocumentationsMore information about PGDrive can be found inPGDrive Documentation.
Besides, the training code of ourpapercan be found inthis repo.📎 CitationIf you find this work useful in your project, please consider to cite it through:@article{li2020improving,
  title={Improving the Generalization of End-to-End Driving through Procedural Generation},
  author={Li, Quanyi and Peng, Zhenghao and Zhang, Qihang and Qiu, Cong and Liu, Chunxiao and Zhou, Bolei},
  journal={arXiv preprint arXiv:2012.13681},
  year={2020}
}