-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
105 lines (94 loc) · 2.65 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
cmake_minimum_required(VERSION 3.8)
project(serial_link_action_server)
# Compiler options for GCC and Clang
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# ROS2 packages
find_package(action_msgs REQUIRED)
find_package(ament_cmake REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_action REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(std_msgs REQUIRED)
# 3rd party packages
find_package(Eigen3 REQUIRED)
find_package(RobotLibrary REQUIRED)
# Include directories
include_directories(
include
${EIGEN3_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR}/rosidl_generator_cpp
${CMAKE_BINARY_DIR}/rosidl_generator_cpp # Ensure generated headers are included
)
# Message & Action Definitions
rosidl_generate_interfaces(${PROJECT_NAME}
"msg/CartesianState.msg"
"msg/CartesianTrajectoryPoint.msg"
"msg/JointCommand.msg"
"msg/JointState.msg"
"msg/JointTrajectoryPoint.msg"
"msg/Statistics.msg"
"action/TrackJointTrajectory.action"
"action/TrackCartesianTrajectory.action"
DEPENDENCIES builtin_interfaces geometry_msgs std_msgs sensor_msgs
)
# Velocity Control Server
add_executable(velocity_control_server src/velocity_control_server.cpp)
ament_target_dependencies(velocity_control_server
"ament_cmake"
"geometry_msgs"
"rclcpp"
"rclcpp_action"
"rosidl_default_runtime"
"sensor_msgs"
"std_msgs"
)
rosidl_get_typesupport_target(${PROJECT_NAME}__rosidl_typesupport_cpp ${PROJECT_NAME} "rosidl_typesupport_cpp")
target_link_libraries(velocity_control_server
${PROJECT_NAME}__rosidl_typesupport_cpp # Link the generated action typesupport
Eigen3::Eigen
RobotLibrary::RobotLibrary
)
# Demo Client
add_executable(demo_client src/demo_client.cpp)
ament_target_dependencies(demo_client
"action_msgs"
"ament_cmake"
"rclcpp"
"rclcpp_action"
"rosidl_default_runtime"
"std_msgs"
)
target_link_libraries(demo_client
${PROJECT_NAME}__rosidl_typesupport_cpp
Eigen3::Eigen
RobotLibrary::RobotLibrary
)
# Mujoco Relay
add_executable(mujoco_relay src/mujoco_relay.cpp)
ament_target_dependencies(mujoco_relay
"ament_cmake"
"rclcpp"
"rosidl_default_runtime"
"std_msgs"
)
target_link_libraries(mujoco_relay
${PROJECT_NAME}__rosidl_typesupport_cpp
Eigen3::Eigen
RobotLibrary::RobotLibrary
)
# Installation
install(TARGETS velocity_control_server
demo_client
mujoco_relay
DESTINATION lib/${PROJECT_NAME}
)
install(DIRECTORY launch
config
test
DESTINATION share/${PROJECT_NAME}
)
ament_package()