-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
183 lines (161 loc) · 6.11 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
cmake_minimum_required(VERSION 3.5)
project(tachimawari)
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic -fPIC)
endif()
find_package(ament_cmake REQUIRED)
find_package(dynamixel_sdk REQUIRED)
find_package(jitsuyo REQUIRED)
find_package(kansei_interfaces REQUIRED)
find_package(keisan REQUIRED)
find_package(rclcpp REQUIRED)
find_package(tachimawari_interfaces REQUIRED)
# TODO: Enable me later.
# find_package(musen REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
add_library(${PROJECT_NAME} SHARED
"src/${PROJECT_NAME}/control/controller/module/cm740.cpp"
"src/${PROJECT_NAME}/control/controller/packet/protocol_1/instruction/bulk_read_packet.cpp"
"src/${PROJECT_NAME}/control/controller/packet/protocol_1/instruction/read_packet.cpp"
"src/${PROJECT_NAME}/control/controller/packet/protocol_1/instruction/sync_write_packet.cpp"
"src/${PROJECT_NAME}/control/controller/packet/protocol_1/instruction/write_packet.cpp"
"src/${PROJECT_NAME}/control/controller/packet/protocol_1/model/packet.cpp"
"src/${PROJECT_NAME}/control/controller/packet/protocol_1/status/bulk_read_data.cpp"
"src/${PROJECT_NAME}/control/controller/packet/protocol_1/status/status_packet.cpp"
"src/${PROJECT_NAME}/control/controller/packet/protocol_1/utils/word.cpp"
"src/${PROJECT_NAME}/control/controller/platform/linux.cpp"
"src/${PROJECT_NAME}/control/controller/utils/timer.cpp"
"src/${PROJECT_NAME}/control/manager/control_manager.cpp"
"src/${PROJECT_NAME}/control/node/control_node.cpp"
"src/${PROJECT_NAME}/control/sdk/module/dynamixel_sdk.cpp"
"src/${PROJECT_NAME}/control/sdk/packet/model/group_bulk_read.cpp"
"src/${PROJECT_NAME}/control/sdk/packet/protocol_1/group_bulk_read.cpp"
"src/${PROJECT_NAME}/control/sdk/packet/protocol_1/group_sync_write.cpp"
"src/${PROJECT_NAME}/control/sdk/packet/protocol_2/group_bulk_read.cpp"
"src/${PROJECT_NAME}/control/sdk/packet/protocol_2/group_sync_write.cpp"
"src/${PROJECT_NAME}/imu/node/imu_node.cpp"
"src/${PROJECT_NAME}/imu/node/imu_provider.cpp"
"src/${PROJECT_NAME}/joint/model/joint_id.cpp"
"src/${PROJECT_NAME}/joint/model/joint.cpp"
"src/${PROJECT_NAME}/joint/node/joint_manager.cpp"
"src/${PROJECT_NAME}/joint/node/joint_node.cpp"
"src/${PROJECT_NAME}/joint/utils/middleware.cpp"
"src/${PROJECT_NAME}/joint/utils/node_control.cpp"
"src/${PROJECT_NAME}/joint/tf2/frame_id.cpp"
"src/${PROJECT_NAME}/joint/tf2/frame.cpp"
"src/${PROJECT_NAME}/joint/tf2/tf2_manager.cpp"
"src/${PROJECT_NAME}/node/tachimawari_node.cpp"
# TODO: Enable me later.
# "src/${PROJECT_NAME}/node/rviz_server_node.cpp"
# "src/${PROJECT_NAME}/node/rviz_client_node.cpp"
)
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
ament_target_dependencies(${PROJECT_NAME}
dynamixel_sdk
jitsuyo
kansei_interfaces
keisan
rclcpp
tachimawari_interfaces
tf2_ros
sensor_msgs
geometry_msgs)
install(DIRECTORY "include" DESTINATION ".")
install(DIRECTORY
"launch"
DESTINATION share/${PROJECT_NAME}/
)
install(DIRECTORY
"urdf"
DESTINATION share/${PROJECT_NAME}/
)
install(DIRECTORY
"rviz"
DESTINATION share/${PROJECT_NAME}/
)
install(TARGETS ${PROJECT_NAME}
EXPORT export_${PROJECT_NAME}
ARCHIVE DESTINATION "lib"
LIBRARY DESTINATION "lib"
RUNTIME DESTINATION "bin")
add_executable(check_joints "src/check_joints_main.cpp")
target_include_directories(check_joints PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_link_libraries(check_joints ${PROJECT_NAME})
add_executable(init_joints "src/init_joints_main.cpp")
target_include_directories(init_joints PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_link_libraries(init_joints ${PROJECT_NAME})
add_executable(main "src/tachimawari_main.cpp")
target_include_directories(main PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_link_libraries(main ${PROJECT_NAME})
add_executable(read_buttons "src/read_buttons_main.cpp")
target_include_directories(read_buttons PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_link_libraries(read_buttons ${PROJECT_NAME})
add_executable(read_joints "src/read_joints_main.cpp")
target_include_directories(read_joints PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_link_libraries(read_joints ${PROJECT_NAME})
# TODO: Enable me later.
# add_executable(rviz_server "src/rviz_server_main.cpp")
# target_include_directories(rviz_server PUBLIC
# $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
# $<INSTALL_INTERFACE:include>)
# target_link_libraries(${PROJECT_NAME} musen)
# target_link_libraries(rviz_server ${PROJECT_NAME})
#
# add_executable(rviz_client "src/rviz_client_main.cpp")
# target_include_directories(rviz_client PUBLIC
# $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
# $<INSTALL_INTERFACE:include>)
# target_link_libraries(rviz_client ${PROJECT_NAME})
install(TARGETS
check_joints
init_joints
main
read_buttons
read_joints
# TODO: Enable me later.
# rviz_server
# rviz_client
DESTINATION lib/${PROJECT_NAME})
if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
find_package(ament_lint_auto REQUIRED)
ament_add_gtest(${PROJECT_NAME}_tests
"test/joint/joint_test.cpp")
target_include_directories(${PROJECT_NAME}_tests PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_link_libraries(${PROJECT_NAME}_tests ${PROJECT_NAME})
# TODO: Enable me later.
# ament_lint_auto_find_test_dependencies()
endif()
ament_export_dependencies(
dynamixel_sdk
jitsuyo
kansei_interfaces
keisan
rclcpp
tf2_ros
tachimawari_interfaces)
ament_export_include_directories("include")
ament_export_libraries(${PROJECT_NAME})
ament_package()