Machine Learning Applied to Autonomous Driving
Project description
Gym Environments and Agents 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.2-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 167dc12a86d11b5dc9c3c64ca0336acba7f12280d6fd97af478a958d513c7343 |
|
MD5 | bff8702751a6e8bef42cea39f0d10ea8 |
|
BLAKE2b-256 | aab545fd8e7da7ed605d128e67af023a8597e383e8330925a08633ce605927a0 |
Hashes for bark_ml-0.3.2-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0a0b3ac1f0be67ad9f591578eb85dab9da26f3dfbd224ae35327dd07fe1c5ff |
|
MD5 | cec68b8486ed6c1efd7ac90d2af85434 |
|
BLAKE2b-256 | 9f86d79c1b19935fd65458fc9717c82f86ee5574350c95aba624b7705926cd62 |
Hashes for bark_ml-0.3.2-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74323a5654f20ebe83e1b4e7d34f9f79e07975892a06f32ef38eeb6e2646f16a |
|
MD5 | 07704e45029060d8af59d683e8761ad3 |
|
BLAKE2b-256 | 3a0354863836d1c8197f00adb7264554ed49453d4147f6c01bd1b6d6603ecc70 |
Hashes for bark_ml-0.3.2-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a1c2abc614824a95100ec5fb9b817bfaff8d7c57a676a009b285b54af67267f |
|
MD5 | e556dfdfd1fffa748f42008da67eb76b |
|
BLAKE2b-256 | a149780791d541d7776f747372e7cbc5af5567ba31569133c30f4c33ef1acba6 |
Hashes for bark_ml-0.3.2-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20e7e37d4983b9151abec02ce88f7ace7a9afec756de7aa86986a4fe1da2acd5 |
|
MD5 | 10a4f728d8afb8ed19a089c36cb962b4 |
|
BLAKE2b-256 | 234ddce6bb665e6cd224a7ec44ce9440a59f1d6c86c6c14d12fe0e90eda8eb59 |
Hashes for bark_ml-0.3.2-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d3adb7f610d75fc1ab07e5dc061b3cfee8f108b743e50ee2e087d1ea2fd2924 |
|
MD5 | 9f7423379872491aa68e4f19dabaee92 |
|
BLAKE2b-256 | d6114d675bf475fdbadc359eab146789b8b917e1e23efcb5bdd6c37bbe6e1e34 |