-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
317 lines (295 loc) · 8.97 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
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
###
### Quentin Rouxel
### Thesis (2014-201?)
###
cmake_minimum_required(VERSION 2.8)
project(Thesis)
#Deps dependencies
find_package(Deps)
deps_add_libraries()
#Option for compiling the tests and apps
option(BUILD_LEPH_CODE_TESTS "Build Leph Code Tests" OFF)
option(BUILD_LEPH_CODE_APPS "Build Leph Code Apps" OFF)
option(BUILD_LEPH_CODE_VIEWER "Build Leph Code Viewer (SFML)" OFF)
option(BUILD_LEPH_CODE_RHIO "Build Leph Code with RhIO" OFF)
option(BUILD_LEPH_CODE_RHAL "Build Leph Code with RhAL" OFF)
#Includes directories lists
set(LEPHCODE_INCLUDE_DIRECTORIES "")
#Include sources directory
set(LEPHCODE_INCLUDE_DIRECTORIES ${LEPHCODE_INCLUDE_DIRECTORIES} ${CMAKE_CURRENT_SOURCE_DIR})
#OpenMP flags for LibCMAES
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp" )
#Include SFML (graphic library)
set(SFML_DIRECTORY "SFML" CACHE STRING "SFML lib directory")
#Include RhAL (Rhoban Abstraction Layer Library) if needed
if (BUILD_LEPH_CODE_RHAL)
add_definitions(-DBUILD_RHAL_RHIO_BINDING)
endif (BUILD_LEPH_CODE_RHAL)
#Enable C++11
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
#Enable Warning
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
#Sources files
set(SOURCES_FILES
CartWalk/CartWalk.cpp
CartWalk/linear_algebra.cpp
CartWalk/math_basics.cpp
CartWalk/math_log.cpp
CartWalk/SigmabanLeg.cpp
CartWalk/CartWalkProxy.cpp
CartWalk/CartWalkGradient.cpp
Concepts/HumanoidModelConcept.cpp
Concepts/HumanoidSensorsModelConcept.cpp
Concepts/FootStepDifferentiatorConcept.cpp
Concepts/FootStepIntegratorConcept.cpp
Concepts/FallDetectorConcept.cpp
LinearRegression/SimpleLinearRegression.cpp
LinearRegression/MedianLinearRegression.cpp
Gradient/FiniteDifferenceGradient.cpp
Utils/GeometricMedian.cpp
Utils/Combination.cpp
Utils/CircularBuffer.cpp
Utils/Chrono.cpp
Utils/Scheduling.cpp
Utils/Differentiation.cpp
Utils/NewtonBinomial.cpp
Utils/LWPRUtils.cpp
Utils/RandomWalk.cpp
Utils/RandomVelocitySpline.cpp
Utils/IterativeLearningControl.cpp
Utils/LWPRInputsOptimization.cpp
Utils/EncoderFilter.cpp
Utils/ComputeModelData.cpp
Utils/FileEigen.cpp
Utils/FileModelParameters.cpp
Utils/GaussianDistribution.cpp
Ncurses/InterfaceCLI.cpp
Model/Model.cpp
Model/HumanoidModel.cpp
Model/HumanoidFloatingModel.cpp
Model/HumanoidFixedModel.cpp
Model/HumanoidFixedPressureModel.cpp
Model/InverseKinematics.cpp
Model/RBDLRootUpdate.cpp
Model/RBDLClosedLoop.cpp
Model/RBDLContactLCP.cpp
Model/NullSpace.cpp
Model/ForwardSimulation.cpp
Model/HumanoidSimulation.cpp
Model/JointModel.cpp
Odometry/Odometry.cpp
Odometry/OdometryDisplacementModel.cpp
Odometry/OdometryNoiseModel.cpp
StaticWalk/StaticWalk.cpp
Spline/Polynom.cpp
Spline/Spline.cpp
Spline/SmoothSpline.cpp
Spline/LinearSpline.cpp
Spline/CubicSpline.cpp
Spline/FittedSpline.cpp
Spline/PolyFit.cpp
TrajectoryGeneration/TrajectoryGeneration.cpp
TrajectoryGeneration/TrajectoryUtils.cpp
LegIK/LegIK.cpp
IKWalk/IKWalk.cpp
QuinticWalk/Footstep.cpp
QuinticWalk/QuinticExperiment.cpp
QuinticWalk/QuinticWalk.cpp
TimeSeries/SeriesUtils.cpp
DMP/DMP.cpp
DMP/DMPSpline.cpp
LCPMobyDrake/LCPSolver.cpp
TrajectoryDefinition/CommonTrajs.cpp
TrajectoryDefinition/TrajKickSingle.cpp
TrajectoryDefinition/TrajKickSingleContact.cpp
TrajectoryDefinition/TrajKickDouble.cpp
TrajectoryDefinition/TrajStaticPose.cpp
TrajectoryDefinition/TrajLegLift.cpp
TrajectoryDefinition/TrajWalk.cpp
)
#Tests main files
set(TESTS_FILES
testVectorLabel
testCartWalkProxy
testPlot
testSimpleLinearRegression
testCartWalkGradient
testFiniteDifferenceGradient
testReweightedLinearRegression
testGeometricMedian
testMedianLinearRegression
testCombination
testInterfaceCLI
testCircularBuffer
benchVectorLabel
testMatrixLabel
testModel
testLevenbergMarquardt
testChrono
testCubicSpline
testSmoothSpline
testScheduling
testFittedSpline
testDifferentiation
testGaussianProcess
testMetaSeries
testTimeSeries
testMetaParameter
testConcept
testRegressionLWPR
testLWPR
testLWPRAdvanced
testIterativeLearningControl
testRandomWalk
testRandomVelocitySpline
testLWPRInputsOptimization
testEuler
testAxisAngle
testEncoderFilter
testMapSeries
testOdometry
benchModel
testDMP
testDMPSpline
testJointModel
testTrajectoryParameters
testForwardSimulationCalibration
)
#Applications main files
set(APPS_FILES
appSplineGenerationCircle
appTestLearningFromLogs
appExperimentOdometry
appOdometryOffline
appTrajectoriesFitting
appStatsDynaban
appOdometryModelCalibration
appTrajectoriesGeneration
appTrajectoriesCorrection
appTrajectoriesSimulation
appFeedForwardLogsComparison
appHumanoidSimulationIdentification
appTrajectoriesLogFitting
appMapSeriesLogsCut
appModelParametersViewer
#appHumanoidSimulationLearning
appCameraModelLearning
appOdometryModelLearning
)
#Build App RhIO Viewer
if (BUILD_LEPH_CODE_RHIO)
deps_add_library("rhoban/rhio:client")
deps_add_library("rhobandeps/libzmq")
set(APPS_FILES ${APPS_FILES}
appRhIOViewerModel
appRhIOViewerRobocup
)
endif (BUILD_LEPH_CODE_RHIO)
#LephCode linked libraries
set(CODE_LIBRARIES
ncurses
console_bridge
urdfdom_world
urdfdom_model
${DEPS_LIBRARIES}
)
#Add URDF model symbolic link
execute_process(COMMAND "/bin/bash" "-c"
"cd ${CMAKE_BINARY_DIR}; ln -f -s ${CMAKE_CURRENT_SOURCE_DIR}/Data/sigmaban_metabot_cleats.urdf sigmaban.urdf")
execute_process(COMMAND "/bin/bash" "-c"
"cd ${CMAKE_BINARY_DIR}; ln -f -s ${CMAKE_CURRENT_SOURCE_DIR}/Data/grosban_metabot.urdf grosban.urdf")
#Add RhAL config symbolic link
execute_process(COMMAND "/bin/bash" "-c"
"cd ${CMAKE_BINARY_DIR}; ln -f -s ${CMAKE_CURRENT_SOURCE_DIR}/Data/django_rhal.json django_rhal.json")
execute_process(COMMAND "/bin/bash" "-c"
"cd ${CMAKE_BINARY_DIR}; ln -f -s ${CMAKE_CURRENT_SOURCE_DIR}/Data/chewbacca_rhal.json chewbacca_rhal.json")
#Viewer (SFML) build option and files
if (BUILD_LEPH_CODE_VIEWER)
add_definitions(-DLEPH_VIEWER_ENABLED)
set(LEPHCODE_INCLUDE_DIRECTORIES ${LEPHCODE_INCLUDE_DIRECTORIES} ${SFML_DIRECTORY}/include)
link_directories(${SFML_DIRECTORY}/lib)
set(SOURCES_FILES ${SOURCES_FILES}
Viewer/ModelViewer.cpp
Viewer/ModelDraw.cpp
TrajectoryGeneration/TrajectoryDisplay.cpp
)
set(TESTS_FILES ${TESTS_FILES}
testModelViewer
testInverseKinematics
testStaticWalk
testRBDLRootUpdate
testHumanoidFixedModel
testNullSpace
testLegIK
testModelTorques
testIKWalk
testZeroMomentPoint
testHumanoidPressureModel
testTrunkFootIK
testForwardSimulation
testQuinticExperiment
testQuinticWalk
testCameraModel
testHumanoidSimulation
testFeedForward
)
set(APPS_FILES ${APPS_FILES}
appViewerModelSplines
appViewerModelLogsOld
appViewerModelLogs
appViewerModelZMP
appDynamicTrajectoryOptimizationTorques
appTrajectoriesViewer
appTestLegTorques
appExperimentKick
appExperimentKick2
appTestZMPControl
appMapSeriesLogsViewer
appDMPTrajectoryOptimization
appTrajectoriesKickGeneration
appHumanoidSimulationPlayer
appFeedForwardSimulation
)
set(CODE_LIBRARIES ${CODE_LIBRARIES}
sfml-graphics
sfml-window
sfml-system
GL
GLU
)
endif (BUILD_LEPH_CODE_VIEWER)
#Include need directories
set(LEPHCODE_INCLUDE_DIRECTORIES ${LEPHCODE_INCLUDE_DIRECTORIES} CACHE STRING "LephCode include directories")
include_directories(${LEPHCODE_INCLUDE_DIRECTORIES})
#Build Code as shared library
add_library(LephCode SHARED ${SOURCES_FILES})
target_link_libraries(LephCode ${CODE_LIBRARIES})
#Build Tests
if (BUILD_LEPH_CODE_TESTS)
foreach (TEST ${TESTS_FILES})
add_executable(${TEST} Tests/${TEST}.cpp)
target_link_libraries(${TEST} LephCode)
endforeach ()
endif (BUILD_LEPH_CODE_TESTS)
#Build Apps
if (BUILD_LEPH_CODE_APPS)
foreach (APP ${APPS_FILES})
add_executable(${APP} Apps/${APP}.cpp)
target_link_libraries(${APP} LephCode)
endforeach ()
endif (BUILD_LEPH_CODE_APPS)
#Build App RhAL Motion
if (BUILD_LEPH_CODE_RHAL)
deps_add_library_custom("rhoban/rhio:server" "APPS_RHAL_LIBRARIES")
deps_add_library_custom("rhoban/rhal" "APPS_RHAL_LIBRARIES")
set(APPS_RHAL_SOURCES_FILES
RhAL/RhALUtils
)
set(APPS_RHAL_FILES
appRhALTrajectory
)
foreach (APP ${APPS_RHAL_FILES})
add_executable(${APP} Apps/${APP}.cpp ${APPS_RHAL_SOURCES_FILES})
target_link_libraries(${APP} LephCode ${APPS_RHAL_LIBRARIES})
endforeach ()
endif (BUILD_LEPH_CODE_RHAL)