This is the first project from Udacity's C++ Nanodegree Program. It covers the fundamentals of the coding language C++ and the A* search algorithm using real map data from the OpenStreetMap project.
- Implement the A* algorithm to find the shortest path between to given points.
- Allow the user to input start and goal coordinates
The project is divided into different files.
src/main.cpp
: the i/o code and call of the planning and rendering algorithmssrc/model.cpp
(and header file): data structures and functions for OpenStreetMap functionalitysrc/render.cpp
(and header file): functions for displaying resultssrc/route_model.cpp
(and header file): modification of the basic model data structuresrc/route_planner.cpp
(and header file): implementation of the A* algorithm- other helper, build and installation files
This project needs following dependencies:
- cmake >= 3.11.3
- make >= 4.1 (Linux, Mac), 3.81 (Windows)
- gcc/g++ >= 7.4.0
- IO2D
- Installation instructions for all operating systems can be found here
- This library must be built in a place where CMake
find_package
will be able to find it
- Clone this repository.
- Create a build directory:
mkdir build && cd build
- Compile:
cmake .. && make
- Run it:
./OSM_A_star_search
or to specify a map file:./OSM_A_star_search -f ../<your_osm_file.osm>
.
Here you can see an example result (values: X(10,10) and Y(90,90)):