Control Robot¶
The take_action function in _base_task is used to control actions during task execution. It accepts two parameters: action and action_type.
1. Supported Action Types¶
The parameter action_type supports two modes:
qpos(Joint Position Control) — defaultee(End-Effector Pose Control)
Depending on the selected mode, the format and dimension of the input action will differ.
1.1 qpos Mode (Joint Position Control)¶
In qpos mode, the action is defined as:
[left_arm_joints + left_gripper + right_arm_joints + right_gripper]
- The specific dimension of the
actiondepends on the robotic arm configuration. - The system will automatically adjust the input dimensions during deployment to match the specific robot configuration.
1.2 ee Mode (End-Effector Pose Control)¶
In ee mode, the action is defined as:
[left_end_effector_pose (xyz + quaternion) + left_gripper + right_end_effector_pose + right_gripper]
- The dimension is fixed, regardless of the robot configuration.
2. Deployment Example¶
Policy evaluation now goes through XPolicyLab. See XPolicyLab/policy/demo_policy/deploy.py and model.py for the reference adapter, and use scripts/eval_policy.sh for RoboTwin evaluation.