quadruped_ros2_control/controllers/ocs2_quadruped_controller/CMakeLists.txt

102 lines
3.1 KiB
CMake
Raw Normal View History

2024-09-24 19:48:14 +08:00
cmake_minimum_required(VERSION 3.8)
project(ocs2_quadruped_controller)
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif ()
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CONTROLLER_INCLUDE_DEPENDS
pluginlib
rcpputils
controller_interface
realtime_tools
ocs2_legged_robot_ros
ocs2_self_collision
control_input_msgs
2024-09-25 21:01:50 +08:00
angles
2024-09-24 19:48:14 +08:00
nav_msgs
)
# find dependencies
find_package(ament_cmake REQUIRED)
2024-09-26 22:18:11 +08:00
find_package(qpOASES REQUIRED)
2024-09-24 19:48:14 +08:00
foreach (Dependency IN ITEMS ${CONTROLLER_INCLUDE_DEPENDS})
find_package(${Dependency} REQUIRED)
endforeach ()
add_library(${PROJECT_NAME} SHARED
src/Ocs2QuadrupedController.cpp
# src/estimator/FromTopicEstimate.cpp
2024-09-24 21:50:46 +08:00
src/estimator/LinearKalmanFilter.cpp
2024-09-24 19:48:14 +08:00
src/estimator/StateEstimateBase.cpp
src/wbc/HierarchicalWbc.cpp
src/wbc/HoQp.cpp
src/wbc/WbcBase.cpp
src/wbc/WeightedWbc.cpp
src/interface/constraint/EndEffectorLinearConstraint.cpp
src/interface/constraint/FrictionConeConstraint.cpp
src/interface/constraint/ZeroForceConstraint.cpp
src/interface/constraint/NormalVelocityConstraintCppAd.cpp
src/interface/constraint/ZeroVelocityConstraintCppAd.cpp
src/interface/constraint/SwingTrajectoryPlanner.cpp
src/interface/initialization/LeggedRobotInitializer.cpp
src/interface/SwitchedModelReferenceManager.cpp
src/interface/LeggedRobotPreComputation.cpp
src/interface/LeggedInterface.cpp
2024-09-26 17:28:18 +08:00
src/control/GaitManager.cpp
2024-09-24 19:48:14 +08:00
)
target_include_directories(${PROJECT_NAME}
PUBLIC
${qpOASES_INCLUDE_DIR}
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
2024-09-25 21:01:50 +08:00
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>"
PRIVATE
src)
2024-09-26 22:18:11 +08:00
ament_target_dependencies(${PROJECT_NAME}
2024-09-24 19:48:14 +08:00
${CONTROLLER_INCLUDE_DEPENDS}
)
2024-09-26 22:18:11 +08:00
target_link_libraries(${PROJECT_NAME}
${qpOASES_LIBRARY_DIR}/libqpOASES.a
)
2024-09-24 19:48:14 +08:00
2024-09-25 21:01:50 +08:00
pluginlib_export_plugin_description_file(controller_interface ocs2_quadruped_controller.xml)
install(
DIRECTORY include/
DESTINATION include/${PROJECT_NAME}
)
install(
TARGETS ${PROJECT_NAME}
EXPORT export_${PROJECT_NAME}
ARCHIVE DESTINATION lib/${PROJECT_NAME}
LIBRARY DESTINATION lib/${PROJECT_NAME}
RUNTIME DESTINATION bin
)
ament_export_dependencies(${CONTROLLER_INCLUDE_DEPENDS})
ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET)
2024-09-24 19:48:14 +08:00
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_package()