-
Notifications
You must be signed in to change notification settings - Fork 38
/
CMakeLists.txt
121 lines (108 loc) · 2.55 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
cmake_minimum_required(VERSION 3.0.2)
add_compile_options(-std=c++17 -Wall -Wextra -Wpedantic -Werror)
project(path_tracking_pid)
## Find catkin and any catkin packages
find_package(catkin REQUIRED
COMPONENTS
actionlib
actionlib_msgs
dynamic_reconfigure
geometry_msgs
mbf_costmap_core
mbf_msgs
message_generation
nav_msgs
pluginlib
roscpp
roslint
rostest
std_msgs
tf2
tf2_geometry_msgs
tf2_ros
visualization_msgs
)
add_message_files(
FILES
PidDebug.msg
PidFeedback.msg
)
generate_dynamic_reconfigure_options(
cfg/Pid.cfg
)
generate_messages(
DEPENDENCIES
actionlib_msgs
geometry_msgs
nav_msgs
std_msgs
)
catkin_package(
CATKIN_DEPENDS
actionlib
actionlib_msgs
dynamic_reconfigure
geometry_msgs
mbf_costmap_core
mbf_msgs
message_runtime
nav_msgs
pluginlib
roscpp
std_msgs
tf2_geometry_msgs
tf2_ros
visualization_msgs
)
add_library(${PROJECT_NAME}
src/${PROJECT_NAME}_local_planner.cpp
src/controller.cpp
src/calculations.cpp
src/details/derivative.cpp
src/details/integral.cpp
src/details/second_order_lowpass.cpp
src/visualization.cpp
)
add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS} ${PROJECT_NAME}_gencfg)
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES})
include_directories(SYSTEM ${catkin_INCLUDE_DIRS} ${dynamic_reconfigure_PACKAGE_PATH}/cmake/cfgbuild.cmake)
include_directories(include)
# Configure roslint for nodes
# Roslint cpp
set(ROSLINT_CPP_OPTS "--filter=-legal/copyright,-whitespace/braces")
roslint_cpp()
roslint_add_test()
install(
TARGETS
${PROJECT_NAME}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
)
# Install files
install(
FILES
README.md
${PROJECT_NAME}_plugin.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
# Install directories
install(
DIRECTORY
doc
launch
param
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
if(CATKIN_ENABLE_TESTING)
add_rostest(test/test_path_tracking_pid.test ARGS rviz:=false reconfigure:=false)
catkin_add_gtest(unittests
test/unittests/test_calculations.cpp
test/unittests/test_derivative.cpp
test/unittests/test_fifo_array.cpp
test/unittests/test_integral.cpp
test/unittests/test_main.cpp
test/unittests/test_second_order_lowpass.cpp
)
target_link_libraries(unittests ${catkin_LIBRARIES} ${PROJECT_NAME})
endif()