unitree_ros_to_real/unitree_legged_real/CMakeLists.txt

54 lines
1.9 KiB
CMake
Raw Normal View History

2021-09-01 20:46:41 +08:00
cmake_minimum_required(VERSION 2.8.3)
project(unitree_legged_real)
2023-06-27 21:06:59 +08:00
set(CMAKE_CXX_FLAGS "-O3 -fPIC -std=c++11")
2021-09-01 20:46:41 +08:00
find_package(catkin REQUIRED COMPONENTS
roscpp
geometry_msgs
unitree_legged_msgs
2023-06-27 21:06:59 +08:00
unitree_legged_sdk
2021-09-01 20:46:41 +08:00
)
2022-05-26 15:45:21 +08:00
catkin_package()
2022-05-24 16:05:24 +08:00
message("-- CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64.*")
set(ARCH amd64)
else()
set(ARCH arm64)
endif()
2023-06-27 21:06:59 +08:00
set(EXTRA_LIBS -pthread ${unitree_legged_sdk_LIBRARIES})
2022-05-24 16:05:24 +08:00
2021-09-01 20:46:41 +08:00
include_directories(
include
${catkin_INCLUDE_DIRS}
2023-06-27 21:06:59 +08:00
${unitree_legged_sdk_INCLUDE_DIRS}
2021-09-01 20:46:41 +08:00
)
2023-06-27 21:06:59 +08:00
add_executable(ros_example_walk src/exe/example_walk.cpp)
target_link_libraries(ros_example_walk ${EXTRA_LIBS} ${catkin_LIBRARIES})
add_dependencies(ros_example_walk ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
2021-09-01 20:46:41 +08:00
2023-06-27 21:06:59 +08:00
add_executable(ros_example_position src/exe/example_position.cpp)
target_link_libraries(ros_example_position ${EXTRA_LIBS} ${catkin_LIBRARIES})
add_dependencies(ros_example_position ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
2021-09-01 20:46:41 +08:00
2022-05-24 16:05:24 +08:00
add_executable(state_sub src/exe/state_sub.cpp)
target_link_libraries(state_sub ${EXTRA_LIBS} ${catkin_LIBRARIES})
add_dependencies(state_sub ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
2021-09-01 20:46:41 +08:00
2022-05-24 16:05:24 +08:00
add_executable(ros_udp src/exe/ros_udp.cpp)
target_link_libraries(ros_udp ${EXTRA_LIBS} ${catkin_LIBRARIES})
add_dependencies(ros_udp ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
2021-09-01 20:46:41 +08:00
2022-05-27 11:24:44 +08:00
add_executable(control_via_keyboard src/exe/control_via_keyboard.cpp)
target_link_libraries(control_via_keyboard ${EXTRA_LIBS} ${catkin_LIBRARIES})
add_dependencies(control_via_keyboard ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_executable(twist_sub src/exe/twist_sub.cpp)
target_link_libraries(twist_sub ${EXTRA_LIBS} ${catkin_LIBRARIES})
add_dependencies(twist_sub ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})