gym_torcs  by ugo-nama-kun

RL environment for TORCS, an open-source car racing simulator

created 9 years ago
414 stars

Top 71.8% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides a Python wrapper for the TORCS (The Open Racing Car Simulator) game, offering an OpenAI-Gym-like interface for reinforcement learning experiments. It targets researchers and developers working on autonomous driving and car racing AI, enabling them to train agents within a realistic simulation environment.

How It Works

The environment wraps the TORCS simulator, allowing RL agents to interact with it through a standardized API. It leverages the snakeoil Python client for TORCS and a modified vtorcs fork. A key design choice addresses a known TORCS memory leak bug by automatically relaunching and reconfiguring the simulator during environment resets, ensuring stability for extended training sessions.

Quick Start & Requirements

  • Install via pip (assuming the package is published, otherwise manual installation from source).
  • Prerequisites: Python 3, xautomation, OpenAI-Gym, NumPy, and vtorcs-RL-color (requires separate installation).
  • Assumed OS: Ubuntu 14.04 LTS/16.04 LTS.
  • Vision input requires specific TORCS configuration for 64x64 resolution.
  • Official TORCS documentation: https://arxiv.org/pdf/1304.1672.pdf

Highlighted Details

  • Supports both vision-based (steering only) and sensor-based (steering and throttle) action spaces.
  • Includes example code for agent implementation and experimentation.
  • Can optionally add noise to low-dimensional sensor inputs for robustness testing.
  • Previously utilized in a DDPG experiment with Keras.

Maintenance & Community

  • Developed during a 2016 internship at Preferred Networks.
  • No explicit links to community channels or active development status are provided in the README.

Licensing & Compatibility

  • The README does not explicitly state a license. The underlying dependencies (vtorcs, snakeoil) may have their own licenses.
  • Compatibility with commercial or closed-source applications is not specified.

Limitations & Caveats

The implementation is currently limited to single-track races in practice mode. Support for other racing modes or multiple tracks requires manual modification of TORCS configuration files. The vision input is restricted to a 64x64 resolution. The project's reliance on older Ubuntu versions and specific TORCS forks might pose compatibility challenges.

Health Check
Last commit

7 years ago

Responsiveness

Inactive

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

Explore Similar Projects

Feedback? Help us improve.