support for arm64

This commit is contained in:
Agnel Wang 2023-04-26 16:16:38 +08:00
parent 155b0473d3
commit 63c06067ca
14 changed files with 17 additions and 15 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.vscode
build

View File

@ -13,14 +13,14 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../lib)
link_directories(lib) link_directories(lib)
add_executable(highcmd_basic examples/highcmd_basic.cpp ) add_executable(highcmd_basic examples/highcmd_basic.cpp )
target_link_libraries(highcmd_basic Z1_SDK_Linux64) target_link_libraries(highcmd_basic Z1_SDK_${CMAKE_HOST_SYSTEM_PROCESSOR})
add_executable(highcmd_development examples/highcmd_development.cpp ) add_executable(highcmd_development examples/highcmd_development.cpp )
target_link_libraries(highcmd_development Z1_SDK_Linux64) target_link_libraries(highcmd_development Z1_SDK_${CMAKE_HOST_SYSTEM_PROCESSOR})
add_executable(lowcmd_development examples/lowcmd_development.cpp ) add_executable(lowcmd_development examples/lowcmd_development.cpp )
target_link_libraries(lowcmd_development Z1_SDK_Linux64) target_link_libraries(lowcmd_development Z1_SDK_${CMAKE_HOST_SYSTEM_PROCESSOR})
add_executable(lowcmd_multirobots examples/lowcmd_multirobots.cpp ) add_executable(lowcmd_multirobots examples/lowcmd_multirobots.cpp )
target_link_libraries(lowcmd_multirobots Z1_SDK_Linux64) target_link_libraries(lowcmd_multirobots Z1_SDK_${CMAKE_HOST_SYSTEM_PROCESSOR})
add_subdirectory(pybind11) add_subdirectory(pybind11)
pybind11_add_module(unitree_arm_interface examples_py/arm_python_interface.cpp) pybind11_add_module(unitree_arm_interface examples_py/arm_python_interface.cpp)
target_link_libraries(unitree_arm_interface PRIVATE Z1_SDK_Linux64) target_link_libraries(unitree_arm_interface PRIVATE Z1_SDK_${CMAKE_HOST_SYSTEM_PROCESSOR})

View File

@ -21,16 +21,16 @@ void Z1ARM::armCtrlByFSM() {
std::cout << "[MOVEJ]" << std::endl; std::cout << "[MOVEJ]" << std::endl;
posture[0]<<0.5,0.1,0.1,0.5,-0.2,0.5; posture[0]<<0.5,0.1,0.1,0.5,-0.2,0.5;
MoveJ(posture[0], 0, 1.0); MoveJ(posture[0], 0, 2.0);
std::cout << "[MOVEL]" << std::endl; std::cout << "[MOVEL]" << std::endl;
posture[0] << 0,0,0,0.45,-0.2,0.2; posture[0] << 0,0,0,0.45,-0.2,0.2;
MoveL(posture[0], 0, 0.3); MoveL(posture[0], 0, 0.5);
std::cout << "[MOVEC]" << std::endl; std::cout << "[MOVEC]" << std::endl;
posture[0] << 0,0,0,0.45,0,0.4; posture[0] << 0,0,0,0.45,0,0.4;
posture[1] << 0,0,0,0.45,0.2,0.2; posture[1] << 0,0,0,0.45,0.2,0.2;
MoveC(posture[0], posture[1], 0, 0.3); MoveC(posture[0], posture[1], 0, 0.5);
} }
void Z1ARM::armCtrlInJointCtrl(){ void Z1ARM::armCtrlInJointCtrl(){
@ -39,7 +39,7 @@ void Z1ARM::armCtrlInJointCtrl(){
for(int i(0); i<1000;i++){ for(int i(0); i<1000;i++){
directions<< 0, 0, 0, -1, 0, 0, -1; directions<< 0, 0, 0, -1, 0, 0, -1;
jointCtrlCmd(directions, 0.5); jointCtrlCmd(directions, 1.0);
usleep(_ctrlComp->dt*1000000); usleep(_ctrlComp->dt*1000000);
} }
} }
@ -50,7 +50,7 @@ void Z1ARM::armCtrlInCartesian(){
for(int i(0); i<2000;i++){ for(int i(0); i<2000;i++){
directions<< 0, 0, 0, 0, 0, -1, -1; directions<< 0, 0, 0, 0, 0, -1, -1;
cartesianCtrlCmd(directions, 0.3, 0.1); cartesianCtrlCmd(directions, 0.3, 0.2);
usleep(_ctrlComp->dt*1000000); usleep(_ctrlComp->dt*1000000);
} }
} }

View File

@ -15,20 +15,20 @@ arm.loopOn()
arm.labelRun("forward") arm.labelRun("forward")
arm.startTrack(armState.JOINTCTRL) arm.startTrack(armState.JOINTCTRL)
for i in range(0, 1000): for i in range(0, 1000):
arm.jointCtrlCmd(np.array([0,0,0,-1,0,0,-1]), 0.5) arm.jointCtrlCmd(np.array([0,0,0,-1,0,0,-1]), 1.0)
time.sleep(arm._ctrlComp.dt) time.sleep(arm._ctrlComp.dt)
# 2. highcmd_basic : armCtrlByFSM # 2. highcmd_basic : armCtrlByFSM
arm.labelRun("forward") arm.labelRun("forward")
arm.MoveJ(np.array([0.5,0.1,0.1,0.5,-0.2,0.5]), 0.0, 1.0) arm.MoveJ(np.array([0.5,0.1,0.1,0.5,-0.2,0.5]), 0.0, 2.0)
arm.MoveL(np.array([0,0,0,0.45,-0.2,0.2]), -1.0, 0.3) arm.MoveL(np.array([0,0,0,0.45,-0.2,0.2]), -1.0, 0.5)
arm.MoveC(np.array([0,0,0,0.45,0,0.4]), np.array([0,0,0,0.45,0.2,0.2]), 0.0, 0.3) arm.MoveC(np.array([0,0,0,0.45,0,0.4]), np.array([0,0,0,0.45,0.2,0.2]), 0.0, 0.5)
# 3. highcmd_basic : armCtrlInCartesian # 3. highcmd_basic : armCtrlInCartesian
arm.labelRun("forward") arm.labelRun("forward")
arm.startTrack(armState.CARTESIAN) arm.startTrack(armState.CARTESIAN)
for i in range(0, 1000): for i in range(0, 1000):
arm.cartesianCtrlCmd(np.array([0,0,0,0,0,-1,-1]), 0.3, 0.1) arm.cartesianCtrlCmd(np.array([0,0,0,0,0,-1,-1]), 0.3, 0.2)
time.sleep(arm._ctrlComp.dt) time.sleep(arm._ctrlComp.dt)
arm.backToStart() arm.backToStart()

0
include/unitree_arm_sdk/math/mathTools.h Normal file → Executable file
View File

0
include/unitree_arm_sdk/math/mathTypes.h Normal file → Executable file
View File

0
include/unitree_arm_sdk/math/typeTrans.h Normal file → Executable file
View File

0
include/unitree_arm_sdk/message/arm_common.h Normal file → Executable file
View File

0
include/unitree_arm_sdk/thirdparty/quadProgpp/Array.hh vendored Normal file → Executable file
View File

0
include/unitree_arm_sdk/thirdparty/quadProgpp/QuadProg++.hh vendored Normal file → Executable file
View File

0
include/unitree_arm_sdk/utilities/loop.h Normal file → Executable file
View File

BIN
lib/libZ1_SDK_aarch64.so Normal file

Binary file not shown.

BIN
lib/libZ1_SDK_Linux64.so → lib/libZ1_SDK_x86_64.so Normal file → Executable file

Binary file not shown.

Binary file not shown.