anedanman / PathPlanningPO

Implementation of D* Lite for robot navigation problem

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PathPlanningPO

Implementation of LPA* and D* Lite algorithms.

Sources:

Installation

  • Download repository:
git clone https://github.com/Arkol7/PathPlanningPO.git
  • Install requirements:
pip install -r requirements.txt
  • Go to project directory:
cd PathPlanningPO

LPA*

  • run LPA* visualization on 4(or 8)-connected gridmap:
python 4-c-LPA.py

for an unknown reason, sometimes the LPA* on an 8-connected map does not find the optimal path with minimization (g + cost), so it finds the shortest path only using g-values

Key-buttons:

  • left mouse button - place cell (the first click places start cell, second one - goal cell, all other - impassable cells)
  • SPACE - run LPA* from scratch
  • c - clear screen
  • r - re-run LPA* using information from previous run

D* Lite

In this project 2 algorithms for solving robot navigation problem were implemented. The first - restarted A* (see implementation). The second - D* Lite (see implementation). To compare the performance of algorithms were created a special class TestMapRunner (see implementation). It uses task files and maps from maps directory. To evaluate performance of algorithms we calculate 4 metrics:

  • Insertions - the number of node's insertions in a heap during computing.
  • Accesses - the number of accesses to nodes during computing.
  • Expansions - the number of expansions of nodes during computing.
  • Time.

Massive tests

To run tests you need to have wandb account to log statistics. To give it go to their official cite. Then you install wandb and login, you can run massive tests. To do this run:

python massive_tests.py

To modify test settings go to script and change parameters:

  • maps - task files for maps. If you want to run your own map, create it according to MovingAI pattern, save in maps directory and then preprocess it with create_tests.py. For this purpose write your filename in main function in this script and run it locally.

    python create_tests.py

    This script rewrites your task files, and you now can use them.

  • windows - list of window sizes will be used.

This massive tests run all your tasks with A* and D* Lite.

Visualization

If you want to see how agent moves on a map, use animation.py. Change arguments inrunner.run(algorithm, start, finish, True) on that you want. Then you can just run:

python animation.py

And giff file will be generated, also script prints you some statistics.

About

Implementation of D* Lite for robot navigation problem


Languages

Language:Python 100.0%