-
Notifications
You must be signed in to change notification settings - Fork 114
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
94 lines (75 loc) · 2.13 KB
/
Copy pathCMakeLists.txt
File metadata and controls
94 lines (75 loc) · 2.13 KB
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
# Copyright (c) 2024 Robotics and AI Institute LLC dba RAI Institute. All rights reserved.
cmake_minimum_required(VERSION 3.22)
# This is here so we can use jthread from C++ 20
set(CMAKE_CXX_STANDARD 20)
project(spot_ros2_control)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# Dependencies
find_package(ament_cmake REQUIRED)
set(THIS_PACKAGE_INCLUDE_DEPENDS
rclcpp
rclcpp_lifecycle
sensor_msgs
std_msgs
spot_hardware_interface
)
foreach(Dependency IN ITEMS ${THIS_PACKAGE_INCLUDE_DEPENDS})
find_package(${Dependency} REQUIRED)
endforeach()
# Add the hardware interface
add_library(
spot_ros2_control
SHARED
src/spot_joint_map.cpp
)
target_compile_features(spot_ros2_control PUBLIC cxx_std_20)
target_include_directories(spot_ros2_control PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
ament_target_dependencies(
spot_ros2_control PUBLIC
${THIS_PACKAGE_INCLUDE_DEPENDS}
)
# Add example nodes and install them
add_executable(noarm_squat examples/noarm_squat.cpp)
target_link_libraries(noarm_squat spot_ros2_control)
add_executable(wiggle_arm examples/wiggle_arm.cpp)
target_link_libraries(wiggle_arm spot_ros2_control)
add_executable(joint_command_passthrough examples/joint_command_passthrough.cpp)
target_link_libraries(joint_command_passthrough spot_ros2_control)
install(TARGETS noarm_squat wiggle_arm joint_command_passthrough
DESTINATION lib/${PROJECT_NAME})
install(
PROGRAMS
examples/set_gripper_gains.py
DESTINATION lib/${PROJECT_NAME}
RENAME set_gripper_gains
)
install(
PROGRAMS
examples/mixed_level_example.py
DESTINATION lib/${PROJECT_NAME}
RENAME mixed_level_example
)
install(
DIRECTORY include/
DESTINATION include
)
install(
DIRECTORY launch config rviz
DESTINATION share/${PROJECT_NAME}
)
install(TARGETS spot_ros2_control
EXPORT export_spot_ros2_control
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
ament_export_targets(export_spot_ros2_control HAS_LIBRARY_TARGET)
if(BUILD_TESTING)
add_subdirectory(test)
endif()
ament_package()