Skip to main content

Hierarchical behavior models for complex decision-making and behavior generation in robotics

Project description

Arbitration Graphs

Latest Release License Unit Test Status

TL;DR: Replace those rusty state machines with safe and scalable arbitration graphs!

Hierarchical behavior models for complex decision-making and behavior generation in robotics!

  • 🌱 Bottom-up
    Combine simple atomic behavior components to generate complex behaviors.
  • 🧩 Functional decomposition
    Behavior components address How to do it? and Can we do it?, while Arbitrators decide What to do?
  • 🧠 Meta-framework
    Integrate diverse methods in one decision-making framework. Why not combine optimization-based planning, probabilistic approaches (POMDPs), and machine learning (RL)? Use any approach where it performs best!
  • 🛠️ Maintainability
    Add new behaviors without having to touch existing ones – did we mention strict modularity and functional decomposition?
  • 🛡️ Behavior Verification
    Use tightly integrated verifiers to ensure that only safe and valid behavior commands are executed.
  • 🪂 Graceful Degradation
    Your behavior is unreliable or unsafe? Arbitrators will gracefully fall back to the next-best option.
😋 Click for more reasons!
  • 📈 Scalability
    Stack behavior components in arbitrators to create hierarchical behavior models.
  • 💡 Transparency
    Easily follow and understand the decision-making process, e.g., with our GUI.
  • 📦 Header-Only
    Simple integration – just include this header-only C++17 library!
  • 🐍 Python Bindings
    For easy prototyping, testing, and integration of machine learning algorithms, all the functionality is available via Python bindings.
  • 📜 Permissive License
    Published under MIT license to ensure maximum flexibility for your projects.
🤨 How does it compare to Behavior Trees?

Behavior Trees (BTs) are great for a variety of applications and thrive within a vibrant community!
Kudos to Petter Ögren's crew, Michele Colledanchise and Davide Faconti 🖖

But, Arbitration Graphs bring great value, especially for safety critical applications like self-driving cars and mobile robots in general – by strictly coupling preconditions to behaviors and tightly integrating behavior verification. A bit more in detail:

Behavior Trees Arbitration Graphs
Interfaces Nodes return execution status (success, failure, or running).
⏵ more flexibility w.r.t. a node's actuator interfaces
Behavior components & arbitrators return commands (e.g., a trajectory).
⏵ control theory motivated interface ${f(\boldsymbol{x}) \to \boldsymbol{u}}$
⏵ command can be verified by each arbitrator
Preconditions Implemented by condition nodes distributed throughout the tree.
⏵ easy to reuse preconditions for multiple behaviors
Require behavior components to define their own preconditions.
⏵ tight coupling of preconditions to behaviors
⏵ robustness and safety less dependent on node arrangement
Safety Each node decides on its success or failure.
⏵ can lead to safety and reliability issues, if not carefully managed
Integrate safety into the selection mechanism, using node-independent verifiers.
⏵ reduces the burden on behavior engineers
⏵ allows an easy integration of unsafe behavior components (ML, probabilistic, …)

At a Glance

Arbitration Graphs break down complex decision-making into atomic behavior components and arbitrators.

Behavior components compute a command (e.g., a trajectory) based on the current state of the world. They define whether they can be executed in the current state using their invocation condition.

Arbitrators select the best option based on a defined decision-making policy. Options can be behavior components or nested arbitrators.

Verifiers check whether the command of a behavior component is safe and valid prior to being selected by an arbitrator.

Demo

We provide a demo of this library using Pac-Man as an example application.
The arbitration graph controls Pac-Man on its journey to collect tasty dots 🍬

Run the demo with:

git clone https://github.com/KIT-MRT/arbitration_graphs.git
cd arbitration_graphs/demo
docker compose up

Open the GUI with your favorite browser:
http://0.0.0.0:8080

Explanation

You will see the Pacman Agent arbitrator selecting between five behavior options (by priority).
The Eat Dots option is itself an arbitrator with two sub-behaviors (selecting by expected benefit).

In this scene,

  • the Chase Ghost and Avoid Ghost behaviors are not applicable (no ghosts in close vicinity) → grey background,
  • the Eat Closest Dot and Move Randomly behavior failed verification (our verification showcase) → red background,
  • thus, the least-prioritized Stay in Place behavior is being executed → green background.

Installation

Note: We are currently working on a new major release of the library which will include some breaking changes. See the corresponding issue and pull request for details and the current status.

The Python interface to the arbitration graph library is generated using pybind11 and provides a convenient interface to utilize the full power of the arbitration graph library in Python.

Via PyPI (Recommended)

Even more good news: The package is available on PyPI, so installing it is as easy as running:

pip install arbitration-graphs

Note: The package requires Python 3.8 or higher and currently only supports a limited set of platforms. Let us know if you need support for an additional platform and we will see what we can do!

From Source

You can also build the package from source. Handy for development or if your target platform is currently not supported by the pre-built package.

Prerequisites

First make sure all dependencies are installed:

See also the Dockerfile for how to install these packages under Debian or Ubuntu.

Via pip
# From local repository
git clone https://github.com/KIT-MRT/arbitration_graphs.git
cd arbitration_graphs/python_bindings
pip install .

# Or directly from GitHub
pip install git+https://github.com/KIT-MRT/arbitration_graphs.git#subdirectory=python_bindings
Via CMake

Clone the repository and build the package using CMake:

mkdir -p arbitration_graphs/python_bindings/build
cd arbitration_graphs/python_bindings/build
cmake ..
cmake --build .

Development

Using Docker image

Clone the repository and run the development image

git clone https://github.com/KIT-MRT/arbitration_graphs.git
cd arbitration_graphs/python_bindings
docker compose build arbitration_graphs_pybind_devel
docker compose run --rm arbitration_graphs_pybind_devel

This mounts the source into the container's /home/blinky/arbitration_graphs folder. There, you can edit the source code, compile and run the tests etc.

Running unit tests

This package includes unit tests analogous to the C++ tests. To run all tests, use the following command:

cd arbitration_graphs/python_bindings/test
python -m unittest discover

Contributors

This library and repo has been crafted with ❤️ by

Christoph Burger   ChristophBurger89   LinkedIn logo christoph-burger   ORCID iD 0009-0002-9147-8749
Nick Le Large   ll-nick   LinkedIn logo nick-le-large   ORCID iD 0009-0006-5191-9043
Piotr Spieker   orzechow   LinkedIn logo piotr-spieker   ORCID iD 0000-0002-0449-3741

Christoph and Piotr coded the core in a pair-programming session. Piotr also contributed the GUI and GitHub Page. Nick implemented the awesome PacMan demo and tutorial, with drafting support by Christoph, reviews and finetuning by Piotr. The Python bindings have been contributed by Nick and reviewed by Piotr.

The repository is maintained by Piotr Spieker  orzechow and Nick Le Large  ll-nick .

Citation

If you use arbitration graphs in your research, we would be pleased if you cite our work:

Piotr Spieker, Nick Le Large, and Martin Lauer, “Better Safe Than Sorry: Enhancing Arbitration Graphs for Safe and Robust Autonomous Decision-Making,” Nov. 15, 2024, arXiv: arXiv:2411.10170. doi: 10.48550/arXiv.2411.10170.

@misc{spieker2024ArbitrationGraphs,
  title={Better Safe Than Sorry: Enhancing Arbitration Graphs for Safe and Robust Autonomous Decision-Making}, 
  author={Piotr Spieker and Nick Le Large and Martin Lauer},
  year={2024},
  eprint={2411.10170},
  eprinttype = {arXiv},
  archivePrefix={arXiv},
  primaryClass={cs.RO},
  doi = {10.48550/arXiv.2411.10170},
  url={https://arxiv.org/abs/2411.10170}, 
}
Earlier publications

Behavior Verification and Fallback Layers

A safety concept that extends Arbitration Graphs with behavior verification and fallback layers in the context of automated driving has been proposed by Piotr Spieker (née Orzechowski) in his PhD thesis. This served as the basis for the paper with Nick above.

Piotr F. Orzechowski, “Verhaltensentscheidung für automatisierte Fahrzeuge mittels Arbitrationsgraphen,” phd, Karlsruher Institut für Technologie (KIT), 2023. doi: 10.5445/IR/1000160638.

@thesis{Orzechowski2023Arbitrationsgraphen,
  type = {phdthesis},
  title = {Verhaltensentscheidung für automatisierte Fahrzeuge mittels Arbitrationsgraphen},
  author = {Orzechowski, Piotr Franciszek},
  date = {2023},
  institution = {Karlsruher Institut für Technologie (KIT)},
  doi = {10.5445/IR/1000160638},
  langid = {german},
  pagetotal = {169},
}

Replacing state machines in AV

Arbitration Graphs replaced state machines in the context of automated driving at the Institute of Measurement and Control Systems (MRT) of the Karlsruhe Institute of Technology (KIT):

Piotr F. Orzechowski, Christoph Burger, and Martin Lauer, “Decision-Making for Automated Vehicles Using a Hierarchical Behavior-Based Arbitration Scheme,” in Intelligent Vehicles Symposium, Las Vegas, NV, USA: IEEE, Oct. 2020, pp. 767–774. doi: 10.1109/IV47402.2020.9304723.

@inproceedings{orzechowski2020ArbitrationGraphs,
  title = {Decision-Making for Automated Vehicles Using a Hierarchical Behavior-Based Arbitration Scheme},
  booktitle = {Intelligent Vehicles Symposium},
  author = {Orzechowski, Piotr F. and Burger, Christoph and Lauer, Martin},
  date = {2020-10},
  pages = {767--774},
  publisher = {IEEE},
  location = {Las Vegas, NV, USA},
  issn = {2642-7214},
  doi = {10.1109/IV47402.2020.9304723},
}

Foundation work in Robot Soccer

The foundations for Arbitration Graphs have been proposed in the context of robot soccer:

Martin Lauer, Roland Hafner, Sascha Lange, and Martin Riedmiller, “Cognitive concepts in autonomous soccer playing robots,” Cognitive Systems Research, vol. 11, no. 3, pp. 287–309, 2010, doi: 10.1016/j.cogsys.2009.12.003.

@article{lauer2010CognitiveConceptsAutonomous,
  title = {Cognitive Concepts in Autonomous Soccer Playing Robots},
  author = {Lauer, Martin and Hafner, Roland and Lange, Sascha and Riedmiller, Martin},
  date = {2010},
  journaltitle = {Cognitive Systems Research},
  volume = {11},
  number = {3},
  pages = {287--309},
  doi = {10.1016/j.cogsys.2009.12.003},
}

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

If you're not sure about the file name format, learn more about wheel file names.

arbitration_graphs-0.10.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (529.3 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

arbitration_graphs-0.10.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (529.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

arbitration_graphs-0.10.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (530.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

arbitration_graphs-0.10.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (528.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

arbitration_graphs-0.10.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (529.0 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

arbitration_graphs-0.10.1-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (528.2 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file arbitration_graphs-0.10.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for arbitration_graphs-0.10.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2fd11d38f1e673c8baa5bba4b465a62372be7b1527007f074e44028ac8aeb1f3
MD5 c732a89ccbc0359d92900f63fea09c9d
BLAKE2b-256 465be5ce1814d9f480a35674f402df7f37784bc82328c732bb68a71be6d5a8f8

See more details on using hashes here.

File details

Details for the file arbitration_graphs-0.10.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for arbitration_graphs-0.10.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e16553e76cb95b32160d0ef6db112f4efdf2544aedbabd9b6c4952ba6718aafa
MD5 9f89b6b07d525172d9ad126cfdbb8116
BLAKE2b-256 bb547b7759b42f73e401497bf2af81bea1127c0eaf33d24713a5c24f0d08320b

See more details on using hashes here.

File details

Details for the file arbitration_graphs-0.10.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for arbitration_graphs-0.10.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bfca48e0fc2827c4328ca8e885a0b978f748c557341f8d2c4a8112bd93f4f0c0
MD5 dedf13e7fa9cbd2376ea45c594e92f6e
BLAKE2b-256 6e04e25644e6431c5afcfe5a5422227fc66579a4c30c1b4cf34565eb1e4b62a3

See more details on using hashes here.

File details

Details for the file arbitration_graphs-0.10.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for arbitration_graphs-0.10.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8ebc92e2c5dd889b3e5eb1f9ed340edc997701e7bbe6320bc417ec5c3f9b076a
MD5 2fa4b6222c5b893a165ca43982c44f69
BLAKE2b-256 da8b49006c0c0cced5db3a28c3d29f6fd3ef5f998023c277ab7521f1b472247c

See more details on using hashes here.

File details

Details for the file arbitration_graphs-0.10.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for arbitration_graphs-0.10.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 073053f7d1552dc1da90562db14527eef28de8ccc22a359b0ff0ee6c4e51d0cb
MD5 d4b346113e746371362d3723640c2a38
BLAKE2b-256 78e006b92717d92616478d7025a9ac956c93e77ab381b0b0d9d5b6b38f8861df

See more details on using hashes here.

File details

Details for the file arbitration_graphs-0.10.1-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for arbitration_graphs-0.10.1-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 99112cc59edf62488c6d29c905fd7ea832977a896e3899ea0b6e813b29303849
MD5 9ddd1e2dc5a27eaf90155ad761148257
BLAKE2b-256 147b21592b747c59b5de5139cd575cd1b5772e2ed9debcfd19a4a4b812258c2e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page