-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+CMakeList.txt
- Loading branch information
Showing
6 changed files
with
103 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ | |
*.a | ||
*.so | ||
*.dylib | ||
*.dll | ||
*.dll | ||
**/build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
project(MyProject) | ||
|
||
# Set C++ 11 standard | ||
set(CMAKE_CXX_STANDARD 11) | ||
|
||
# Add subdirectories and compile separately | ||
add_subdirectory(monte_carlo_tree_search) | ||
add_subdirectory(rapidly_exploring_random_tree) | ||
|
||
# Clean all | ||
add_custom_target(clean_all | ||
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target clean | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
## Robot Path Planning | ||
* [Monte Carlo Tree Search](monte_carlo_tree_search/README.md) | ||
* [Rapidly Exploring Random Tree](rapidly_exploring_random_tree/README.md) | ||
* [Rapidly Exploring Random Tree (RRT)](rapidly_exploring_random_tree/README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
project(mcts_project) | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_FLAGS "-Wall") | ||
|
||
# Load configs from config.properties | ||
file(READ ${CMAKE_CURRENT_LIST_DIR}/config.properties CONFIG_CONTENT) | ||
|
||
string(REGEX MATCH "CONFIG_GRID_SIZE=[0-9]+" GRID_SIZE_MATCH ${CONFIG_CONTENT}) | ||
string(REGEX MATCH "CONFIG_GOAL_X=[0-9]+" GOAL_X_MATCH ${CONFIG_CONTENT}) | ||
string(REGEX MATCH "CONFIG_GOAL_Y=[0-9]+" GOAL_Y_MATCH ${CONFIG_CONTENT}) | ||
string(REGEX MATCH "CONFIG_MAX_SIM_STEPS=[0-9]+" MAX_SIM_STEPS_MATCH ${CONFIG_CONTENT}) | ||
string(REGEX MATCH "CONFIG_C=[0-9.]+" CONFIG_C_MATCH ${CONFIG_CONTENT}) | ||
|
||
# config values | ||
string(REPLACE "CONFIG_GRID_SIZE=" "" CONFIG_GRID_SIZE ${GRID_SIZE_MATCH}) | ||
string(REPLACE "CONFIG_GOAL_X=" "" CONFIG_GOAL_X ${GOAL_X_MATCH}) | ||
string(REPLACE "CONFIG_GOAL_Y=" "" CONFIG_GOAL_Y ${GOAL_Y_MATCH}) | ||
string(REPLACE "CONFIG_MAX_SIM_STEPS=" "" CONFIG_MAX_SIM_STEPS ${MAX_SIM_STEPS_MATCH}) | ||
string(REPLACE "CONFIG_C=" "" CONFIG_C ${CONFIG_C_MATCH}) | ||
|
||
# compile options | ||
add_compile_definitions( | ||
CONFIG_GRID_SIZE=${CONFIG_GRID_SIZE} | ||
CONFIG_GOAL_X=${CONFIG_GOAL_X} | ||
CONFIG_GOAL_Y=${CONFIG_GOAL_Y} | ||
CONFIG_MAX_SIM_STEPS=${CONFIG_MAX_SIM_STEPS} | ||
CONFIG_C=${CONFIG_C} | ||
) | ||
|
||
# source | ||
set(SRC | ||
src/main.cpp | ||
src/mcts.cpp | ||
src/state.cpp | ||
) | ||
|
||
# header | ||
include_directories(include) | ||
|
||
# executable file | ||
add_executable(mcts.so ${SRC}) | ||
|
||
# clean | ||
add_custom_target(clean_mcts | ||
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/mcts.so | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
project(rrt_project) | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_FLAGS "-Wall") | ||
|
||
# Set dir of include, src and obj | ||
set(INCDIR ${CMAKE_SOURCE_DIR}/include) | ||
set(SRCDIR ${CMAKE_SOURCE_DIR}/src) | ||
set(OBJDIR ${CMAKE_BINARY_DIR}/obj) | ||
|
||
# Set obj files and src files | ||
set(SRCFILES ${CMAKE_CURRENT_LIST_DIR}/src/rrt.cpp ${CMAKE_CURRENT_LIST_DIR}/src/main.cpp) | ||
set(OBJFILES ${OBJDIR}/rrt.o ${OBJDIR}/main.o) | ||
|
||
# Include Dir | ||
include_directories(${INCDIR}) | ||
|
||
# Add an object library to control the generation of object files | ||
add_library(rrt_objects OBJECT ${SRCFILES}) | ||
|
||
# Set the output directory to the obj folder | ||
set_target_properties(rrt_objects PROPERTIES | ||
ARCHIVE_OUTPUT_DIRECTORY ${OBJDIR} | ||
LIBRARY_OUTPUT_DIRECTORY ${OBJDIR} | ||
RUNTIME_OUTPUT_DIRECTORY ${OBJDIR} | ||
) | ||
|
||
# executable file | ||
add_executable(rrt.so $<TARGET_OBJECTS:rrt_objects>) | ||
|
||
# clean | ||
add_custom_target(clean_rrt | ||
COMMAND ${CMAKE_COMMAND} -E remove_directory ${OBJDIR} | ||
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/rrt.so | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
## Rapidly Exploring Random Tree | ||
## Rapidly Exploring Random Tree (RRT) |