GithubHelp home page GithubHelp logo

atb033 / multi_agent_path_planning Goto Github PK

View Code? Open in Web Editor NEW
995.0 16.0 246.0 8.98 MB

Python implementation of a bunch of multi-robot path-planning algorithms.

Home Page: https://atb033.github.io/multi_agent_path_planning/

License: MIT License

Python 100.00%
velocity-obstacles multi-agent-path-finding multi-agent-systems path-planning multi-robot

multi_agent_path_planning's Introduction

Multi-Agent path planning in Python

Introduction

This repository consists of the implementation of some multi-agent path-planning algorithms in Python. The following algorithms are currently implemented:

Dependencies

Install the necessary dependencies by running.

python3 -m pip install -r requirements.txt

Centralized Solutions

In these methods, it is the responsibility of the central planner to provide a plan to the robots.

Prioritized Safe-Interval Path Planning

SIPP is a local planner, using which, a collision-free plan can be generated, after considering the static and dynamic obstacles in the environment. In the case of multi-agent path planning, the other agents in the environment are considered as dynamic obstacles.

Execution

For SIPP multi-agent prioritized planning, run:

cd ./centralized/sipp
python3 multi_sipp.py input.yaml output.yaml

Results

To visualize the generated results

python3 visualize_sipp.py input.yaml output.yaml 

To record video

python3 visualize_sipp.py input.yaml output.yaml --video 'sipp.avi' --speed 1
Test 1 (Success) Test 2 (Failure)
Success Failure

Reference

Conflict Based Search

Conclict-Based Search (CBS), is a multi-agent global path planner.

Execution

Run:

cd ./centralized/cbs
python3 cbs.py input.yaml output.yaml

Results

To visualize the generated results:

python3 ../visualize.py input.yaml output.yaml
Test 1 (Success) Test 2 (Success)
Success Failure
8x8 grid 32x32 grid
Test 3 Test 4

Reference

Post-Processing

Post-processing with TPG

The plan, which is computed in discrete time, can be postprocessed to generate a plan-execution schedule, that takes care of the kinematic constraints as well as imperfections in plan execution.

This work is based on: Multi-Agent Path Finding with Kinematic Constraints

Once the plan is generated using CBS, please run the following to generate the plan-execution schedule:

cd ./centralized/scheduling
python3 minimize.py ../cbs/output.yaml real_schedule.yaml

Decentralized solutions

In this approach, it is the responsibility of each robot to find a feasible path. Each robot sees other robots as dynamic obstacles, and tries to compute a control velocity which would avoid collisions with these dynamic obstacles.

Velocity obstacles

Execution

cd ./decentralized
python3 decentralized.py -f velocity_obstacle/velocity_obstacle.avi -m velocity_obstacle

Results

  • Test 1: The robot tries to stay at (5, 5), while avoiding collisions with the dynamic obstacles
  • Test 2: The robot moves from (5, 0) to (5, 10), while avoiding obstacles
Test 1 Test 2
Test1 Test2

References

Nonlinear Model-Predictive Control

Execution

cd ./decentralized
python3 decentralized.py -m nmpc

Results

  • Test 1: The robot tries to stay at (5, 5), while avoiding collisions with the dynamic obstacles
  • Test 2: The robot moves from (5, 0) to (5, 10), while avoiding obstacles
Test 1 Test 2
Test1 Test2

References

multi_agent_path_planning's People

Contributors

atb033 avatar pycckuu avatar seljurf avatar snoyes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

multi_agent_path_planning's Issues

No visualize.py in the code

Hi,
I like your code. But when I try to check the cbs result, "python3 ../visualize.py input.yaml output.yaml" does not work since there is no visualize.py file in the code. Could you please upload it?
Regards,
Peter

CBS is not properly working for 3 and more agents

Hello! Great collection of the algorithms.

I am trying to use CBS and I have some issues when I run it with 3 or more agents. The solution is never found although should be simple.

This is my input

agents:
-   start: [1, 5]
    goal: [3, 9]
    name: agent0
-   start: [1, 9]
    goal: [3, 7]
    name: agent1
-   start: [1, 7]
    goal: [3, 5]
    name: agent2
map:
    dimensions: [13, 12]
    obstacles:
    - !!python/tuple [0, 0]
    - !!python/tuple [0, 1]
    - !!python/tuple [0, 2]
    - !!python/tuple [0, 3]
    - !!python/tuple [0, 4]

    - !!python/tuple [0, 6]
    - !!python/tuple [0, 7]
    - !!python/tuple [0, 8]
    - !!python/tuple [0, 9]
    - !!python/tuple [0, 10]
    - !!python/tuple [0, 11]

    - !!python/tuple [1, 0]
    - !!python/tuple [2, 0]
    - !!python/tuple [3, 0]
    - !!python/tuple [4, 0]
    - !!python/tuple [5, 0]
    - !!python/tuple [6, 0]
    - !!python/tuple [7, 0]
    - !!python/tuple [7, 1]
    - !!python/tuple [7, 2]
    - !!python/tuple [7, 3]
    - !!python/tuple [7, 4]
    - !!python/tuple [8, 4]
    - !!python/tuple [9, 4]
    - !!python/tuple [10, 4]
    - !!python/tuple [11, 4]

    - !!python/tuple [1, 11]
    - !!python/tuple [2, 11]
    - !!python/tuple [3, 11]
    - !!python/tuple [4, 11]
    - !!python/tuple [5, 11]
    - !!python/tuple [6, 11]
    - !!python/tuple [7, 11]
    - !!python/tuple [8, 11]
    - !!python/tuple [9, 11]
    - !!python/tuple [10, 11]
    - !!python/tuple [11, 11]

    # right wall
    - !!python/tuple [12, 5]
    - !!python/tuple [12, 6]
    - !!python/tuple [12, 7]
    - !!python/tuple [12, 8]
    - !!python/tuple [12, 9]
    - !!python/tuple [12, 10]
    - !!python/tuple [12, 11]

    - !!python/tuple [2, 3]
    - !!python/tuple [2, 4]

    - !!python/tuple [2, 6]
    - !!python/tuple [2, 7]
    - !!python/tuple [2, 8]
    - !!python/tuple [2, 9]

    - !!python/tuple [4, 2]
    - !!python/tuple [4, 3]
    - !!python/tuple [4, 4]

    - !!python/tuple [4, 6]
    - !!python/tuple [4, 7]
    - !!python/tuple [4, 8]
    - !!python/tuple [4, 9]

    - !!python/tuple [6, 2]
    - !!python/tuple [6, 3]
    - !!python/tuple [6, 4]

    - !!python/tuple [6, 6]
    - !!python/tuple [6, 7]
    - !!python/tuple [6, 8]
    - !!python/tuple [6, 9]

    - !!python/tuple [8, 6]
    - !!python/tuple [8, 7]
    - !!python/tuple [8, 8]
    - !!python/tuple [8, 9]

    - !!python/tuple [10, 6]
    - !!python/tuple [10, 7]
    - !!python/tuple [10, 8]
    - !!python/tuple [10, 9]

HRVO not work well

Hi, I'm trying to modify Hybrid Reciprocal Velocity Obstacle(HRVO) to fit my task. However, I found that if start and goal set as straight line (like start, goal = [25, 10], [25, 40], or start, goal = [10, 40], [40, 10]), the path will not go straightly without other obstacle interfere. Can you explain why and how to solve? thanks a lot!

HRVO-test2
(This gif just show the straight line path with HRVO algorithm)

Saving to video currently does not work for lack of a canvas

See title.

You need to define a canvas before you define the function-animation.
I have some fixed and slightly cleaned up code, so if you invite me to the repo, I can push a PR, if you want.

Way to replicate issue: Try creating video output. You will get an error message that says that an object related to canvas is None and does not have a certain property.

CBS work not well

 Hi, I'm trying to test CBS to fit my task. I create the yaml file as follows for testing: 

agents:

  • goal: [2, 0]
    name: agent0
    start: [1, 3]
  • goal: [3, 1]
    name: agent1
    start: [0, 2]
  • goal: [1, 0]
    name: agent2
    start: [2, 3]
    map:
    dimensions: [4, 4]
    obstacles:
    • !!python/tuple [0, 0]
    • !!python/tuple [0, 3]
    • !!python/tuple [3, 0]
    • !!python/tuple [3, 3]
      When I run the code as prompted by the READM.md file, I find that every time I input the above yaml file, the output result (that is, the solution of each agent in the output.yaml file) will be different. This difference will result in a difference in the depth of the constraint tree, so that the runtime of the program will be different. I want to ask you how to make CBS output a stable and unique solution every time it runs? Thank you for taking the time to check my feedback during your busy schedule. I look forward to your responses and suggestions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.