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
action = np.random.uniform(low=np.array([-0.5, -0.1]), high=np.array([0.5, 0.1]), size=(2, ))
observed_state, reward, done, info = env.step(action)
print(f"Observed state: {observed_state}, 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.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66de708ddd497a508deb310925a9c39a460db4b801ff02c334edf3143dd5c71f |
|
MD5 | 26761e2c5060e2b7342e042fdd711bc4 |
|
BLAKE2b-256 | bd14c1ffc94fc698b04e4b969b8d14ea6db905799480ac7355b14ae7e1c11bcf |
Hashes for bark_ml-0.3.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 577286edcd2ed8c9466125cab4260fae88907dc495daf5a1a9c8cdc0d95a6895 |
|
MD5 | 1a1d80b0d71e6b5a8963aeb7ac9401d3 |
|
BLAKE2b-256 | f18e3282118ae5370eb27668ef73e9bc649d1526dbbfa2e4391acdb6e1ecd394 |
Hashes for bark_ml-0.3.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 857efee61d076b06a0d2db5c4d6b4f38e0668709574b55cf0378e4c5e366cdd9 |
|
MD5 | 98dfa67ec6f3eab49665b29b3eb95d4b |
|
BLAKE2b-256 | 29f84c1abf32c769fd756ce18e63821495d6ac01b7deeb09a49e36446158638a |
Hashes for bark_ml-0.3.0-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a5ca91959017d2827142e360401fac3f77da4d4c4ebf55923c9d23ee8df2a4b |
|
MD5 | b1fe272cecca8f034ee492fc306424bd |
|
BLAKE2b-256 | a54b1229757399953fa219edde0a51aa6153c7c95a99c95a5d14cc92c25c67e4 |
Hashes for bark_ml-0.3.0-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccc42d7fc8dad3884765d32e2f910fd2059997c354527c3d67317de2fc925e24 |
|
MD5 | 88cad77acaec2b8216e29e9a4da61246 |
|
BLAKE2b-256 | 00c07c06dd869ad8ebf232d8794d3f0233d6fad6d9e3bd9c1ee8315cc363468f |