Skip to main content

Machine Learning Applied to Autonomous Driving

Project description

BARK-ML - Machine Learning 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 OpenAI-Gym environments for autonomous driving and reinforcement learning agents. BARK-ML is built upon a fast, semantic C++ back-end and fully wrapped to Python.

The BARK-ML package can be installed using pip install bark-ml.

Gym Environments

Highway Scenario

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

The highway scenario is a curved road with four lanes with all vehicles are 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")

The ego agent is placed on the right lane and its goal on the left. 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.

Unprotected Left Turn

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

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

A complete 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.3.1-cp39-cp39-manylinux2014_x86_64.whl (892.4 kB view hashes)

Uploaded CPython 3.9

bark_ml-0.3.1-cp38-cp38-manylinux2014_x86_64.whl (892.3 kB view hashes)

Uploaded CPython 3.8

bark_ml-0.3.1-cp38-cp38-macosx_10_14_x86_64.whl (734.6 kB view hashes)

Uploaded CPython 3.8 macOS 10.14+ x86-64

bark_ml-0.3.1-cp37-cp37m-manylinux2014_x86_64.whl (897.8 kB view hashes)

Uploaded CPython 3.7m

bark_ml-0.3.1-cp37-cp37m-macosx_10_14_x86_64.whl (733.3 kB view hashes)

Uploaded CPython 3.7m macOS 10.14+ x86-64

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