lewisKit / txt_torcs

Gym Torcs that supports multi instances training and text mode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

txt_torcs

This repository incorporates serval common issues in the original gym_torcs repository, including:

  • Support Text Mode training in practice mode #48;
  • Support running multiple gym_torcs experiments on the same machine #27;
  • Upgrade torcs to the latest version;
  • Display the car in the screen #7;
  • Support training different tracks. The supported tracks can be found in TORCS.

Examples of PPO

A simple example of using PPO to train torcs:

python run_torcs.py --road_type g-track-1*road

Examples of gym_torcs

from multigym_torcs import TorcsEnv

# each TorcsEnv object should be associated with a different port in the same machine
# text_model=False will require a window to display
env = TorcsEnv(vision=False, throttle=True, gear_change=False, \
               trackname='street-1*road', port=3102, text_mode=True) 
env.reset()
env.step(env.action_space.sample())

road_type or trackname in TorcsEnv consists of road_name and category name which are concatenated by *.

For exmaple:

g-speedway*oval

Road and category names can be found in TORCS.

DISPLAY VISION on the remote server

If you want to run experiments and use vision mode on a remote server, personally I recommend to use VirtualGL and TurboVNC. The setup files can be find here.

Issue

Currently I only test for sensor based training, not on image-based training like original gym_torcs.

Please raise a issue if there is any bug or problem.

About

Gym Torcs that supports multi instances training and text mode


Languages

Language:C++ 48.9%Language:C 16.0%Language:Java 11.1%Language:HTML 9.3%Language:Makefile 4.6%Language:Batchfile 4.6%Language:TeX 2.0%Language:NSIS 1.5%Language:Shell 1.0%Language:Python 0.5%Language:XSLT 0.2%Language:Roff 0.1%Language:M4 0.1%Language:CSS 0.0%Language:JavaScript 0.0%