This is the starter code for the Route Planning project. Instructions for each exercise can be found in the instructions
directory, and unit tests for some exercises in the test
directory.
When cloning this project, be sure to use the --recurse-submodules
flag. Using HTTPS:
git clone https://github.com/reinaldoossuna/CppND-Route-Planning-Project --recurse-submodules
If you want to use Docker to build this project, you need first to compile the Docker image.
Dockerfile is almost the same as in https://github.com/MrD504/cpp-route-docker, i did just some change to the entrypoint and the folder of the thirdpart
docker build -t cpp .
add this line to your .bashrc
alias rrp='docker run --rm -v <global-path-to>/CppND-Route-Planning-Project/:/CppND-Route-Planning-Project cpp'
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
rrp cmake ..
rrp make
The executables will be placed in the bin
directory. From within build
, you can run the project as follows:
../bin/<name-of-parent-directory> -f ../map.osm
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
rrp cmake -DTESTING="RouteModel"..
rrp 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" |