Control robot grasping actions — grasp objects, retract arms, and handover items via scripts.(控制机器人抓取动作 — 通过演示脚本抓取物体、收回手臂及向用户递交物品。)
Control the robot's manipulation capabilities, including object grasping, arm retraction, and handing over items to users.
BEFORE executing any motion-related command:
1. Run: curl -s http://localhost:18790/api/home/status | jq '.data.available | any(. == "运动")'
2. If the output is false: STOP and tell the user "Motion mode is not enabled"
4. If found: Proceed with the motion command
DO NOT skip this check. DO NOT execute motion commands without verification.
Before performing the grasp, the object list in {baseDir}/objects.txt must be read first.
All commands should be executed from the directory using the specific uv environment Python interpreter.
{baseDir}/scripts/cd {baseDir}/scripts/ && uv run [script_name].py [argument]
Grasp a specific item on a surface based on its class name.
grasp.pyobject_name (e.g., apple, bottle, orange)
Example:cd {baseDir}/scripts/ && uv run grasp.py apple
Retract the specified arm after performing a grasp.
retract.pyleft or rightExample (Retract Right Arm):
cd {baseDir}/scripts/ && uv run retract.py right
Identify a user and hand over the item held in the specified hand.
handover.pyleft or rightExample (Handover from Left Hand):
cd {baseDir}/scripts/ && uv run handover.py left
The scripts will return a text output. Successful execution is indicated by a string starting with [Unitree].
Example:
grasp action, ensure that the target object is clearly visible in the robot's camera field of view. If the object is not visible, navigate to the location of the object first.If the user specifies going to a specific location to pick up an object, it is also necessary to first determine whether the object exists.retract or handover motions.retract after a grasp to ensure the robot returns to a stable posture before moving.