-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
177 lines (152 loc) · 4.49 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
cmake_minimum_required(VERSION 2.8.12)
project(ur_robot_driver)
add_definitions( -DROS_BUILD )
if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
message("${PROJECT_NAME}: You did not request a specific build type: selecting 'RelWithDebInfo'.")
set(CMAKE_BUILD_TYPE RelWithDebInfo)
endif()
find_package(catkin REQUIRED
COMPONENTS
actionlib
control_msgs
controller_manager
geometry_msgs
hardware_interface
industrial_robot_status_interface
pluginlib
roscpp
scaled_joint_trajectory_controller
sensor_msgs
speed_scaling_interface
speed_scaling_state_controller
std_srvs
tf
tf2_geometry_msgs
tf2_msgs
trajectory_msgs
ur_dashboard_msgs
ur_msgs
pass_through_controllers
kdl_parser
message_generation
rospy
message_runtime
std_msgs
)
find_package(Boost REQUIRED)
find_package(ur_client_library REQUIRED)
# check c++11 / c++0x
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11)
check_cxx_compiler_flag("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
add_compile_options(-std=c++11)
elseif(COMPILER_SUPPORTS_CXX0X)
add_compile_options(-std=c++0x)
else()
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler. Suggested solution: update the pkg build-essential ")
endif()
add_compile_options(-Wall)
add_compile_options(-Wextra)
add_compile_options(-Wno-unused-parameter)
## Generate messages in the 'msg' folder
#add_message_files(
# FILES
#)
generate_messages(
DEPENDENCIES
geometry_msgs
std_msgs
)
include_directories(
include
${catkin_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)
add_library(ur_robot_driver_plugin
src/dashboard_client_ros.cpp
src/hardware_interface.cpp
)
target_link_libraries(ur_robot_driver_plugin ur_client_library::urcl ${catkin_LIBRARIES})
add_dependencies(ur_robot_driver_plugin ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_library(urcl_log_handler
src/urcl_log_handler.cpp
)
target_link_libraries(urcl_log_handler ${catkin_LIBRARIES} ur_client_library::urcl)
add_executable(ur_robot_driver_node
src/dashboard_client_ros.cpp
src/hardware_interface.cpp
src/hardware_interface_node.cpp
)
target_link_libraries(ur_robot_driver_node ${catkin_LIBRARIES} ur_client_library::urcl urcl_log_handler)
add_dependencies(ur_robot_driver_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_executable(dashboard_client
src/dashboard_client_ros.cpp
src/dashboard_client_node.cpp
)
target_link_libraries(dashboard_client ${catkin_LIBRARIES} ur_client_library::urcl urcl_log_handler)
add_dependencies(dashboard_client ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_executable(robot_state_helper
src/robot_state_helper.cpp
src/robot_state_helper_node.cpp
)
target_link_libraries(robot_state_helper ${catkin_LIBRARIES} ur_client_library::urcl)
add_dependencies(robot_state_helper ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
if(CATKIN_ENABLE_TESTING)
find_package(rostest REQUIRED)
add_rostest(test/driver.test)
endif()
install(TARGETS ur_robot_driver_plugin urcl_log_handler ur_robot_driver_node robot_state_helper dashboard_client
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
catkin_install_python(PROGRAMS
scripts/tool_communication
scripts/test_move
scripts/UR10_1_control.py
scripts/JointState_sub.py
scripts/ati_1.py
scripts/ur10_movit_control.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
install(DIRECTORY config launch resources
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.h"
)
install(FILES hardware_interface_plugin.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
catkin_package(
INCLUDE_DIRS
include
LIBRARIES
ur_robot_driver_plugin
urcl_log_handler
CATKIN_DEPENDS
actionlib
controller_manager
control_msgs
geometry_msgs
hardware_interface
kdl_parser
pass_through_controllers
pluginlib
roscpp
scaled_joint_trajectory_controller
sensor_msgs
speed_scaling_interface
speed_scaling_state_controller
std_srvs
tf
tf2_geometry_msgs
tf2_msgs
trajectory_msgs
ur_dashboard_msgs
ur_msgs
rospy
DEPENDS
Boost
ur_client_library
)