-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
266 changed files
with
55,416 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
build | ||
|
||
*.o | ||
.vscode | ||
.clang-format | ||
data | ||
*.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
cmake_minimum_required(VERSION 2.8.3) | ||
project(unitree_legged_sdk) | ||
|
||
# check arch and os | ||
message("-- CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}") | ||
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64.*") | ||
set(ARCH amd64) | ||
endif() | ||
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "aarch64.*") | ||
set(ARCH arm64) | ||
endif() | ||
|
||
include_directories(include) | ||
link_directories(lib/cpp/${ARCH}) | ||
|
||
option(PYTHON_BUILD "build python wrapper" OFF) | ||
if(PYTHON_BUILD) | ||
add_subdirectory(python_wrapper) | ||
endif() | ||
|
||
set(EXTRA_LIBS -pthread libunitree_legged_sdk.a) | ||
set(CMAKE_CXX_FLAGS "-O3 -fPIC") | ||
set(CMAKE_CXX_STANDARD 14) | ||
|
||
find_package(catkin QUIET) | ||
if(${catkin_FOUND}) | ||
catkin_package( | ||
INCLUDE_DIRS include | ||
LIBRARIES ${PROJECT_SOURCE_DIR}/lib/cpp/${ARCH}/libunitree_legged_sdk.a | ||
) | ||
endif() | ||
|
||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) | ||
|
||
# one pc one process | ||
add_executable(example_position example/example_position.cpp) | ||
target_link_libraries(example_position ${EXTRA_LIBS}) | ||
|
||
add_executable(example_velocity example/example_velocity.cpp) | ||
target_link_libraries(example_velocity ${EXTRA_LIBS}) | ||
|
||
add_executable(example_torque example/example_torque.cpp) | ||
target_link_libraries(example_torque ${EXTRA_LIBS}) | ||
|
||
add_executable(example_walk example/example_walk.cpp) | ||
target_link_libraries(example_walk ${EXTRA_LIBS}) | ||
|
||
add_executable(example_joystick example/example_joystick.cpp) | ||
target_link_libraries(example_joystick ${EXTRA_LIBS}) | ||
|
||
|
||
# install | ||
install(TARGETS | ||
example_position example_velocity example_torque example_walk example_joystick | ||
DESTINATION bin/unitree) | ||
install(DIRECTORY lib/cpp/${ARCH}/ | ||
DESTINATION lib/unitree | ||
USE_SOURCE_PERMISSIONS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
cmake_minimum_required(VERSION 2.8.3) | ||
project(unitree_legged_sdk) | ||
|
||
find_package(Torch REQUIRED) | ||
|
||
# check arch and os | ||
message("-- CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}") | ||
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64.*") | ||
set(ARCH amd64) | ||
endif() | ||
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "aarch64.*") | ||
set(ARCH arm64) | ||
endif() | ||
|
||
include_directories(include) | ||
link_directories(lib/cpp/${ARCH}) | ||
|
||
option(PYTHON_BUILD "build python wrapper" OFF) | ||
if(PYTHON_BUILD) | ||
add_subdirectory(python_wrapper) | ||
endif() | ||
|
||
set(EXTRA_LIBS -pthread libunitree_legged_sdk.a) | ||
set(CMAKE_CXX_FLAGS "-O3 -fPIC") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}") | ||
set(CMAKE_CXX_STANDARD 14) | ||
|
||
#one pc one process | ||
add_executable(example_position example/example_position.cpp) | ||
target_link_libraries(example_position ${EXTRA_LIBS}) | ||
|
||
add_executable(example_velocity example/example_velocity.cpp) | ||
target_link_libraries(example_velocity ${EXTRA_LIBS}) | ||
|
||
add_executable(example_torque example/example_torque.cpp) | ||
target_link_libraries(example_torque ${EXTRA_LIBS}) | ||
|
||
add_executable(example_walk example/example_walk.cpp) | ||
target_link_libraries(example_walk ${EXTRA_LIBS}) | ||
|
||
add_executable(example_joystick example/example_joystick.cpp) | ||
target_link_libraries(example_joystick ${EXTRA_LIBS}) | ||
|
||
add_executable(nn_with_wireless_handle example/nn_with_wireless_handle.cpp) | ||
target_link_libraries(nn_with_wireless_handle ${TORCH_LIBRARIES} ${EXTRA_LIBS}) | ||
|
||
add_executable(nn_test example/nn_test.cpp) | ||
target_link_libraries(nn_test ${EXTRA_LIBS}) | ||
|
||
|
||
# target_link_libraries(nn_with_wireless_handle ${EXTRA_LIBS}) | ||
|
||
|
||
# install | ||
# install(TARGETS | ||
# example_position example_velocity example_torque example_walk example_joystick | ||
# DESTINATION bin/unitree) | ||
# install(DIRECTORY lib/cpp/${ARCH}/ | ||
# DESTINATION lib/unitree | ||
# USE_SOURCE_PERMISSIONS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
BSD 3-Clause License | ||
|
||
Copyright (c) 2016-2022 HangZhou YuShu TECHNOLOGY CO.,LTD. ("Unitree Robotics") | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
* Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# v3.8.6 | ||
The unitree_legged_sdk is mainly used for communication between PC and Controller board. | ||
It also can be used in other PCs with UDP. | ||
|
||
### Notice | ||
support robot: Go1 | ||
|
||
not support robot: Laikago, B1, Aliengo, A1. (Check release [v3.3.1](https://github.com/unitreerobotics/unitree_legged_sdk/releases/tag/v3.3.1) for support) | ||
|
||
### Dependencies | ||
* [Unitree](https://www.unitree.com/download) | ||
```bash | ||
Legged_sport >= v1.36.0 | ||
firmware H0.1.7 >= v0.1.35 | ||
H0.1.9 >= v0.1.35 | ||
``` | ||
* [Boost](http://www.boost.org) (version 1.5.4 or higher) | ||
* [CMake](http://www.cmake.org) (version 2.8.3 or higher) | ||
* [g++](https://gcc.gnu.org/) (version 8.3.0 or higher) | ||
|
||
|
||
### Build | ||
```bash | ||
mkdir build | ||
cd build | ||
cmake .. | ||
make | ||
``` | ||
|
||
If you want to build the python wrapper, then replace the cmake line with: | ||
```bash | ||
cmake -DPYTHON_BUILD=TRUE .. | ||
``` | ||
|
||
If can not find pybind11 headers, then add | ||
```bash | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third-party/pybind11/include) | ||
``` | ||
at line 14 in python_wrapper/CMakeLists.txt. | ||
|
||
If can not find msgpack.hpp, then | ||
```bash | ||
sudo apt install libmsgpack* | ||
``` | ||
|
||
### Run | ||
|
||
#### Cpp | ||
Run examples with 'sudo' for memory locking. | ||
|
||
#### Python | ||
##### arm | ||
change `sys.path.append('../lib/python/amd64')` to `sys.path.append('../lib/python/arm64')` |
Oops, something went wrong.