-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
92 lines (77 loc) · 2.56 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
cmake_minimum_required(VERSION 3.8)
project(omni_sim)
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
add_compile_options(-Wall -Wextra -Werror=conversion -Werror=return-type -Werror=shadow -Werror=format)
endif()
set(THIS_PACKAGE_INCLUDE_DEPENDS
controller_interface
generate_parameter_library
geometry_msgs
hardware_interface
nav_msgs
pluginlib
rclcpp
rclcpp_lifecycle
rcpputils
realtime_tools
class_loader
tf2
tf2_msgs
yaml-cpp
yaml_cpp_vendor
)
# find dependencies
find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()
add_compile_definitions(RCPPUTILS_VERSION_MAJOR=${rcpputils_VERSION_MAJOR})
add_compile_definitions(RCPPUTILS_VERSION_MINOR=${rcpputils_VERSION_MINOR})
generate_parameter_library(omni_controllers_param
config/omni_controllers_param.yaml
)
add_library(omni_controllers SHARED
src/omni_controllers.cpp
src/odom_solver.cpp
src/pid_controller.cpp
)
ament_auto_add_library(odom_tf_converter src/odom_tf_converter.cpp)
rclcpp_components_register_nodes(odom_tf_converter "OmniRobotController::OdomToTf")
target_compile_features(omni_controllers PUBLIC cxx_std_17)
target_include_directories(omni_controllers PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/omni_controllers>
)
target_link_libraries(omni_controllers PUBLIC omni_controllers_param)
ament_target_dependencies(omni_controllers PUBLIC ${THIS_PACKAGE_INCLUDE_DEPENDS})
target_compile_definitions(omni_controllers PRIVATE "OMNI_CONTROLLERS_BUILDING_DLL")
pluginlib_export_plugin_description_file(controller_interface omni_controller_plugin.xml)
install(
DIRECTORY include/
DESTINATION include/
)
install(TARGETS omni_controllers omni_controllers_param
EXPORT export_omni_controllers
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
)
install(DIRECTORY
launch
config
xacro
world
DESTINATION share/${PROJECT_NAME}
)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
# comment the line when a copyright and license is added to all source files
set(ament_cmake_copyright_FOUND TRUE)
# the following line skips cpplint (only works in a git repo)
# comment the line when this package is in a git repo and when
# a copyright and license is added to all source files
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()
ament_export_targets(export_omni_controllers HAS_LIBRARY_TARGET)
ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS})
ament_auto_package()