Skip to main content

Gym Environments and Agents for Autonomous Driving

Project description

Gym Environments and Agents for Autonomous Driving

CI Build Github Contributors Downloads Python Versions Package Versions Package Versions Codacy Badge Environments

BARK-ML

Try it on Google Colab! Open In Colab

BARK-ML offers various OpenAI-Gym environments and reinforcement learning agents for autonomous driving.

Install BARK-ML using pip install bark-ml.

Gym Environments

Highway Scenario

env = gym.make("highway-v0")

The highway scenario is a curved road with four lanes where all vehicles are being controlled by the intelligent driver model (IDM). For more details have a look here.

Available environments:

  • highway-v0: Continuous highway environment
  • highway-v1: Discrete highway environment

BARK-ML Highway Scenario
The highway-v0 environment.

Merging Scenario

env = gym.make("merging-v0")

In the merging scenario, the ego vehicle is placed on the right and its goal is placed on the left lane. All other vehicles are controlled by the MOBIL model. For more details have a look here.

Available environments:

  • merging-v0: Continuous merging environment
  • merging-v1: Discrete merging environment

BARK-ML Merging Scenario
The merging-v0 environment.

Intersection / Unprotected Left Turn

env = gym.make("intersection-v0")

In the intersection scenario, the ego vehicle starts on the bottom-right lane and its goal is set on the top-left lane (unprotected left turn). For more details have a look here.

Available environments:

  • intersection-v0: Continuous intersection environment
  • intersection-v1: Discrete intersection environment

BARK-ML Intersection Scenario
The intersection-v0 environment.

Getting Started

An example using the OpenAi-Gym interface can be found here:

import gym
import numpy as np
# registers bark-ml environments
import bark_ml.environments.gym  # pylint: disable=unused-import

env = gym.make("merging-v0")

initial_state = env.reset()
done = False
while done is False:
  action = np.array([0., 0.]) # acceleration and steering-rate
  observed_state, reward, done, info = env.step(action)
  print(f"Observed state: {observed_state}, "
        f"Action: {action}, Reward: {reward}, Done: {done}")

Building From Source

Clone the repository using git clone https://github.com/bark-simulator/bark-ml, install the virtual python environment and activate it afterwards using:

bash utils/install.sh
source utils/dev_into.sh

Now - once in the virtual python environment - you can build any of the libraries or execute binaries within BARK-ML using Bazel. To run the getting started example from above, use the following command: bazel run //examples:continuous_env.

Documentation

Read the documentation online.

Publications

License

BARK-ML code is distributed under MIT License.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

bark_ml-0.4.23-cp39-cp39-manylinux2014_x86_64.whl (992.3 kB view details)

Uploaded CPython 3.9

bark_ml-0.4.23-cp39-cp39-macosx_10_14_x86_64.whl (326.3 kB view details)

Uploaded CPython 3.9macOS 10.14+ x86-64

bark_ml-0.4.23-cp38-cp38-manylinux2014_x86_64.whl (992.2 kB view details)

Uploaded CPython 3.8

bark_ml-0.4.23-cp38-cp38-macosx_10_14_x86_64.whl (326.3 kB view details)

Uploaded CPython 3.8macOS 10.14+ x86-64

bark_ml-0.4.23-cp37-cp37m-manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.7m

bark_ml-0.4.23-cp37-cp37m-macosx_10_14_x86_64.whl (325.1 kB view details)

Uploaded CPython 3.7mmacOS 10.14+ x86-64

File details

Details for the file bark_ml-0.4.23-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

  • Download URL: bark_ml-0.4.23-cp39-cp39-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 992.3 kB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for bark_ml-0.4.23-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0651c80592269dc5a5d128478d8dc051866571edb98e361c893892a61ddea1ab
MD5 f963173aaee9d241446327093926a7ad
BLAKE2b-256 dbd1fa1e1e652b76d914f7333982665e77befaf71df10db8116c2fbcd33cfc0b

See more details on using hashes here.

File details

Details for the file bark_ml-0.4.23-cp39-cp39-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: bark_ml-0.4.23-cp39-cp39-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 326.3 kB
  • Tags: CPython 3.9, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for bark_ml-0.4.23-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 8abe10996e6c057e85b01595b7a7e505e48d7815c1a7c875881923110a7e84e4
MD5 c537f1ba5516a28f2484780eed52fdba
BLAKE2b-256 2ba87a55c056714a45aac85ad91d38443573728f23ea1020ae147a2019e62402

See more details on using hashes here.

File details

Details for the file bark_ml-0.4.23-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

  • Download URL: bark_ml-0.4.23-cp38-cp38-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 992.2 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for bark_ml-0.4.23-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fd1ed3bea324b7c1ce58bc20030392979b7678b9358af1e35650e4ec91c5a793
MD5 d3b91b90246be8afb491e41e74b847fe
BLAKE2b-256 a8c82af58557b112edb48a551382e3c1268dc5c7681688056db10e11f6996f16

See more details on using hashes here.

File details

Details for the file bark_ml-0.4.23-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: bark_ml-0.4.23-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 326.3 kB
  • Tags: CPython 3.8, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for bark_ml-0.4.23-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 76e3cbe9e99c2ad4b5daaec445aee27487a82609d9b15cfecc68f6da3bc819a0
MD5 1943bd6835b179266de59b7238fd0b58
BLAKE2b-256 5f914dedeccce0222fc71ed007c9ba353e631b69c01566cc240ceffcaeae044f

See more details on using hashes here.

File details

Details for the file bark_ml-0.4.23-cp37-cp37m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: bark_ml-0.4.23-cp37-cp37m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for bark_ml-0.4.23-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7dd8966dfa09ac88fa4214d119a4185b3135e4809848cfd4f26beb0795b19500
MD5 5e755acac928fa8003bf237f3a586d3a
BLAKE2b-256 c8464f7b650e55a15e823d6514b18036a0825cb4ad5d4256232073140f28a9c5

See more details on using hashes here.

File details

Details for the file bark_ml-0.4.23-cp37-cp37m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: bark_ml-0.4.23-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 325.1 kB
  • Tags: CPython 3.7m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for bark_ml-0.4.23-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 55afec23dc6bb820fa61372eaa974cf2969965b12e627bde96934fd0e4e31358
MD5 43c453ddbacfd3d85a2e124b68a1d7df
BLAKE2b-256 4d76909055be8b13f9ec38417c0c917d94b73bfa71bc463687d039504e3f54f7

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