From 9a2fbe800e7a43d3fd0bcf0b0f77fa6aad154c0f Mon Sep 17 00:00:00 2001 From: Kei Okada Date: Tue, 29 Mar 2022 17:07:51 +0900 Subject: [PATCH] add ROBOT_SDK variable to specify unitree_legged_sdk path, run 'catkin b -vi --cmake-args -DROBOT_SDK=/home/k-okada/catkin_ws/ws_unitree/src/' to change your local environment --- unitree_legged_real/CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/unitree_legged_real/CMakeLists.txt b/unitree_legged_real/CMakeLists.txt index 43dee3c..c666b75 100755 --- a/unitree_legged_real/CMakeLists.txt +++ b/unitree_legged_real/CMakeLists.txt @@ -19,12 +19,14 @@ include_directories( set(CMAKE_CXX_FLAGS "-O3") -include_directories(/home/$ENV{USER}/Robot_SDK/unitree_legged_sdk/include) -link_directories(/home/$ENV{USER}/Robot_SDK/unitree_legged_sdk/lib) +set(ROBOT_SDK ${CATKIN_DEVEL_PREFIX}/../../../src CACHE PATH "Location of unitree_legged_sdk directory") +message("-- ROBOT_SDK ${ROBOT_SDK}") +include_directories(${ROBOT_SDK}/unitree_legged_sdk/include) +link_directories(${ROBOT_SDK}/unitree_legged_sdk/lib) string(CONCAT LEGGED_SDK_NAME libunitree_legged_sdk_amd64.so) set(EXTRA_LIBS ${LEGGED_SDK_NAME} lcm) -add_executable(lcm_server /home/$ENV{USER}/Robot_SDK/unitree_legged_sdk/examples/lcm_server.cpp) +add_executable(lcm_server ${ROBOT_SDK}/unitree_legged_sdk/examples/lcm_server.cpp) target_link_libraries(lcm_server ${EXTRA_LIBS} ${catkin_LIBRARIES}) add_dependencies(lcm_server ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) @@ -42,4 +44,4 @@ add_dependencies(torque_lcm ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTE add_executable(walk_lcm src/exe/walk_mode.cpp) target_link_libraries(walk_lcm ${EXTRA_LIBS} ${catkin_LIBRARIES}) -add_dependencies(walk_lcm ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) \ No newline at end of file +add_dependencies(walk_lcm ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})