Machine Learning Applied to Autonomous Driving
Project description
BARK-ML - Machine Learning for Autonomous Driving
Try it on Google 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 environmenthighway-v1
: Discrete highway environment
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 environmentmerging-v1
: Discrete merging environment
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 environmentintersection-v1
: Discrete intersection environment
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
- Graph Neural Networks and Reinforcement Learning for Behavior Generation in Semantic Environments (IV 2020)
- BARK: Open Behavior Benchmarking in Multi-Agent Environments (IROS 2020)
- Counterfactual Policy Evaluation for Decision-Making in Autonomous Driving (IROS 2020, PLC Workshop)
License
BARK-ML code is distributed under MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for bark_ml-0.3.1-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55d5dd80de942328852f42c84460b3c58e13db3798c00edfb5c2a5ec346d8f08 |
|
MD5 | 3b2d9db7a3c1ceab5045b9d538054022 |
|
BLAKE2b-256 | 64c9f7dc44b82ec34f1f2bf74485822514145ee6246d0fe3f6dc6e9ac534a8bf |
Hashes for bark_ml-0.3.1-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f4385d4d64c483b32987956e652964d502badc8a980f40a0f67311fbf15d0df |
|
MD5 | d7b785ce39a07ba1b503205212d12615 |
|
BLAKE2b-256 | ea98a172cb5a361af8679a6e7a4a43f6f6c4d9675981253bb5d46d9ce325b5ab |
Hashes for bark_ml-0.3.1-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d1dbba1aba2783f346d9568ef6338363cf808654ca5023e7e45690ecf5a3735 |
|
MD5 | c9d53c4e835fa8a83b14377704c51b4e |
|
BLAKE2b-256 | 5a034515c4a86789e4a6da6b9336d0186f9a4afcfdf8b193520ab1a038f2c752 |
Hashes for bark_ml-0.3.1-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 904c747170c300e2d3f0e9a1b40e50a4c6aa381188fe0264e2a4520b998d835a |
|
MD5 | 14f93b6bd9242de64ca92003a03494b1 |
|
BLAKE2b-256 | fa850914fda4ebefbe9a61bceb126d2709517f09bca7d348f4918775e51a9622 |
Hashes for bark_ml-0.3.1-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e943daacc32903aa974328c81774d048d7e36ef0d776ff66c231c19dc74292b |
|
MD5 | e66c8edca8680be477196d5b2565486e |
|
BLAKE2b-256 | 5202ef039c835eef00dc176e245c10da2987996395a8082e314cce1b8afb12c2 |