-
Notifications
You must be signed in to change notification settings - Fork 17
/
CMakeLists.txt
120 lines (98 loc) · 2.27 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
cmake_minimum_required(VERSION 3.0.2)
project(mpc_tracker)
add_compile_options(-std=c++17)
add_compile_options(-Wall -Wextra)
# add_compile_options(-O3 -march=native -fopenmp)
add_compile_options(-O3 -fopenmp)
find_package(catkin REQUIRED COMPONENTS
# autoware_msgs
geometry_msgs
nav_msgs
roscpp
tf2
tf2_ros
tf2_geometry_msgs
)
find_package( Eigen3 REQUIRED )
if(${EIGEN3_FOUND})
message("-- Found Eigen version ${EIGEN3_VERSION}: ${EIGEN3_INCLUDE_DIRS}")
else()
message(STATUS "Eigen3 is NOT found")
endif()
catkin_package(
INCLUDE_DIRS
include
CATKIN_DEPENDS
# autoware_msgs
geometry_msgs
nav_msgs
roscpp
tf2
tf2_ros
tf2_geometry_msgs
)
include_directories(
include
${catkin_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}
)
set(
MPC_TRACKER_SRC
src/course_manager.cpp
src/frenet_serret_converter.cpp
src/mpc_simulator.cpp
src/frenet_state_filter.cpp
src/mpc_formulation.cpp
)
set(
CGMRES_SOLVER_SRC
src/cgmres_solver/continuation_gmres.cpp
src/cgmres_solver/single_shooting_continuation.cpp
src/cgmres_solver/single_shooting_ocp.cpp
src/cgmres_solver/time_varying_smooth_horizon.cpp
src/cgmres_solver/cgmres_initializer.cpp
src/cgmres_solver/zero_horizon_ocp.cpp
src/cgmres_solver/optimal_control_problem.cpp
src/cgmres_solver/linear_algebra.cpp
)
add_executable(mpc_tracker_node
src/mpc_tracker_core.cpp
src/mpc_tracker_node.cpp
${MPC_TRACKER_SRC}
${CGMRES_SOLVER_SRC}
)
add_dependencies(mpc_tracker_node
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS})
target_link_libraries(mpc_tracker_node
${catkin_LIBRARIES}
)
find_package(Python3 COMPONENTS Interpreter Development NumPy REQUIRED)
find_package(Python3 COMPONENTS NumPy)
add_executable(simulation
simulation/simulation.cpp
${MPC_TRACKER_SRC}
${CGMRES_SOLVER_SRC}
)
target_link_libraries(simulation
Python3::Python
Python3::Module
Python3::NumPy
)
target_link_libraries(simulation
${catkin_LIBRARIES}
)
install(
TARGETS
mpc_tracker_node
simulation
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(
DIRECTORY
launch
config
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)