diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..8a5de8a --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "unitree_legged_sdk"] + path = unitree_legged_sdk + url = https://github.com/unitreerobotics/unitree_legged_sdk.git diff --git a/unitree_legged_real/CMakeLists.txt b/unitree_legged_real/CMakeLists.txt index d0f1fff..413cc42 100755 --- a/unitree_legged_real/CMakeLists.txt +++ b/unitree_legged_real/CMakeLists.txt @@ -1,12 +1,13 @@ cmake_minimum_required(VERSION 2.8.3) project(unitree_legged_real) -add_compile_options(-std=c++11) +set(CMAKE_CXX_FLAGS "-O3 -fPIC -std=c++11") find_package(catkin REQUIRED COMPONENTS roscpp geometry_msgs unitree_legged_msgs + unitree_legged_sdk ) catkin_package() @@ -18,32 +19,21 @@ else() set(ARCH arm64) endif() -link_directories(${CMAKE_SOURCE_DIR}/unitree_legged_sdk/lib/cpp/${ARCH}) - -set(EXTRA_LIBS -pthread libunitree_legged_sdk.so) - -set(CMAKE_CXX_FLAGS "-O3 -fPIC") +set(EXTRA_LIBS -pthread ${unitree_legged_sdk_LIBRARIES}) include_directories( include ${catkin_INCLUDE_DIRS} - ${CMAKE_SOURCE_DIR}/unitree_legged_sdk/include + ${unitree_legged_sdk_INCLUDE_DIRS} ) +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}) - - - - - - -add_executable(example_walk src/exe/example_walk.cpp) -target_link_libraries(example_walk ${EXTRA_LIBS} ${catkin_LIBRARIES}) -add_dependencies(example_walk ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) - -add_executable(example_position src/exe/example_position.cpp) -target_link_libraries(example_position ${EXTRA_LIBS} ${catkin_LIBRARIES}) -add_dependencies(example_position ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) +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}) add_executable(state_sub src/exe/state_sub.cpp) target_link_libraries(state_sub ${EXTRA_LIBS} ${catkin_LIBRARIES}) diff --git a/unitree_legged_real/package.xml b/unitree_legged_real/package.xml index 68c09e5..873eeac 100644 --- a/unitree_legged_real/package.xml +++ b/unitree_legged_real/package.xml @@ -15,6 +15,7 @@ roscpp std_msgs unitree_legged_msgs + unitree_legged_sdk eigen \ No newline at end of file diff --git a/unitree_legged_sdk b/unitree_legged_sdk new file mode 160000 index 0000000..b3f3f42 --- /dev/null +++ b/unitree_legged_sdk @@ -0,0 +1 @@ +Subproject commit b3f3f4236709722b3719b5da4bdf2449b277bf86