forked from LiJiangnanBit/path_optimizer_2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
112 lines (92 loc) · 3.14 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
cmake_minimum_required(VERSION 3.5)
project(path_optimizer_2)
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(ros2_viz_tools REQUIRED)
find_package(grid_map_ros REQUIRED)
find_package(tinyspline_ros REQUIRED)
find_package(tf2 REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)
find_package(OsqpEigen REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(OpenCV 4 REQUIRED)
find_package(gflags REQUIRED)
set(DEPENDENCIES
"rclcpp"
"ros2_viz_tools"
"grid_map_ros"
"tinyspline_ros"
"tf2"
"tf2_ros"
"tf2_geometry_msgs"
)
include_directories(
include
${OpenCV_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}
)
add_library(${PROJECT_NAME}
src/tools/tools.cpp
src/tools/spline.cpp
src/path_optimizer.cpp
src/tools/collision_checker.cpp
src/reference_path_smoother/reference_path_smoother.cpp
src/tools/Map.cpp
src/tools/car_geometry.cpp
src/solver/base_solver.cpp
src/data_struct/date_struct.cpp
src/data_struct/reference_path_impl.cpp
src/data_struct/reference_path.cpp
src/data_struct/vehicle_state_frenet.cpp
src/config/planning_flags.cpp
src/reference_path_smoother/tension_smoother.cpp
src/reference_path_smoother/tension_smoother_2.cpp
src/tools/time_recorder.cpp)
target_link_libraries(${PROJECT_NAME} glog gflags OsqpEigen::OsqpEigen osqp::osqp)
ament_target_dependencies(${PROJECT_NAME} ${DEPENDENCIES})
add_executable(${PROJECT_NAME}_demo src/test/demo.cpp)
target_link_libraries(${PROJECT_NAME}_demo ${PROJECT_NAME} ${OpenCV_LIBRARIES})
ament_target_dependencies(${PROJECT_NAME}_demo ${DEPENDENCIES})
add_library(${PROJECT_NAME}_ilqr
src/path/data_structure.cpp
src/path/reference_line.cpp
src/path/spline.cpp
src/path/free_space.cpp
src/path/tool.cpp
src/path/free_space.cpp
src/path/gflags.cpp
src/solver/solver.cpp
src/solver/problem_manager.cpp
src/path/path_problem_manager.cpp
)
target_link_libraries(${PROJECT_NAME}_ilqr glog gflags OsqpEigen::OsqpEigen osqp::osqp)
ament_target_dependencies(${PROJECT_NAME}_ilqr ${DEPENDENCIES})
add_executable(${PROJECT_NAME}_demo_ilqr
src/test/demo_ilqr.cpp
src/test/Map.cpp
src/test/reference_line_processor.cpp)
target_link_libraries(${PROJECT_NAME}_demo_ilqr ${PROJECT_NAME}_ilqr ${OpenCV_LIBRARIES})
ament_target_dependencies(${PROJECT_NAME}_demo_ilqr ${DEPENDENCIES})
# install(TARGETS ${PROJECT_NAME}_demo ${PROJECT_NAME}
install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_ilqr
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
install(TARGETS ${PROJECT_NAME}_demo ${PROJECT_NAME}_demo_ilqr
DESTINATION lib/${PROJECT_NAME}
)
install(
DIRECTORY config launch cmake script
DESTINATION share/${PROJECT_NAME}
)
ament_export_dependencies(${DEPENDENCIES})
ament_package()