cpp对齐官方
This commit is contained in:
7
tests/cpp/package_consumer/CMakeLists.txt
Normal file
7
tests/cpp/package_consumer/CMakeLists.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
project(unitree_legged_sdk_package_consumer LANGUAGES CXX)
|
||||
|
||||
find_package(unitree_legged_sdk 3.8 CONFIG REQUIRED)
|
||||
|
||||
add_executable(package_consumer main.cpp)
|
||||
target_link_libraries(package_consumer PRIVATE unitree_legged_sdk::unitree_legged_sdk)
|
||||
9
tests/cpp/package_consumer/main.cpp
Normal file
9
tests/cpp/package_consumer/main.cpp
Normal file
@@ -0,0 +1,9 @@
|
||||
#include "unitree_legged_sdk/unitree_legged_sdk.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
int main() {
|
||||
UNITREE_LEGGED_SDK::LowCmd command{};
|
||||
command.motorCmd[UNITREE_LEGGED_SDK::FR_0].q = 0.0f;
|
||||
return UNITREE_LEGGED_SDK::VersionSDK().empty() ? 1 : 0;
|
||||
}
|
||||
Reference in New Issue
Block a user