https://github.com/aria-systems-group/regret_synthesis_toolbox

Source code for Regret synthesis for two-player turn-based game played on graphs - ICRA 22

https://github.com/aria-systems-group/regret_synthesis_toolbox

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
    Links to: springer.com, ieee.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.0%) to scientific vocabulary

Keywords

formal-methods game-theory regret-games regret-minimization robotics
Last synced: 6 months ago · JSON representation

Repository

Source code for Regret synthesis for two-player turn-based game played on graphs - ICRA 22

Basic Info
  • Host: GitHub
  • Owner: aria-systems-group
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 12.3 MB
Statistics
  • Stars: 0
  • Watchers: 3
  • Forks: 0
  • Open Issues: 1
  • Releases: 0
Topics
formal-methods game-theory regret-games regret-minimization robotics
Created almost 6 years ago · Last pushed 10 months ago
Metadata Files
Readme License

README.md

Description

This repository contains code for the paper "Let's Collaborate: Regret-based Reactive Synthesis for Robotic Manipulation (ICRA 22)." In this work we introduce algorithms for quantitative regret-based reactive synthesis. We consider resource constrained robotic manipulators that need to interact with a human to achieve a complex task expressed in linear temporal logic. This repository contains the source code to synthesize regret minimizing strategy for the robot operating in a dynamic environment modeled as a two-player turn-based zero-sum game. See the paper for more details.

Table of Contents * Installation * Results * Reference

Installation

Clone the code

  • clone this repo with: bash git clone --recurse-submodules git@github.com:aria-systems-group/regret_synthesis_toolbox.git .

Note: The --recurse-submodule will automatically initialize and update each submodule in the repository. This repository contains following synthesis algorithms.

Supported:

Qualitative Algorithms

  • [x] Adversarial Game (w Permissive strategy synthesis)
  • [x] Cooperative Game (w Permissive strategy synthesis)
  • [ ] Best-Effort Synthesis(Link)

Quantitative Algorithms

  • [x] Value Iteration (Min-Max and Min-Min) w total Payoff function(Link)
  • [x] Finite Trace Regret Synthesis(Link)
  • [x] Bounded Human Adversarial Game(Link)
  • [ ] Best-Effort Synthesis

For regret-synthesis abstraction and synthesis see the PDDLtoSim repository.

Docker Installation - Creating an Image and Spinning a Container

Make sure you have Docker installed. If not, follow the instructions here.

Docker Commands to build the image

  1. cd into the root of the project

  2. Build the image from the Dockerfile

bash docker build -t <image_name> .

Note: the dot looks for a Dockerfile in the current repository. Then spin an instance of the container by using the following command

bash docker run -it --name <docker_container_name> <docker image name>

For volume binding

bash docker run -v <HOST-PATH>:<Container-path>

For example, to volume bind your local directory to the regret_planning folder inside the Docker, use the following command

bash docker run -it -v $PWD:/root/regret_planning --name <dokcer_container_name> <image_name>

Here <docker_container_name> is any name of your choice and <image_name> is the docker image name from above. -it and -v are flags to run an interactive terminal and volume bind respectively.

Running Gym-Minigrid examples

If you want to record gym-minigrid runs from Wombats library then install ffmpeg tool using the following commands:

bash apt update && apt upgrade apt install ffmpeg To confirm installation, run ffmpeg --version.

Additionally, if you are more used to GUI and would like to edit or attach a container instance to VSCode (Link) then follow the instructions below:

Attaching the remote container to VScode

  1. Make sure you have the right VS code extensions installed
    • install docker extension
    • install python extension
    • install remote container extension
    • Now click on the Remote Explore tab on the left and attach VScode to a container.
  2. This will launch a new vs code attached to the container and prompt you to a location to attach to. The default is root, and you can just press enter. Congrats, you have attached your container to VSCode.

Running the code

cd into the regret_planning directory, and run the following command

bash python3 main.py

Conda Installation - Instructions to create the env for the code

  • install anaconda or miniconda

  • install spot if you are going to construct a DFA using an LTL formula.

  • change into this repo's directory: bash cd regret_synthesis_toolbox

  • create the conda environment for this library: bash conda env create -f environment.yml

  • activate the conda environment: bash conda activate regret_syn_env

Running the code

cd into the root directory, activate the conda env and run the following command

bash python3 main.py

Tests

All the tests related scripts are available in the tests/ directory. I use python unittest for testing individual components of my source code. Here are some commands to run the tests:

To run a specific test package:

bash python3 -m unittest discover -s tests.<directory-name> -bv

To run a specific test script:

bash python3 -m tests.<directory-name>.<module-nane> -b

To run all tests:

bash python3 -m unittest -bv

For more details see the tests/README.md. Note, all commands must be run from <root/of/project>.

Spot Troubleshooting notes

You can build spot from source, official git repo or Debain package. If you do source intallation, then run the following command to verify your installation

```bash ltl2tgba --version

```

If your shell reports that ltl2tgba is not found, add $prefix/bin to you $PATH environment variable by using the following command

```bash export PATH=$PATH:/place/with/the/file

```

Spot installs five types of files, in different locations. $prefix refers to the directory that was selected using the --prefix option of configure (the default is /usr/local/).

1) command-line tools go into $prefix/bin/ 2) shared or static libraries (depending on configure options) are installed into $prefix/lib/ 3) Python bindings (if not disabled with --disable-python) typically go into a directory like $prefix/lib/pythonX.Y/site-packages/ where X.Y is the version of Python found during configure. 4) man pages go into $prefix/man 5) header files go into $prefix/include

Please refer to the README file in the tar ball or on their Github page for more details on trouble shooting and installation.

Other known installation issues

Gym-Minigrid related issues

  1. Due to dependency issues of Wombats library, both gym and gym-minigrid have to be of specific version; precisely, gym==0.21.0 and gym-minigrid=1.0.2.
  2. When using docker, if you want to visualize minigrid runs, then enable X11 forwarding - Link.
  3. If you get 'FigureCanvasAgg' object has no attribute 'set_window_title' error when running minigrid examples with render flag then you possibly have the wrong matplotlib version. Changing matplotlib version to 3.5 works. If you already have installed matplotlib then use the following command to install the specific version

bash pip3 install 'matplotlib==3.5' --force-reinstall

Gym-Minigrid installation error

  1. If you get the following error python setup.py egg_info did not run successfully when installing gym-minigrid=1.0.2 then it is likely that you have the wrong setuptools version. See this link for more info. If you already have installed setuptools then use the following command to install the specific version.

bash pip3 install 'setuptools==65.5.0' --force-resinstall

Results

You can find more information at this project link

Citing

If the code is useful in your research, and you would like to acknowledge it, please cite this paper:

@INPROCEEDINGS{muvvala2022regret, author={Muvvala, Karan and Amorese, Peter and Lahijanian, Morteza}, booktitle={2022 International Conference on Robotics and Automation (ICRA)}, title={Let's Collaborate: Regret-based Reactive Synthesis for Robotic Manipulation}, year={2022}, pages={4340-4346}, doi={10.1109/ICRA46639.2022.9812298}}

Contact

Please contact me if you have questions at :karan.muvvala@colorado.edu

Owner

  • Name: ARIA Systems Group
  • Login: aria-systems-group
  • Kind: organization
  • Location: Smead Aerospace Engineering Sciences at the University of Colorado Boulder

GitHub Events

Total
  • Push event: 31
  • Create event: 4
Last Year
  • Push event: 31
  • Create event: 4

Issues and Pull Requests

Last synced: almost 2 years ago

All Time
  • Total issues: 3
  • Total pull requests: 5
  • Average time to close issues: 5 days
  • Average time to close pull requests: 25 days
  • Total issue authors: 1
  • Total pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.4
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 3
  • Pull requests: 1
  • Average time to close issues: 5 days
  • Average time to close pull requests: 1 minute
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • MuvvalaKaran (2)
Pull Request Authors
  • MuvvalaKaran (3)
  • watakandai (2)
Top Labels
Issue Labels
bug (1) enhancement (1)
Pull Request Labels

Dependencies

Dockerfile docker
  • ubuntu 20.04 build
conda/environment.yml conda
  • bidict
  • cloudpickle
  • cycler
  • docker
  • future
  • gym
  • gym_minigrid
  • ipython
  • joblib
  • matplotlib
  • mpmath
  • networkx
  • numpy
  • pandas
  • paramiko
  • ply
  • pybullet
  • pydot
  • pydot3
  • pyglet
  • pyperplan
  • python-graphviz
  • pytz
  • pyyaml
  • scipy
  • shapely
  • tqdm