Machine Learning Applied to Autonomous Driving
Project description
Gym Environments and Agents for Autonomous Driving
Try it on Google 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 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.4-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fbd3db0cde7f70e64168c5a9682a318991116b499ba7d9655a27a17a2f9e495 |
|
MD5 | 131d7dd028d47785300d06cf5e2dd78f |
|
BLAKE2b-256 | 226d9a593b51900d885a929fa4fdc9107b3920a48f67ac73ec2864ff17552e1f |
Hashes for bark_ml-0.3.4-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27aea533431850883da1b92a6a335c39a9ec71096ba5b138fc4333d2e1dd36f7 |
|
MD5 | 7a27da34bb83f7ca45028152c06f0e60 |
|
BLAKE2b-256 | d67e1bfd9f94a54dd745f82cfba844b978e6a3055b72d4fefa83566947636884 |
Hashes for bark_ml-0.3.4-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7ccf7963a7dbff3e46ade2c0bdb7aad1ff68e776dbd01dd467a9d99cbd14016 |
|
MD5 | a3d5f3a8e3cccb93fc4a0f3865297651 |
|
BLAKE2b-256 | e5216a2357fb39ababbd4ffd08419f623d8dd2af6de5c4889bde950226afa174 |
Hashes for bark_ml-0.3.4-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e1fb6ae1a377165f0d0a1821aac553a55cf4fd1bbbaf987febb690d89687aa2 |
|
MD5 | 0bcb79ef64738e8bd38aeba3ec9e278d |
|
BLAKE2b-256 | 18d18b2c972075050607b4ff00927c6fd7a7d12a857b546bd221847a5d95a40e |
Hashes for bark_ml-0.3.4-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10adc27eb0f8076805a99e83fcc2378693d82cc324cec6bd05a09aeb9c7650f4 |
|
MD5 | 9a7b204a79af689168712f690db3b59b |
|
BLAKE2b-256 | 047980eced4694fadfa8966ef674c26f7e7b2ff0c67eed267b5561bc4a1291d6 |