-
Notifications
You must be signed in to change notification settings - Fork 18
/
CMakeLists.txt
126 lines (91 loc) · 4.49 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
cmake_minimum_required(VERSION 3.1)
project(LEARN_ROBOTICS_CPP)
set(CMAKE_CXX_STANDARD 17)
# set(CMAKE_BUILD_TYPE Debug)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
#############################
#Dependencies
#############################
find_package(Eigen3 REQUIRED)
find_package(OpenCV REQUIRED)
find_package(Boost 1.67.0 COMPONENTS filesystem system iostreams program_options REQUIRED)
find_package(Ceres REQUIRED)
find_package(ompl REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR})
include_directories(include)
include_directories(${OMPL_INCLUDE_DIRS})
include_directories(/usr/local/include)
link_directories(/usr/local/lib)
# Create library
## Declare a cpp library
add_library(${PROJECT_NAME}_core
src/common.cpp
# localization
src/localization/filters.cpp
src/localization/ekf.cpp
src/localization/ukf.cpp
src/localization/particle_filter.cpp
# path tracking
src/path_tracking/mpc.cpp
src/path_tracking/move_to_pose.cpp
src/path_tracking/stanley_control.cpp
# path planning
src/path_planning/potential_field.cpp
src/path_planning/quintic_polynomial.cpp
src/path_planning/trajectory_optimizer.cpp
src/path_planning/state_lattice.cpp
src/path_planning/cubic_spline.cpp
src/path_planning/dwa.cpp
src/path_planning/prm.cpp
src/path_planning/grid_search.cpp
src/path_planning/rrt.cpp
src/path_planning/rrt_star.cpp
)
# ##############################
# #Localization
# ##############################
add_executable(ekf examples/localization/example_ekf.cpp)
target_link_libraries(ekf ${Boost_LIBRARIES} ${PROJECT_NAME}_core)
add_executable(ukf examples/localization/example_ukf.cpp)
target_link_libraries(ukf ${Boost_LIBRARIES} ${PROJECT_NAME}_core)
add_executable(particle_filter examples/localization/example_particle_filter.cpp)
target_link_libraries(particle_filter ${Boost_LIBRARIES} ${PROJECT_NAME}_core)
# ##############################
# #PathPlanning
# ##############################
add_executable(dijkstra examples/path_planning/example_dijkstra.cpp)
target_link_libraries(dijkstra ${Boost_LIBRARIES} ${PROJECT_NAME}_core)
add_executable(astar examples/path_planning/example_astar.cpp)
target_link_libraries(astar ${Boost_LIBRARIES} ${PROJECT_NAME}_core)
add_executable(prm examples/path_planning/example_prm.cpp) # use opencv for kdtree
target_link_libraries(prm ${OpenCV_LIBS} ${Boost_LIBRARIES} ${PROJECT_NAME}_core)
add_executable(rrt examples/path_planning/example_rrt.cpp)
target_link_libraries(rrt ${Boost_LIBRARIES} ${PROJECT_NAME}_core)
add_executable(rrt_star examples/path_planning/example_rrt_star.cpp)
target_link_libraries(rrt_star ${Boost_LIBRARIES} ${PROJECT_NAME}_core)
add_executable(potential_field examples/path_planning/example_potential_field.cpp)
target_link_libraries(potential_field ${Boost_LIBRARIES} ${PROJECT_NAME}_core)
add_executable(dwa examples/path_planning/example_dwa.cpp)
target_link_libraries(dwa ${Boost_LIBRARIES} ${PROJECT_NAME}_core)
add_executable(quintic_polynomial examples/path_planning/example_quintic_polynomial.cpp)
target_link_libraries(quintic_polynomial ${Boost_LIBRARIES} ${PROJECT_NAME}_core)
add_executable(cubic_spline examples/path_planning/example_cubic_spline.cpp)
target_link_libraries(cubic_spline ${Boost_LIBRARIES} ${PROJECT_NAME}_core)
add_executable(trajectory_optimizer examples/path_planning/example_trajectory_optimizer.cpp)
target_link_libraries(trajectory_optimizer ${Boost_LIBRARIES} ${PROJECT_NAME}_core)
add_executable(lookup_table_generation examples/path_planning/example_lookup_table_generation.cpp)
target_link_libraries(lookup_table_generation ${Boost_LIBRARIES} ${PROJECT_NAME}_core)
add_executable(state_lattice examples/path_planning/example_state_lattice.cpp)
target_link_libraries(state_lattice ${Boost_LIBRARIES} ${PROJECT_NAME}_core)
add_executable(dubins examples/path_planning/example_dubins.cpp)
target_link_libraries(dubins ${Boost_LIBRARIES} ${OMPL_LIBRARIES} ${PROJECT_NAME}_core)
# ##############################
# #PathTracking
# ##############################
add_executable(move_to_pose examples/path_tracking/example_move_to_pose.cpp)
target_link_libraries(move_to_pose ${Boost_LIBRARIES} ${PROJECT_NAME}_core)
add_executable(stanley_control examples/path_tracking/example_stanley_control.cpp )
target_link_libraries(stanley_control ${Boost_LIBRARIES} ${PROJECT_NAME}_core)
add_executable(mpc examples/path_tracking/example_mpc.cpp)
target_link_libraries(mpc ${Boost_LIBRARIES} ${PROJECT_NAME}_core ipopt)