Learn to drive in TORCS from expert example.
- Install anaconda python3 (https://www.anaconda.com/download/#linux)
- clone this repo.
- cd into the gym-torcs directory.
- create a virtual environment with Conda, Anaconda's CLI tool:
conda env create -f environment.yml -n sdcc
. If you get an error at the end, don't worry about it. (TODO: FIX) - activate the environment
source activate sdcc
- install remaining packages through pip
pip install -r requirements.txt
- x-automation7:
sudo apt install xautomation
- other dependencies:
sudo apt install libglib2.0-dev libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev libplib-dev libopenal-dev libalut-dev libxi-dev libxmu-dev libxrender-dev libxrandr-dev libpng12-dev ffmpeg
- cd into gym-torcs/vtorcs-RL-color
./configure
make
sudo make install
sudo make datainstall
- Go back up a directory (to gym-torcs).
- Configure permissions with
sudo ./configure_permissions
- cd to gym-torcs directory
-
python snakeoil3_gym.py
- That will record images in to
./databases/<track>/<trial>/imgs
directory. - To make images into a movie, use fmpeg on the directory:
Ffmpeg -i <path>/imgs/%05d.png video.webm
- be in gym-torcs directory.
- assumes you have already recorded some data somewhere.
python main.py -d ./databases/<track>/<trial>