Skip to content

Commit

Permalink
add build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Kei18 committed Feb 12, 2021
1 parent ac56a6d commit 9b48e60
Show file tree
Hide file tree
Showing 9 changed files with 310 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.DS_Store
/build/
test.sh
/instances/toy.txt
/instances/toy.txt
/third_party/openFrameworks/
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.17)
project(mapf-refine CXX)

add_subdirectory(./mapf)
Expand Down
2 changes: 1 addition & 1 deletion mapf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.17)
file(GLOB SRCS "./src/*.cpp")
project(lib-mapf)
add_library(lib-mapf STATIC ${SRCS})
Expand Down
3 changes: 2 additions & 1 deletion mapf/include/ir.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "pibt_complete.hpp"
#include "whca.hpp"
#include "revisit_pp.hpp"
#include "push_and_swap.hpp"
#include "lib_ir.hpp"
#include "solver.hpp"

Expand All @@ -21,7 +22,7 @@ class IR : public Solver

protected:
// init-solver
enum struct INIT_SOLVER_TYPE { PIBT, HCA, WHCA, ECBS, PIBT_COMPLETE, RevisitPP };
enum struct INIT_SOLVER_TYPE { PIBT, HCA, WHCA, ECBS, PIBT_COMPLETE, RevisitPP, PushAndSwap };
INIT_SOLVER_TYPE init_solver;
std::vector<std::string> option_init_solver;

Expand Down
5 changes: 5 additions & 0 deletions mapf/src/ir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ Plan IR::getInitialPlan()
case INIT_SOLVER_TYPE::RevisitPP:
solver = std::make_shared<RevisitPP>(&_P);
break;
case INIT_SOLVER_TYPE::PushAndSwap:
solver = std::make_shared<PushAndSwap>(&_P);
break;
case INIT_SOLVER_TYPE::PIBT_COMPLETE:
default:
solver = std::make_shared<PIBT_COMPLETE>(&_P);
Expand Down Expand Up @@ -381,6 +384,8 @@ void IR::setParams(int argc, char* argv[])
init_solver = INIT_SOLVER_TYPE::RevisitPP;
} else if (s == "PIBT_COMPLETE") {
init_solver = INIT_SOLVER_TYPE::PIBT_COMPLETE;
} else if (s == "PushAndSwap") {
init_solver = INIT_SOLVER_TYPE::PushAndSwap;
} else {
warn("solver does not exists, use PIBT");
}
Expand Down
46 changes: 32 additions & 14 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Multi-Agent Path Finding
mapf-IR
===
[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)

A simulator and visualizer of Multi-Agent Path Finding (MAPF), used in a paper "Iterative Refinement for Realtime MAPF".
A simulator and visualizer of Multi-Agent Path Finding (MAPF), used in a paper "Iterative Refinement for Real-Time Multi-Robot Path Planning".
It is written in C++(17) with [CMake](https://cmake.org/) build and tested on OSX 10.15.
The visualizer uses [openFrameworks](https://openframeworks.cc).

The implementations include: HCA\* and WHCA\* [1], PIBT [2], CBS [3], ICBS [4], ECBS [5], Revisit Prioritized Planning [6], Push and Swap [7], winPIBT [8], PIBT-Complete, and IR.
The implementations include: HCA\* and WHCA\* [1], PIBT [2], CBS [3], ICBS [4], ECBS [5], Revisit Prioritized Planning [6], Push and Swap [7], winPIBT [8], PIBT+, and IR (Iterative Refinement).

| platform | status |
| ---: | :--- |
Expand All @@ -18,11 +18,11 @@ You can see the performance of each solver from [auto\_record repo](https://gith
## Demo
![100 agents in arena](/material/arena_100agents.gif)

100 agents in arena, planned by PIBT in ~~67ms~~ 7ms.
100 agents in arena, planned by PIBT in ~~67ms~~ 5ms.

![1000 agents in brc202d](/material/brc202d_1000agents.gif)

1000 agents in brc202d, planned by PIBT-Complete in ~~84sec~~ 1683ms.
1000 agents in brc202d, planned by PIBT in ~~84sec~~ 1348ms.
The gif shows a part of an MAPF plan.

## Building
Expand Down Expand Up @@ -81,14 +81,15 @@ solution=

### Building
It takes around 10 minutes.

#### MacOS
```sh
sh ./third_party/openFrameworks/scripts/osx/download_libs.sh
cd visualizer/
make build
cd ..
chmod +x ./visualize.sh
bash ./visualizer/scripts/build_macos.sh
```

Note: The script of openFrameworks seems to contain bugs. Check this [issue](https://github.com/openframeworks/openFrameworks/issues/6623). I fixed this in my script :D


### Usage
```sh
cd build
Expand All @@ -104,17 +105,34 @@ Generated by Github Actions. See also [auto\_record repo](https://github.com/Kei

![optimal solvers](https://github.com/Kei18/mapf-IR/blob/auto_record/fig/transition_1.jpg)

## Licence
This software is released under the MIT License, see [LICENSE.txt](LICENCE.txt).
## Experimental Environment
I used [![v1.1](https://img.shields.io/badge/tag-v1.1-blue.svg?style=flat)](https://github.com/Kei18/mapf-IR/releases/tag/v1.1)

Scripts for the experiments are in `exp_scripts/`.
Several solvers are coded in different names. See the following.

| paper | code |
| :--- | :--- |
| RPP | RevisitPP |
| PIBT+ | PIBT_COMPLETE |
| IR: random | IR |
| IR: single-agent | IR\_SINGLE\_AGENTS |
| IR: focusing-at-goals | IR\_FOCUS\_GOALS |
| IR: local-repair-around-goals | IR\_FIX\_AT\_GOALS |
| IR: using-MDD | IR\_MDD |
| IR: using-bottleneck-agent | IR\_BOTTLENECK |
| IR: composition | IR\_HYBRID |

## Notes
- Maps in `maps/` are from [MAPF benchmarks](https://movingai.com/benchmarks/mapf.html).
When you add a new map, please place it in the `maps/` directory.
- The font in `visualizer/bin/data` is from [Google Fonts](https://fonts.google.com/).
- Scripts for the experiments are in `exp_scripts/`.

## Licence
This software is released under the MIT License, see [LICENSE.txt](LICENCE.txt).

## Author
[Keisuke Okumura](https://kei18.github.io) is a Ph.D. candidate at Tokyo Institute of Technology, working on multiple moving agents.
[Keisuke Okumura](https://kei18.github.io) is a Ph.D. student at the Tokyo Institute of Technology, interested in controlling multiple moving agents.

## Reference
1. Silver, D. (2005).
Expand Down
2 changes: 1 addition & 1 deletion visualize.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
#!/bin/bash
`dirname $0`/visualizer/bin/visualizer.app/Contents/MacOS/visualizer $1
10 changes: 10 additions & 0 deletions visualizer/scripts/build_macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -e
cd `dirname $0`/../../third_party/openFrameworks/
git checkout refs/tags/0.11.0
cp -f ../../visualizer/scripts/download_libs.sh ./scripts/dev/download_libs.sh
bash ./scripts/osx/download_libs.sh -v 0.11.0
cd ../../visualizer/
make build
cd ..
chmod +x ./visualize.sh
Loading

0 comments on commit 9b48e60

Please sign in to comment.