# Route-Planner **Repository Path**: canleng/Route-Planner ## Basic Information - **Project Name**: Route-Planner - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-11-18 - **Last Updated**: 2024-11-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Route Planning Project This is a Route Planning project for Udacity C++ Nanodegree. This Route Planner uses A* algorithm to find the shortest path. It uses OpenStreet Map data for and io2d rendering library to display the route on a map. Instructions for each exercise can be found in the `instructions` directory, and unit tests for some exercises in the `test` directory. ## Cloning When cloning this project, be sure to use the `--recurse-submodules` flag. Using HTTPS: ``` git clone https://github.com/arjun7965/Route-Planner.git --recurse-submodules ``` or with SSH: ``` git clone git@github.com:arjun7965/Route-Planner.git --recurse-submodules ``` ## Compiling and Running ### Compiling To compile the project, first, create a `build` directory and change to that directory: ``` mkdir build && cd build ``` From within the `build` directory, then run `cmake` and `make` as follows: ``` cmake .. make ``` ### Running The executables will be placed in the `bin` directory. From within `build`, you can run the project as follows: ``` ../bin/ -f ../map.osm ``` ## Testing For exercises that have unit tests, the project must be built with the approprate test cpp file. This can be done by passing a string with the `-DTESTING` flag in `cmake`. For example, from the build directory: ``` cmake -DTESTING="RouteModel" .. make ``` Those commands will build the code with the tests for the "Fill Out Route Model" exercise. The tests can then be run from the `build` directory as follows: ``` ../bin/test ``` Exercises with tests will specify which string to pass with `-DTESTING`, but a table is given below with the complete list for reference: | Exercise Name | `-DTESTING` String Value | |-----------------------------|:------------------------:| | Fill Out Route Model | "RouteModel" | | Fill Out Node Class | "RMNodeClass" | | Create RouteModel Nodes | "RMSNodes" | | Write the Distance Function | "NodeDist" | | Create Road to Node Hashmap | "NodeToRoad" | | Write FindNeighbors | "FindNeighbors" | | Find the Closest Node | "FindClosest" | | Write the A\* Search Stub | "AStarStub" | | Finish A\* Search | "AStarSearch" | ### Output After you compile the program, you can run the executables which are in the `bin` directory. The executable requires path to the OpenStreetMap XML file which is placed in the project folder as `map.osm`. You need to enter start and end coordinates within 0-100. A sample output: ![alt text](https://github.com/arjun7965/Route-Planner/blob/master/images/Output.png)