-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
165 lines (135 loc) · 4.25 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
cmake_minimum_required(VERSION 3.0)
project(libcozmo)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_BUILD_TYPE Release)
set(PYBIND11_PYTHON_VERSION 3.5)
find_package(PythonInterp 3.5 REQUIRED)
find_package(PythonLibs 3.5 REQUIRED)
find_package(catkin REQUIRED COMPONENTS
roscpp
pybind11_catkin
std_msgs
message_generation
geometry_msgs
roslib
)
find_package(Eigen3 REQUIRED)
find_package(DART 6.8.2 REQUIRED COMPONENTS gui collision-bullet)
find_package(aikido REQUIRED COMPONENTS statespace trajectory distance control rviz)
find_package(aikidopy REQUIRED COMPONENTS libaikidopy)
add_message_files(
DIRECTORY msg
FILES
ForkLift.msg
)
generate_messages(
DEPENDENCIES
std_msgs
)
catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS
pybind11_catkin
message_runtime
geometry_msgs
roslib
)
include_directories(
include
${catkin_INCLUDE_DIRS}
${aikido_INCLUDE_DIRS}
${PYTHON_INCLUDE_DIRS}
)
add_library(cozmo SHARED
src/cozmo_description/cozmo.cpp
src/actionspace/ObjectOrientedActionSpace.cpp
src/actionspace/GenericActionSpace.cpp
src/statespace/SE2.cpp
src/distance/SE2.cpp
src/model/GPRModel.cpp
src/model/ScikitLearnFramework.cpp
)
target_include_directories(cozmo PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_include_directories(
cozmo
PUBLIC
${EIGEN3_INCLUDE_DIR}
PRIVATE
${DART_INCLUDE_DIRS}
${aikido_INCLUDE_DIRS}
${PYTHON_INCLUDE_DIRS}
)
target_link_libraries(
cozmo
PUBLIC
${DART_LIBRARIES}
${aikido_LIBRARIES}
${PYTHON_LIBRARIES}
)
################################################################################
# TESTS
################################################################################
set(TEST_LIBS cozmo ${catkin_LIBRARIES} ${aikido_LIBRARIES})
catkin_add_gtest(test_libcozmo tests/statespace/test_statespace.cpp)
target_link_libraries(test_libcozmo ${TEST_LIBS})
catkin_add_gtest(test_generic_action_space tests/actionspace/test_generic_action_space.cpp )
target_link_libraries(test_generic_action_space ${TEST_LIBS})
catkin_add_gtest(test_angle_normalization tests/utils/test_angle_normalization.cpp)
target_link_libraries(test_angle_normalization ${TEST_LIBS})
catkin_add_gtest(test_object_oriented_action_space tests/actionspace/test_object_oriented_action_space.cpp)
target_link_libraries(test_object_oriented_action_space
cozmo
)
catkin_add_gtest(test_euclidean tests/utils/test_euclidean_distance.cpp)
target_link_libraries(test_euclidean ${TEST_LIBS})
catkin_add_gtest(test_linspace tests/utils/test_linspace.cpp)
target_link_libraries(test_linspace ${TEST_LIBS})
catkin_add_gtest(test_distance tests/distance/test_distance.cpp)
target_link_libraries(test_distance ${TEST_LIBS})
catkin_add_gtest(test_model tests/model/test_GPRModel.cpp)
target_link_libraries(test_model ${TEST_LIBS})
catkin_add_gtest(test_framework tests/model/test_ScikitLearnFramework.cpp)
target_link_libraries(test_framework ${TEST_LIBS})
################################################################################
# EXECUTABLES
################################################################################
add_executable(rviz_example src/examples/rviz_example.cpp)
target_include_directories(rviz_example PRIVATE
${aikido_INCLUDE_DIRS}
${roscpp_INCLUDE_DIRS}
)
target_link_libraries(rviz_example
cozmo
${aikido_LIBRARIES}
${roscpp_LIBRARIES}
)
add_executable(dart_example src/examples/dart_example.cpp)
target_include_directories(dart_example PRIVATE
${aikido_INCLUDE_DIRS}
${PYTHON_INCLUDE_DIRS}
)
target_link_libraries(dart_example cozmo ${aikido_LIBRARIES})
add_executable(execute_traj src/examples/execute_traj.cpp)
target_include_directories(execute_traj PRIVATE
${aikido_INCLUDE_DIRS}
)
target_link_libraries(execute_traj
cozmo
${aikido_LIBRARIES}
)
################################################################################
# PYBIND
################################################################################
include_directories(${catkin_INCLUDE_DIRS})
pybind_add_module(cozmopy MODULE
src/cozmopy/cozmopy.cpp
)
target_link_libraries(cozmopy PUBLIC
cozmo
${libaikidopy_LIBRARIES}
${DART_LIBRARIES}
)