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

bark_ml-0.4.32-cp39-cp39-manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.9

bark_ml-0.4.32-cp39-cp39-macosx_10_14_x86_64.whl (868.6 kB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

bark_ml-0.4.32-cp38-cp38-manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.8

bark_ml-0.4.32-cp38-cp38-macosx_10_14_x86_64.whl (868.6 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

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

Uploaded CPython 3.7m

bark_ml-0.4.32-cp37-cp37m-macosx_10_14_x86_64.whl (867.2 kB view details)

Uploaded CPython 3.7m macOS 10.14+ x86-64

File details

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

File metadata

File hashes

Hashes for bark_ml-0.4.32-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 30273f97dffa739a15a4e27ad3c9f980e40a459dece5eeddd212a79f6b2ab6ae
MD5 7930ba6aed5141b91f213a916c9842af
BLAKE2b-256 ed00c8b14e96191bb6a789206ad4f2a3dffe4ba1ff8842faa65d17938a5f57a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bark_ml-0.4.32-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 41578a46affb10d601f20c348a62035da4d3948129c6db8e879f02db7cf8a62d
MD5 0c3c69eb358d8fadcc243bacd14add6e
BLAKE2b-256 e5c2a2773bee5bdb3fa9258fd204c9065ff41062fa203c93f8fd10b429392408

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bark_ml-0.4.32-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 eaddc82c4f12bcda0afad2f97941fd822807ece35792e851bb88801a4dbc6e70
MD5 97a9a786a1aff9d9472429d7a6b50403
BLAKE2b-256 08b9f314f68bdf5eab24a9a1b4c21bddde95e7288d2fc2101470065cb239a806

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bark_ml-0.4.32-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 8bdcf1f0a7c01545b0f7740f31b4df2478c16169a6bdc822050dd6e7686f1b8f
MD5 ad4a3cc800b399bbe503df04c7c9d038
BLAKE2b-256 fdf9099efafbbdf3d9e5ecb012a78a2fdeacfa511116fa98a91b02665b577d91

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bark_ml-0.4.32-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 958ed561b7c4053b81bc1e99e126116dda319731020f5f23cb8793404120b18c
MD5 8c083782fa4c5bcf8e31ce89c93e69b3
BLAKE2b-256 0eee6bbd1f870f7f8bfa9d92164725499910309cd45250450573e1f02482bbdf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bark_ml-0.4.32-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 3bf71f29b874e94ad1edb115678879b5dead39e9d9f12f0f83d060029d2f1f41
MD5 c756caffeb79b2f69e0b5090a61272b3
BLAKE2b-256 408d1dad01fbd21d4a4ea6a49f5aa3f9a4d0a3ca453d8201fb9c2a3a601d7bed

See more details on using hashes here.

Supported by

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