forked from ros-navigation/navigation2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
157 lines (128 loc) · 3.19 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
cmake_minimum_required(VERSION 3.5)
project(nav2_behaviors)
find_package(ament_cmake REQUIRED)
find_package(nav2_common REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_action REQUIRED)
find_package(rclcpp_lifecycle REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(std_msgs REQUIRED)
find_package(nav2_behavior_tree REQUIRED)
find_package(nav2_util REQUIRED)
find_package(nav2_msgs REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(tf2 REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(nav2_costmap_2d REQUIRED)
find_package(nav2_core REQUIRED)
find_package(pluginlib REQUIRED)
nav2_package()
include_directories(
include
)
set(library_name behavior_server_core)
set(executable_name behavior_server)
set(dependencies
rclcpp
rclcpp_action
rclcpp_lifecycle
rclcpp_components
std_msgs
nav2_util
nav2_behavior_tree
nav2_msgs
nav_msgs
tf2
tf2_geometry_msgs
geometry_msgs
nav2_costmap_2d
nav2_core
pluginlib
)
# plugins
add_library(nav2_spin_behavior SHARED
plugins/spin.cpp
)
ament_target_dependencies(nav2_spin_behavior
${dependencies}
)
add_library(nav2_wait_behavior SHARED
plugins/wait.cpp
)
ament_target_dependencies(nav2_wait_behavior
${dependencies}
)
add_library(nav2_drive_on_heading_behavior SHARED
plugins/drive_on_heading.cpp
)
ament_target_dependencies(nav2_drive_on_heading_behavior
${dependencies}
)
add_library(nav2_back_up_behavior SHARED
plugins/back_up.cpp
)
ament_target_dependencies(nav2_back_up_behavior
${dependencies}
)
add_library(nav2_assisted_teleop_behavior SHARED
plugins/assisted_teleop.cpp
)
ament_target_dependencies(nav2_assisted_teleop_behavior
${dependencies}
)
pluginlib_export_plugin_description_file(nav2_core behavior_plugin.xml)
# Library
add_library(${library_name} SHARED
src/behavior_server.cpp
)
ament_target_dependencies(${library_name}
${dependencies}
)
# Executable
add_executable(${executable_name}
src/main.cpp
)
target_link_libraries(${executable_name} ${library_name})
ament_target_dependencies(${executable_name}
${dependencies}
)
rclcpp_components_register_nodes(${library_name} "behavior_server::BehaviorServer")
install(TARGETS ${library_name}
nav2_spin_behavior
nav2_wait_behavior
nav2_assisted_teleop_behavior
nav2_drive_on_heading_behavior
nav2_back_up_behavior
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
install(TARGETS ${executable_name}
RUNTIME DESTINATION lib/${PROJECT_NAME}
)
install(DIRECTORY include/
DESTINATION include/
)
install(FILES behavior_plugin.xml
DESTINATION share/${PROJECT_NAME}
)
install(DIRECTORY plugins/
DESTINATION share/${PROJECT_NAME}/plugins/
)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
find_package(ament_cmake_gtest REQUIRED)
add_subdirectory(test)
endif()
ament_export_include_directories(include)
ament_export_libraries(${library_name}
nav2_spin_behavior
nav2_wait_behavior
nav2_assisted_teleop_behavior
nav2_drive_on_heading_behavior
nav2_back_up_behavior
)
ament_export_dependencies(${dependencies})
ament_package()