-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
executable file
·139 lines (117 loc) · 4.6 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
################################################################################
# Set minimum required version of cmake, project name and compile options
################################################################################
cmake_minimum_required(VERSION 2.8.3)
project(humanoid_localization)
################################################################################
# Find catkin packages and libraries for catkin and system dependencies
################################################################################
find_package(catkin REQUIRED COMPONENTS
roscpp
std_msgs
std_srvs
sensor_msgs
geometry_msgs
octomap_msgs
visualization_msgs
cmake_modules
tf
message_filters
message_generation
octomap_ros
pcl_ros
pcl_conversions
)
find_package(Boost REQUIRED COMPONENTS random)
find_package(Eigen3 REQUIRED)
# required for OpenMP
find_package(OpenMP)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
SET(LIBRARIES mapmodel motionmodel observationmodel raycastingmodel)
# add service
add_service_files(FILES SrvParticlefilter.srv)
generate_messages(DEPENDENCIES std_msgs)
find_package(dynamicEDT3D)
if (${dynamicEDT3D_FOUND})
include_directories(${DYNAMICEDT3D_INCLUDE_DIRS})
link_directories(${DYNAMICEDT3D_LIBRARY_DIRS})
link_libraries(${OCTOMAP_LIBRARIES} ${DYNAMICEDT3D_LIBRARIES})
list(APPEND LIBRARIES endpointmodel)
else (${dynamicEDT3D_FOUND})
MESSAGE(WARNING "dynamicEDT3D library (part of OctoMap >1.5) not found, skipping endpoint model")
add_definitions(-DSKIP_ENDPOINT_MODEL)
endif (${dynamicEDT3D_FOUND})
################################################################################
# Setup for python modules and scripts
################################################################################
################################################################################
# Declare ROS messages, services and actions
################################################################################
################################################################################
# Declare ROS dynamic reconfigure parameters
################################################################################
################################################################################
# Declare catkin specific configuration to be passed to dependent projects
################################################################################
catkin_package(
INCLUDE_DIRS include
LIBRARIES ${LIBRARIES} humanoidlocalization
CATKIN_DEPENDS
roscpp
std_msgs
std_srvs
sensor_msgs
geometry_msgs
octomap_msgs
visualization_msgs
cmake_modules
tf
message_filters
octomap_ros
pcl_ros
pcl_conversions
DEPENDS Boost EIGEN3
)
################################################################################
# Build
################################################################################
include_directories(
include
${catkin_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
)
if (${dynamicEDT3D_FOUND})
add_library(endpointmodel src/EndpointModel.cpp)
endif (${dynamicEDT3D_FOUND})
add_library(mapmodel src/MapModel.cpp)
add_library(motionmodel src/MotionModel.cpp)
add_library(observationmodel src/ObservationModel.cpp)
add_library(raycastingmodel src/RaycastingModel.cpp)
target_link_libraries(raycastingmodel observationmodel ${catkin_LIBRARIES})
add_library(humanoidlocalization src/HumanoidLocalization.cpp)
target_link_libraries(humanoidlocalization ${catkin_LIBRARIES} ${LIBRARIES})
add_executable(localization_node src/localization_node.cpp)
target_link_libraries(localization_node humanoidlocalization ${catkin_LIBRARIES})
################################################################################
# Install
################################################################################
install(TARGETS ${LIBRARIES} humanoidlocalization
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(TARGETS localization_node
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)
install(DIRECTORY config launch
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
################################################################################
# Test
################################################################################