2024-09-09 22:18:19 +08:00
|
|
|
cmake_minimum_required(VERSION 3.8)
|
2024-09-10 22:30:30 +08:00
|
|
|
project(unitree_guide_controller)
|
2024-09-09 22:18:19 +08:00
|
|
|
|
|
|
|
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
|
|
add_compile_options(-Wall -Wextra -Wpedantic)
|
|
|
|
endif ()
|
|
|
|
|
2024-09-16 21:15:34 +08:00
|
|
|
set(CMAKE_BUILD_TYPE Release)
|
2024-09-09 22:18:19 +08:00
|
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
|
|
|
|
|
|
set(CONTROLLER_INCLUDE_DEPENDS
|
|
|
|
pluginlib
|
|
|
|
rcpputils
|
|
|
|
controller_interface
|
|
|
|
realtime_tools
|
|
|
|
std_msgs
|
2024-09-11 14:01:07 +08:00
|
|
|
control_input_msgs
|
2024-09-12 13:56:51 +08:00
|
|
|
kdl_parser
|
2024-09-09 22:18:19 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# find dependencies
|
|
|
|
find_package(ament_cmake REQUIRED)
|
|
|
|
foreach (Dependency IN ITEMS ${CONTROLLER_INCLUDE_DEPENDS})
|
|
|
|
find_package(${Dependency} REQUIRED)
|
|
|
|
endforeach ()
|
|
|
|
|
|
|
|
add_library(${PROJECT_NAME} SHARED
|
2024-09-14 17:54:39 +08:00
|
|
|
|
2024-09-10 22:30:30 +08:00
|
|
|
src/UnitreeGuideController.cpp
|
2024-09-14 17:54:39 +08:00
|
|
|
|
2024-09-09 22:18:19 +08:00
|
|
|
src/FSM/StatePassive.cpp
|
2024-09-11 20:41:12 +08:00
|
|
|
src/FSM/StateFixedDown.cpp
|
2024-09-10 22:30:30 +08:00
|
|
|
src/FSM/StateFixedStand.cpp
|
2024-09-12 13:56:51 +08:00
|
|
|
src/FSM/StateSwingTest.cpp
|
2024-09-13 15:00:20 +08:00
|
|
|
src/FSM/StateFreeStand.cpp
|
2024-09-16 21:15:34 +08:00
|
|
|
src/FSM/StateBalanceTest.cpp
|
2024-09-18 19:37:01 +08:00
|
|
|
src/FSM/StateTrotting.cpp
|
2024-09-14 17:54:39 +08:00
|
|
|
|
|
|
|
src/robot/QuadrupedRobot.cpp
|
|
|
|
src/robot/RobotLeg.cpp
|
|
|
|
|
|
|
|
src/control/Estimator.cpp
|
2024-09-16 13:44:08 +08:00
|
|
|
src/control/LowPassFilter.cpp
|
2024-09-16 21:15:34 +08:00
|
|
|
src/control/BalanceCtrl.cpp
|
2024-09-14 17:54:39 +08:00
|
|
|
|
|
|
|
src/quadProgpp/Array.cc
|
|
|
|
src/quadProgpp/QuadProg++.cc
|
|
|
|
|
2024-09-18 12:29:26 +08:00
|
|
|
src/gait/WaveGenerator.cpp
|
2024-09-19 17:16:17 +08:00
|
|
|
src/gait/FeetEndCalc.cpp
|
2024-09-18 12:29:26 +08:00
|
|
|
src/gait/GaitGenerator.cpp
|
|
|
|
|
2024-09-09 22:18:19 +08:00
|
|
|
)
|
|
|
|
target_include_directories(${PROJECT_NAME}
|
|
|
|
PUBLIC
|
|
|
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
|
2024-09-17 18:21:04 +08:00
|
|
|
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>"
|
|
|
|
PRIVATE
|
|
|
|
src)
|
2024-09-09 22:18:19 +08:00
|
|
|
ament_target_dependencies(
|
|
|
|
${PROJECT_NAME} PUBLIC
|
|
|
|
${CONTROLLER_INCLUDE_DEPENDS}
|
|
|
|
)
|
|
|
|
|
2024-09-10 22:30:30 +08:00
|
|
|
pluginlib_export_plugin_description_file(controller_interface unitree_guide_controller.xml)
|
2024-09-09 22:18:19 +08:00
|
|
|
|
|
|
|
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
|
|
|
|
)
|
|
|
|
|
|
|
|
install(
|
|
|
|
DIRECTORY launch config
|
|
|
|
DESTINATION share/${PROJECT_NAME}/
|
|
|
|
)
|
|
|
|
|
|
|
|
ament_export_dependencies(${CONTROLLER_INCLUDE_DEPENDS})
|
|
|
|
ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET)
|
|
|
|
|
|
|
|
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()
|