Carla-ppo  by bitsauce

PPO agent for autonomous driving in CARLA simulator

created 6 years ago
250 stars

Top 100.0% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a framework for training deep reinforcement learning agents for autonomous driving in the CARLA simulator. It targets researchers and developers looking to experiment with RL-based driving agents, offering a gym-like environment with custom reward functions and analysis tools for faster iteration and hypothesis testing.

How It Works

The core approach involves training a Variational Autoencoder (VAE) to reconstruct semantic segmentation maps, which are then used to encode the CARLA environment's state. This encoded representation, combined with vehicle measurements (steering, throttle, speed), serves as input to a Proximal Policy Optimization (PPO) agent. This VAE-based state representation is claimed to significantly improve RL agent performance compared to using raw RGB input.

Quick Start & Requirements

  • Install: Requires CARLA 0.9.5 (or later), TensorFlow 1.13 (or later), OpenAI gym 0.12.0, and OpenCV 4.0.0.
  • Hardware: A GPU with at least 4 GB VRAM is recommended.
  • CARLA Setup: CARLA 0.9.5 needs to be built with make package, potentially including Town07 map.
  • Running:
    • Evaluate pretrained agent: python run_eval.py --model_name pretrained_agent -start_carla
    • Train new agent: python train.py --model_name name_of_your_model -start_carla
  • Links: Project write-up, Video of results (timestamp navigation recommended).

Highlighted Details

  • Offers two gym-like environments: CarlaLapEnv for lap following and CarlaRouteEnv for point-to-point navigation.
  • Provides analysis of optimal PPO parameters, environment designs, and reward functions.
  • Claims a trained agent can solve a lap environment in ~8 hours on a GTX 970.
  • Includes scripts for training VAEs, inspecting VAE reconstructions, and analyzing agent behavior in latent space.

Maintenance & Community

The project appears to be a master's thesis project from NTNU, with the primary author listed as Marcus Loo Vergara. No active community channels or ongoing maintenance efforts are explicitly mentioned in the README.

Licensing & Compatibility

The README does not explicitly state a license. The code uses TensorFlow and OpenAI Gym, which have permissive licenses. However, the CARLA simulator itself has its own licensing terms.

Limitations & Caveats

The environment is not strictly deterministic, even in synchronous mode. The environment implementation does not strictly adhere to OpenAI gym standards, requiring modifications for direct use with standard gym algorithms. The project is primarily focused on CARLA version 0.9.5 and the Town07 map.

Health Check
Last commit

3 years ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
5 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Mckay Wrigley Mckay Wrigley(Founder of Takeoff AI), and
1 more.

street-fighter-ai by linyiLYi

0.1%
6k
AI agent for Street Fighter II using deep reinforcement learning
created 2 years ago
updated 1 year ago
Feedback? Help us improve.