Skip to content

Karthik-Ragunath/carla_sac

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CARLA-PPO-Algorithm

This github repository is aimed at research to perform end-to-end motion planning for Autonomous Driving based on PPO (and SAC) algorithms.

STEPS

  1. Create a conda environment and activate it
conda create -n carla_ppo python=3.8
conda activate carla_ppo
  1. Install pytorch
conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia
  1. Install other required packages after
pip install -r requirements.txt
  1. Download CARLA 0.9.13 package and start in port 2021 for training Refer - https://carla.readthedocs.io/en/latest/start_quickstart/#carla-0912

  2. Setup training and inference configs - Default configs provided in

env_config.py
  1. Start Training
python  carla_ppo_train.py --device_id <device_id> --img-stack <image_stack_dimension> \
        --log_seed <log_seed No.> --running_score <max reward to stop training> \
        --context <train_context_id> --num_steps_per_episode <number of steps per episode>

Example:

python  carla_ppo_train.py --device_id 0 --img-stack 30 \
        --log_seed 1 --running_score 30000 \
        --context train_1 --num_steps_per_episode 150
  1. Perform Inference
python  carla_ppo_inference.py --device_id <device_id> --img-stack <image_stack_dimension> \
        --log_seed <log_seed No.>  --context <train_context_id> \
        --num_steps_per_episode <number of steps per episode>

Example

python  carla_ppo_train.py --device_id 0 --img-stack 30 \
        --log_seed 1 --context train_1 \
        --num_steps_per_episode 150
  1. Generate Inference Videos
python util_video_visualization.py  --image_dir <image_dir where inference images are stored> \
      --fps <frames per second> --output_dir <inference video output directory>
python util_video_visualization.py  --image_dir visualization_inference_3/reward \
      --fps 10 --output_dir visualization_videos/reward

Example: Inference on model trained for 5 hrs on Zero Traffic Simulation

Sample Video Link

Sample Inference Videos

In CARLA Environment

visualization_inference_4_0.mov

In OpenAI Gym Environment

openai_env_trimmed.mp4

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published