Skip to main content

BeamNG.gym is a collection of Gymnasium environments that cover various driving tasks simulated in BeamNG.research.

Project description

BeamNG.gym

BeamNG.gym is a collection of Gymnasium environments that cover various driving tasks simulated in BeamNG.tech.

Installation

Standard pip can be used to obtain the package of environments:

pip install beamng.gym

Or install the version from source by:

git clone https://github.com/BeamNG/BeamNG.gym.git
cd BeamNG.gym
pip install --editable .

A copy of BeamNG.tech is also required to actually run the scenario. The basic version is freely available for academic non-commercial use.

This version is compatible with BeamNG.tech 0.30 and BeamNGpy 1.27.

Configuration

The environments assume an envirionment variable to be set that specifies where BeamNG.tech has been installed to. After obtaining a copy, set an environment variable called BNG_HOME that contains the path to your local installation's main directory -- the same that contains the EULA.pdf file.

Usage

BeamNG.gym registers the environments with the OpenAI Gym registry, so after the initial setup, the environments can be created using the factory method and the respective environment's ID. For example:

from random import uniform

import gymnasium as gym
import beamnggym

env = gym.make('BNG-WCA-Race-Geometry-v0')
env.reset()
total_reward, done = 0, False
# Drive around randomly until finishing
while not done:
    obs, reward, done, aux = env.step((uniform(-1, 1), uniform(-1, 1)))
    total_reward += reward
print('Achieved reward:', total_reward)
...

Environments

Currently, the only environment is a time attack on the race track in the West Coast USA level of BeamNG.drive. New environments are being developed.

WCA Race

In this setting, the car spawns at the starting line of the race track in West Coast USA and has to race one lap. A detailled description of the observation and actions can be found in the documentation of the respective class WCARaceGeometry.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

BeamNG.gym-0.2.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

BeamNG.gym-0.2-py2.py3-none-any.whl (7.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file BeamNG.gym-0.2.tar.gz.

File metadata

  • Download URL: BeamNG.gym-0.2.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.15

File hashes

Hashes for BeamNG.gym-0.2.tar.gz
Algorithm Hash digest
SHA256 03e52563165818fac4564a51fa5bb13efbcf0761ad8b7a74829aa31b506eba95
MD5 718204da38b25d4b69cc9a75d9919e53
BLAKE2b-256 b7703ed6143f884951267735db10f79a4f0370e42687153e8ef8d6878b6a74cb

See more details on using hashes here.

File details

Details for the file BeamNG.gym-0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: BeamNG.gym-0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.15

File hashes

Hashes for BeamNG.gym-0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9d07195e286db215f616cd4b7ec2a1940d731edec6a23441b8ca84b20ecec0c2
MD5 1fb31e21e82264ed24a02f3b508f36e2
BLAKE2b-256 43403a546294d8eee08f30ebd72f816ffc40f5b935456a9a4d76f0e7bcd72bdc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page