-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
119 lines (90 loc) · 2.14 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
cmake_minimum_required(VERSION 3.0)
project(base_estimation)
set(CMAKE_CXX_STANDARD 17)
option(XBOT2_ENABLE_XENO OFF "Compile against xenomai")
option(COMPILE_CARTESIO_PLUGIN OFF "Compile Cartesio RT plugin")
find_package(cartesian_interface REQUIRED)
find_package(catkin REQUIRED COMPONENTS
roscpp
visualization_msgs
std_msgs
gazebo_msgs
tf_conversions
eigen_conversions
message_generation)
include_directories(
include/
${catkin_INCLUDE_DIRS})
add_message_files(
FILES
ContactStatus.msg
ContactsStatus.msg
)
generate_messages(
DEPENDENCIES
std_msgs
)
catkin_package()
# compile library
add_library(ikbe SHARED
src/base_estimation.cpp
src/vertex_force_optimizer.cpp
src/contact_estimation.cpp)
add_dependencies(ikbe ${PROJECT_NAME}_generate_messages)
target_link_libraries(ikbe
PUBLIC
${cartesian_interface_LIBRARIES}
${catkin_LIBRARIES}
)
install(
TARGETS ikbe
DESTINATION lib
)
find_package(xbot2 QUIET)
# compile plugin
if(${xbot2_FOUND})
add_xbot2_plugin(base_estimation src/base_estimation_plugin.cpp src/contact_viz.cpp)
target_link_libraries(base_estimation
PRIVATE
ikbe
xbot2::xbot2_ros_support
)
install(
TARGETS base_estimation
DESTINATION lib
)
endif()
# compile node
add_executable(base_estimation_node src/base_estimation_node.cpp)
target_link_libraries(base_estimation_node
PRIVATE
ikbe
xbot2::xbot2
)
install(
TARGETS base_estimation_node
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
# compile gazebo tf publisher
add_executable(gazebo_tf_publisher src/gazebo_tf_publisher.cpp)
target_link_libraries(gazebo_tf_publisher
PRIVATE
${catkin_LIBRARIES}
)
install(
TARGETS gazebo_tf_publisher
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
# compile cartesio rt
if(${COMPILE_CARTESIO_PLUGIN})
add_subdirectory(cartesio)
endif()
# install files
install(
DIRECTORY config
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
install(
DIRECTORY launch
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)