From 5bf422ca6ff0ff0fdf1a26701a5cbd3b63f4e155 Mon Sep 17 00:00:00 2001 From: tangger Date: Wed, 7 May 2025 20:10:08 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E5=AD=98=E5=82=A8=E7=9A=84st?= =?UTF-8?q?ate=E5=92=8Caction=E4=B8=BA=E7=9B=B8=E5=90=8C=E7=9A=84=E5=BA=A6?= =?UTF-8?q?=E9=87=8F=EF=BC=8C=E5=B0=8F=E6=95=B0=E5=BA=A6=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + lerobot/common/robot_devices/motors/piper.py | 16 ++++++++-------- lerobot/common/robot_devices/robots/piper.py | 4 ---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index d2364fe..8632d20 100644 --- a/README.md +++ b/README.md @@ -125,3 +125,4 @@ python lerobot/scripts/control_robot.py \ --control.policy.path=outputs/train/act_koch_pick_place_lego/checkpoints/latest/pretrained_model ``` +export LD_LIBRARY_PATH=/home/ubuntu/miniconda3/envs/piper_lerobot/lib:$LD_LIBRARY_PATH \ No newline at end of file diff --git a/lerobot/common/robot_devices/motors/piper.py b/lerobot/common/robot_devices/motors/piper.py index b532095..ab829b3 100644 --- a/lerobot/common/robot_devices/motors/piper.py +++ b/lerobot/common/robot_devices/motors/piper.py @@ -160,17 +160,17 @@ class PiperMotorsBus: gripper_state = gripper_msg.gripper_state return { - "joint_1": joint_state.joint_1, - "joint_2": joint_state.joint_2, - "joint_3": joint_state.joint_3, - "joint_4": joint_state.joint_4, - "joint_5": joint_state.joint_5, - "joint_6": joint_state.joint_6, - "gripper": gripper_state.grippers_angle + "joint_1": joint_state.joint_1 / self.joint_factor, + "joint_2": joint_state.joint_2 / self.joint_factor, + "joint_3": joint_state.joint_3 / self.joint_factor, + "joint_4": joint_state.joint_4 / self.joint_factor, + "joint_5": joint_state.joint_5 / self.joint_factor, + "joint_6": joint_state.joint_6 / self.joint_factor, + "gripper": gripper_state.grippers_angle / 1000 / 1000 } def safe_disconnect(self): """ Move to safe disconnect position """ - self.write(target_joint=self.safe_disable_position) \ No newline at end of file + self.write("joints", target_joint=self.safe_disable_position) \ No newline at end of file diff --git a/lerobot/common/robot_devices/robots/piper.py b/lerobot/common/robot_devices/robots/piper.py index d594f1f..2bca07e 100644 --- a/lerobot/common/robot_devices/robots/piper.py +++ b/lerobot/common/robot_devices/robots/piper.py @@ -184,8 +184,6 @@ class PiperRobot: return obs_dict, action_dict - - def send_action(self, action: torch.Tensor) -> torch.Tensor: """Write the predicted actions from policy to the motors""" if not self.is_connected: @@ -199,8 +197,6 @@ class PiperRobot: return action - - def capture_observation(self) -> dict: """capture current images and joint positions""" if not self.is_connected: