Demonstrations of Using the Unitree D1 Robotic Arm to Open Cabinet Doors and Grasp Objects
Grasping Phillips Screwdriver (Tool selected based on real-time audio recognition)
Usage Example: src/test_grasp.py
How to Build from Scratch?
-
Use the script
src/get_arm_joint_angle.cpp
to record key poses for grasping:- After running it in the terminal, you can get real-time joint angles. On MAC, use the shortcut by pressing 'r' followed by 'ENTER' to record.
- Key poses will be saved in
build/servo_commands.txt
, which can be copied into multi-joint angle control programs, such asleft_1.cpp
.
-
Implement multi-joint angle control for grasping, split into multiple stages (e.g., opening the left cabinet door is split into
left_1.cpp
andleft_2.cpp
) because:- It makes debugging easier;
- Increases the accuracy of grasping;
- Helps alleviate communication message delay (alternatively, add a sleep command or wait for the previous message to execute before sending the next one).
-
Ensure that the angle of the sixth joint remains unchanged after grasping the tool until it is released, to prevent it from dropping.
-
Modify
CMakeLists.txt
, usecmake
to build, andmake
to compile into binary shared libraries, such aslibleft_1.so
andlibleft_2.so
. -
Call the shared libraries in C++ or Python to implement grasping. Example usage can be found in
src/test_grasp.py
.
- Refer to the Unitree D1 Robotic Arm Development Guide: https://support.unitree.com/home/zh/developer/D1Arm_services