-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
175 lines (153 loc) · 3.9 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
cmake_minimum_required(VERSION 3.4)
project(franka_mujoco)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
# Disable optimization to prevent false-positives with memory analisys tools (e.g. asan or valgrind)
if (ENABLE_SANITIZER OR NO_OPTIM)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -fno-inline -Wall")
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
endif()
if (ENABLE_SANITIZER)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
add_link_options(-fsanitize=address)
endif()
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED
roscpp
angles
std_msgs
control_msgs
tf2_ros
control_toolbox
controller_manager
controller_interface
hardware_interface
eigen_conversions
transmission_interface
franka_hw
kdl_parser
boost_sml
franka_msgs
franka_gripper
franka_example_controllers
mujoco_ros
mujoco_ros_control
pluginlib
urdf
joint_limits_interface
)
find_package(Franka REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(orocos_kdl REQUIRED)
# merge Franka + catkin INCLUDE_DIRS in topological order
list_insert_in_workspace_order(catkin_INCLUDE_DIRS ${Franka_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS})
catkin_package(
CATKIN_DEPENDS
roscpp
angles
controller_interface
control_toolbox
hardware_interface
transmission_interface
joint_limits_interface
eigen_conversions
urdf
kdl_parser
boost_sml
franka_hw
franka_msgs
control_msgs
std_msgs
franka_gripper
franka_example_controllers
mujoco_ros
mujoco_ros_control
INCLUDE_DIRS include
LIBRARIES
franka_gripper_sim_mujoco
franka_hw_sim_mujoco
DEPENDS
Franka
)
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
include
${catkin_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
${Boost_INCLUDE_DIR}
)
add_library(franka_hw_sim_mujoco
src/franka_hw_mujoco.cpp
src/joint.cpp
src/model_kdl.cpp
src/controller_verifier.cpp
)
if (Franka_VERSION GREATER_EQUAL 0.9)
target_compile_definitions(franka_hw_sim_mujoco PUBLIC ENABLE_BASE_ACCELERATION)
endif()
target_link_libraries(franka_hw_sim_mujoco
${catkin_LIBRARIES}
${Franka_LIBRARIES}
${orocos_kdl_LIBRARIES}
)
target_include_directories(franka_hw_sim_mujoco SYSTEM PUBLIC
${EIGEN3_INCLUDE_DIRS}
${orocos_kdl_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
)
add_dependencies(franka_hw_sim_mujoco
${franka_hw_sim_mujoco_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
add_library(franka_gripper_sim_mujoco
src/franka_gripper_mujoco.cpp
)
target_link_libraries(franka_gripper_sim_mujoco
${catkin_LIBRARIES}
)
target_include_directories(franka_gripper_sim_mujoco SYSTEM PUBLIC
${catkin_INCLUDE_DIRS}
)
add_dependencies(franka_gripper_sim_mujoco
${franka_hw_sim_mujoco_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
#############
## Install ##
#############
install(DIRECTORY include/franka_mujoco/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)
install(
FILES
franka_gripper_sim_mujoco_plugin.xml
franka_hw_sim_mujoco_plugin.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
install(TARGETS franka_hw_sim_mujoco franka_gripper_sim_mujoco
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(DIRECTORY launch
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
install(DIRECTORY config
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
install(DIRECTORY assets
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
#############
## Testing ##
#############
if(CATKIN_ENABLE_TESTING)
add_subdirectory(test)
endif()