All Projects → Eurecat → astar-gridmap-2d

Eurecat / astar-gridmap-2d

Licence: Apache-2.0 license
A* algorithms for 2D gridmaps. The fastest one, until you prove me wrong

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to astar-gridmap-2d

unity-pathfinding
Find paths in Unity Tilemaps with A* Search
Stars: ✭ 70 (+62.79%)
Mutual labels:  astar, pathfinding, 2d
Pathfinding
A pmmp virion (library) for pathfinding using A*
Stars: ✭ 36 (-16.28%)
Mutual labels:  astar, pathfinding
path planning GAN
Path Planning using Generative Adversarial Network (GAN)
Stars: ✭ 36 (-16.28%)
Mutual labels:  pathfinding, path-planning
NavMeshDemo
Unity client navmesh export to server for pathfinding
Stars: ✭ 31 (-27.91%)
Mutual labels:  astar, pathfinding
PathFinding
C# project. Realized a visualization of the pathfinding algorithms using Console (2D version), Windows Forms (2D version) and WPF (2D and 3D versions)
Stars: ✭ 18 (-58.14%)
Mutual labels:  pathfinding, 2d
CLF reactive planning system
This package provides a CLF-based reactive planning system, described in paper: Efficient Anytime CLF Reactive Planning System for a Bipedal Robot on Undulating Terrain. The reactive planning system consists of a 5-Hz planning thread to guide a robot to a distant goal and a 300-Hz Control-Lyapunov-Function-based (CLF-based) reactive thread to co…
Stars: ✭ 21 (-51.16%)
Mutual labels:  pathfinding, path-planning
path demo
An experimental set of pathfinding algorithms for video games
Stars: ✭ 16 (-62.79%)
Mutual labels:  astar, pathfinding
tektosyne
The Tektosyne Library for Java provides algorithms for computational geometry and graph-based pathfinding, along with supporting mathematical utilities and specialized collections.
Stars: ✭ 52 (+20.93%)
Mutual labels:  astar, pathfinding
Baritone
google maps for block game
Stars: ✭ 3,868 (+8895.35%)
Mutual labels:  astar, pathfinding
Graphhopper
Open source routing engine for OpenStreetMap. Use it as Java library or standalone web server.
Stars: ✭ 3,457 (+7939.53%)
Mutual labels:  astar, pathfinding
NavMeshSurface2DBaker
NavMeshSurface2DBaker is a Unity Package that provides functionality to bake 2D colliders into NavMeshSurface components.
Stars: ✭ 33 (-23.26%)
Mutual labels:  pathfinding, 2d
Easystarjs
An asynchronous A* pathfinding API written in Javascript.
Stars: ✭ 1,743 (+3953.49%)
Mutual labels:  astar, pathfinding
surfacer
AI and pathfinding for 2D-platformers in Godot.
Stars: ✭ 56 (+30.23%)
Mutual labels:  pathfinding, 2d
Navmeshplus
Unity NavMesh 2D Pathfinding
Stars: ✭ 347 (+706.98%)
Mutual labels:  pathfinding, 2d
astar-typescript
A* search algorithm in TypeScript
Stars: ✭ 37 (-13.95%)
Mutual labels:  astar, pathfinding
Pathplanning
Common used path planning algorithms with animations.
Stars: ✭ 3,418 (+7848.84%)
Mutual labels:  astar, path-planning
pathfinding-visualizer
Website built using React Framework for visualizing Pathfinding and Maze Generation Algorithms.
Stars: ✭ 33 (-23.26%)
Mutual labels:  astar, pathfinding
TrajectoryPlanner
ROS - based trajectory planning for a robot on OccupancyGrid
Stars: ✭ 26 (-39.53%)
Mutual labels:  astar
rectangle-pack
A general purpose, deterministic bin packer designed to conform to any two or three dimensional use case.
Stars: ✭ 60 (+39.53%)
Mutual labels:  2d
VXA-OS
Most complete and secure free 2D online game creation tool from RPG Maker.
Stars: ✭ 14 (-67.44%)
Mutual labels:  2d

A* for 2D grids

This is an implementation of the A* path planning algorithm, specifically tailored for 2D grids.

It is inspired by other two open source implementations:

Nevertheless, this implementation is 20% faster.

You might want to take a look to astar-algorithm-cpp, but that implementation is more generic and it is not specifically optimized for 2D gridmaps.

To improve speed, the library uses a fairly large amount of RAM to perform many operations in O(1). The number of memory allocations is reduced to the very minimum.

It requires at least 8 bytes for each cell in the grid, in other words, more than 8 Mb of memory for a 1000x1000 gridmap.

How fast is it?

Even if a fair amount of work was spent (mostly for fun) to optimize this software, it is still an A* algorithm, that will be outperformed by other, more advanced, algorithms.

If you are looking for state-of-the-art path finders, you might be interested to www.movingai.com

This particularly implementation is efficient but also easy to read and understand.

Usage

You must pass the image using the method setWorldData().

Note that the the image data must be row-major and monochromatic.

A value of 0 (black) represents an obstacle, whilst 255 (white) is a free cell.

    // You don't need to use this image parser, you can use your own.   
    Image image;
    image.readFromPGM("./data/maze_big.pgm");

    AStar::PathFinder generator;

    generator.setWorldData( image.width(),
                            image.height(),
                            image.data() );
                
    AStar::Coord2D startPos (image.width()/2, 0);
    AStar::Coord2D targetPos(image.width()/2, image.height()/2 -1);
               
    auto path = generator.findPath(startPos, targetPos);

In the following example, the algorithm required about 200 milliseconds and 25 Mb of RAM to find the solution in a 1586x1586 maze.

The pink pixels represent the cells of the grid visited by the algorithm.

Large map

License

Copyright 2018-2019 Eurecat

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

References

Introduction to A*

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].