forked from sarthou/overworld
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
301 lines (264 loc) · 10.2 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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
cmake_minimum_required(VERSION 3.0.2)
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
project(overworld)
add_compile_options(-std=c++14)
if(DEFINED ENV{BULLET_INSTALL_PATH})
set(BULLET_ROOT $ENV{BULLET_INSTALL_PATH})
endif()
find_package(catkin REQUIRED COMPONENTS
roscpp
std_msgs
genmsg
message_generation
tf
tf2
tf2_ros
tf2_eigen
tf2_geometry_msgs
roslib
message_filters
sensor_msgs
visualization_msgs
geometry_msgs
cv_bridge
pluginlib
)
find_package(ontologenius 0.4.1 REQUIRED)
find_package(Eigen3 REQUIRED NO_MODULE)
find_package(Threads REQUIRED)
find_package(CURL REQUIRED)
find_package(pluginlib REQUIRED)
list(APPEND BULLET_LIB_NAMES BulletRoboticsGUI
BulletExampleBrowserLib
BulletRobotics
BulletFileLoader
BulletWorldImporter
BulletSoftBody
BulletDynamics
BulletCollision
BulletInverseDynamicsUtils
BulletInverseDynamics
LinearMath
OpenGLWindow
gwen
BussIK
Bullet3Common)
find_package(Bullet MODULE REQUIRED)
foreach(lib_name ${BULLET_LIB_NAMES})
find_library(LIB_PATH ${lib_name} ${BULLET_ROOT}/lib NO_DEFAULT_PATH)
list(APPEND BULLET_LIBS ${LIB_PATH})
unset(LIB_PATH CACHE)
endforeach()
################################################
## Declare ROS messages, services and actions ##
################################################
add_message_files(
FILES
Triplet.msg
EntityPose.msg
EntitiesPoses.msg
AgentPose.msg
AgentsPose.msg
Pose.msg
)
add_service_files(
FILES
StartStopModules.srv
BoundingBox.srv
GetAgents.srv
GetApproachPoint.srv
GetPose.srv
GetRelations.srv
)
generate_messages(
DEPENDENCIES
std_msgs
geometry_msgs
)
###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if your package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}_bullet_lib ${PROJECT_NAME}_types_lib ${PROJECT_NAME}_utility_lib
CATKIN_DEPENDS ontologenius roscpp std_msgs tf2 tf2_ros roslib
# DEPENDS system_lib
)
###########
## Build ##
###########
include_directories(
include
${ontologenius_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
${CURL_INCLUDE_DIRS}
)
add_definitions( ${EIGEN3_DEFINITIONS} )
#################
# Libraries #
#################
add_library(Bullet3 INTERFACE)
target_include_directories(Bullet3 INTERFACE ${BULLET_INCLUDE_DIRS})
target_link_libraries(Bullet3 INTERFACE
${BULLET_LIBS}
${CMAKE_DL_LIBS}
${catkin_LIBRARIES}
Threads::Threads)
add_library(${PROJECT_NAME}_utility_lib STATIC
src/Utility/YamlReader.cpp
src/Utility/Ontology.cpp
src/Utility/RosFiles.cpp
src/Utility/Wavefront.cpp
)
target_link_libraries(${PROJECT_NAME}_utility_lib PUBLIC
${catkin_LIBRARIES}
${ontologenius_LIBRARIES})
set_target_properties(${PROJECT_NAME}_utility_lib PROPERTIES POSITION_INDEPENDENT_CODE ON)
add_library(${PROJECT_NAME}_bullet_lib STATIC
src/Bullet/PhysicsServers.cpp
src/Bullet/BulletClient.cpp
)
target_link_libraries(${PROJECT_NAME}_bullet_lib PUBLIC
Bullet3
${PROJECT_NAME}_utility_lib)
set_target_properties(${PROJECT_NAME}_bullet_lib PROPERTIES POSITION_INDEPENDENT_CODE ON)
add_library(${PROJECT_NAME}_types_lib STATIC
src/Geometry/Pose.cpp
src/Geometry/Polygon.cpp
src/BasicTypes/Area.cpp
src/BasicTypes/Entity.cpp
src/BasicTypes/BodyPart.cpp
src/BasicTypes/Object.cpp
src/BasicTypes/Hand.cpp
)
target_link_libraries(${PROJECT_NAME}_types_lib PUBLIC
${catkin_LIBRARIES}
${PROJECT_NAME}_bullet_lib)
set_target_properties(${PROJECT_NAME}_types_lib PROPERTIES POSITION_INDEPENDENT_CODE ON)
add_library(${PROJECT_NAME}_perception_lib STATIC
src/Perception/Managers/AgentPerceptionManager.cpp
src/Perception/Managers/AreasPerceptionManager.cpp
src/Perception/Managers/ObjectsPerceptionManager.cpp
src/Perception/Managers/RobotsPerceptionManager.cpp
src/Perception/Managers/HumansPerceptionManager.cpp
src/Perception/Modules/ObjectsModules/ObjectsEmulatedPerceptionModule.cpp
src/Perception/Modules/HumansModules/HumansEmulatedPerceptionModule.cpp
src/Perception/Modules/AreasModules/AreasEmulatedPerceptionModule.cpp
src/Perception/PerceptionManagers.cpp
)
target_link_libraries(${PROJECT_NAME}_perception_lib PUBLIC
${catkin_LIBRARIES}
${PROJECT_NAME}_bullet_lib
${PROJECT_NAME}_types_lib
${PROJECT_NAME}_utility_lib)
add_library(${PROJECT_NAME}_facts_lib STATIC
src/Facts/Publisher/FactsPublisher.cpp
src/Facts/Publisher/OntologeniusFactsPublisher.cpp
src/Facts/FactsCalculator.cpp
)
target_link_libraries(${PROJECT_NAME}_facts_lib PUBLIC
${catkin_LIBRARIES}
${PROJECT_NAME}_bullet_lib
${PROJECT_NAME}_types_lib)
add_library(${PROJECT_NAME}_sender_lib STATIC
src/Senders/ApproachSender.cpp
src/Senders/ROSSender.cpp
src/Senders/PoseSender.cpp
src/Senders/Bernie.cpp
src/Senders/RelationsSender.cpp
)
target_link_libraries(${PROJECT_NAME}_sender_lib PUBLIC
${catkin_LIBRARIES}
Bullet3 # For b3CameraImage
${CURL_LIBRARIES}
${PROJECT_NAME}_types_lib
${PROJECT_NAME}_perception_lib)
#################
# Plugins #
#################
add_library(overworld_modules_plugin MODULE
src/Perception/Modules/ObjectsModules/StaticObjectsPerceptionModule.cpp
src/Perception/Modules/ObjectsModules/FakeObjectPerceptionModule.cpp
src/Perception/Modules/RobotsModules/JointStatePerceptionModule.cpp
src/Perception/Modules/HumansModules/StampedPosePerceptionModule.cpp
src/Perception/Modules/HumansModules/FakeHumanPerceptionModule.cpp
src/Perception/Modules/HumansModules/FakeHumansPerceptionModule.cpp
src/Perception/Modules/AreasModules/ObjAreasPerceptionModule.cpp
)
target_link_libraries(overworld_modules_plugin PUBLIC
${catkin_LIBRARIES}
${PROJECT_NAME}_bullet_lib
${PROJECT_NAME}_types_lib
${PROJECT_NAME}_utility_lib)
add_library(overworld_reasoner_plugin
src/OntologeniusPlugins/ReasonerEgocentric.cpp
)
add_dependencies(overworld_reasoner_plugin overworld_gencpp ${catkin_EXPORTED_TARGETS})
target_link_libraries(overworld_reasoner_plugin PUBLIC
${catkin_LIBRARIES}
${ontologenius_LIBRARIES})
#################
# Nodes #
#################
add_executable(${PROJECT_NAME}_node src/Nodes/overworld.cpp src/SituationAssessor.cpp)
target_link_libraries(${PROJECT_NAME}_node PRIVATE
${PROJECT_NAME}_perception_lib
${PROJECT_NAME}_sender_lib
${PROJECT_NAME}_facts_lib
${catkin_LIBRARIES}
${ontologenius_LIBRARIES})
add_dependencies(${PROJECT_NAME}_node overworld_gencpp)
add_executable(plugins src/Nodes/plugins.cpp)
target_link_libraries(plugins ${catkin_LIBRARIES}
${PROJECT_NAME}_bullet_lib)
add_executable(teleop src/Nodes/teleop.cpp)
target_link_libraries(teleop ${catkin_LIBRARIES})
add_dependencies(teleop overworld_gencpp)
#################
# Test files #
#################
add_executable(${PROJECT_NAME}_bullet_test src/TestFiles/bullet_test.cpp )
target_link_libraries(${PROJECT_NAME}_bullet_test PRIVATE
${PROJECT_NAME}_bullet_lib
${PROJECT_NAME}_types_lib
${PROJECT_NAME}_perception_lib
${PROJECT_NAME}_utility_lib
${catkin_LIBRARIES})
add_executable(${PROJECT_NAME}_fov_test src/TestFiles/fov.cpp )
target_link_libraries(${PROJECT_NAME}_fov_test PRIVATE
${PROJECT_NAME}_bullet_lib
${PROJECT_NAME}_types_lib
${PROJECT_NAME}_perception_lib
${PROJECT_NAME}_utility_lib
${PROJECT_NAME}_sender_lib
${catkin_LIBRARIES})
add_executable(${PROJECT_NAME}_multi_server_test src/TestFiles/multi_server_test.cpp )
target_link_libraries(${PROJECT_NAME}_multi_server_test PRIVATE
${PROJECT_NAME}_bullet_lib
${catkin_LIBRARIES})
add_executable(${PROJECT_NAME}_config_test src/TestFiles/config_test.cpp )
target_link_libraries(${PROJECT_NAME}_config_test PRIVATE
${PROJECT_NAME}_types_lib
${PROJECT_NAME}_perception_lib
${catkin_LIBRARIES})
add_dependencies(${PROJECT_NAME}_config_test overworld_gencpp)
add_executable(${PROJECT_NAME}_gravity_test src/TestFiles/gravity.cpp )
target_link_libraries(${PROJECT_NAME}_gravity_test PRIVATE
${PROJECT_NAME}_types_lib
${PROJECT_NAME}_bullet_lib
${catkin_LIBRARIES})
add_dependencies(${PROJECT_NAME}_gravity_test overworld_gencpp)
add_executable(${PROJECT_NAME}_area_test src/TestFiles/area.cpp )
target_link_libraries(${PROJECT_NAME}_area_test PRIVATE
${PROJECT_NAME}_types_lib)
add_executable(${PROJECT_NAME}_approach_test src/TestFiles/approach_sender.cpp )
target_link_libraries(${PROJECT_NAME}_approach_test PRIVATE
${PROJECT_NAME}_sender_lib)