-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
87 lines (70 loc) · 2.43 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
cmake_minimum_required(VERSION 3.5)
project(mpc_ros)
## Compile as C++11, supported in ROS Kinetic and newer
add_definitions(-std=c++11 -O3)
# options for build configuration
option(BUILD_EXAMPLE "Whether or not building the CppAD & Ipopt example" OFF)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
costmap_2d
dynamic_reconfigure
geometry_msgs
nav_msgs
#ackermann_msgs
pluginlib
message_generation
move_base
base_local_planner
roscpp
rospy
std_msgs
tf
visualization_msgs
)
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories( ${catkin_INCLUDE_DIRS} include )
include_directories(/usr/include)
link_directories(/usr/lib)
# dynamic reconfigure
generate_dynamic_reconfigure_options(
cfg/MPCPlanner.cfg
)
catkin_package(
INCLUDE_DIRS include
LIBRARIES mpc_ros
CATKIN_DEPENDS costmap_2d dynamic_reconfigure geometry_msgs move_base roscpp rospy std_msgs tf visualization_msgs pluginlib
# DEPENDS system_lib
)
###########
## Build ##
###########
# General MPC_Node
ADD_EXECUTABLE( MPC_Node src/MPC.cpp src/MPC_Node.cpp )
TARGET_LINK_LIBRARIES(MPC_Node ipopt ${catkin_LIBRARIES} )
# Total navigation with MPC_Node
ADD_EXECUTABLE( nav_mpc src/navMPC.cpp src/navMPCNode.cpp )
TARGET_LINK_LIBRARIES(nav_mpc ipopt ${catkin_LIBRARIES} )
# Local planner with MPC_Node for tracking
ADD_EXECUTABLE( tracking_reference_trajectory src/trackRefTraj.cpp src/trackRefTrajNode.cpp )
TARGET_LINK_LIBRARIES(tracking_reference_trajectory ipopt ${catkin_LIBRARIES} )
# Pure Pursuit Node
add_executable(Pure_Pursuit src/Pure_Pursuit.cpp)
target_link_libraries(Pure_Pursuit ${catkin_LIBRARIES})
# Own Global planner for tracking desired trajectory
add_library(global_planner_lib src/global_planner/global_planner.cpp)
TARGET_LINK_LIBRARIES(global_planner_lib ipopt ${catkin_LIBRARIES} )
# MPC Local planner plugin
add_library(mpc_ros src/mpc_plannner_ros.cpp src/mpc_plannner.cpp)
TARGET_LINK_LIBRARIES(mpc_ros ipopt ${catkin_LIBRARIES} )
#############
## Example ##
#############
if(BUILD_EXAMPLE)
ADD_EXECUTABLE( CppAD_started example/CppAD_started.cpp )
TARGET_LINK_LIBRARIES(CppAD_started)
ADD_EXECUTABLE( CppAD_Ipopt example/CppAD_Ipopt.cpp )
TARGET_LINK_LIBRARIES(CppAD_Ipopt ipopt)
endif(BUILD_EXAMPLE)