From aa3920dd28648a0d77c3d14114e6dcf136d923e0 Mon Sep 17 00:00:00 2001 From: tangger Date: Mon, 7 Apr 2025 22:03:32 +0800 Subject: [PATCH] fix --- .gitignore | 3 ++- .../__pycache__/agilex_robot.cpython-310.pyc | Bin 8689 -> 8474 bytes lerobot_aloha/common/agilex_robot.py | 22 +++++++++--------- lerobot_aloha/main.py | 2 +- lerobot_aloha/test.py | 6 ++--- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index a587ac0..6441836 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ cobot_magic/ librealsense/ -data*/ \ No newline at end of file +data*/ +outputs/ \ No newline at end of file diff --git a/lerobot_aloha/common/__pycache__/agilex_robot.cpython-310.pyc b/lerobot_aloha/common/__pycache__/agilex_robot.cpython-310.pyc index 84750e2179c4db3f4f04842c879dbd4196c0f312..3cb50e6ccc4217bad577ed974564ab5d7deb8765 100644 GIT binary patch delta 475 zcmez9Jj;nUpO=@50SI!=d`@4#kyl=VF>14}gc1`UA5f4Dh@FABSYUFjlpACCs@h=cq2xMpR#tWu1q_8bw1d0pQa4ir9 ziN=f6a05xv8Xh1iR>P1bp2A+kKAT}KlO)3ei5gyziG_+aY(>o_j0+@7q!vimuq|X< z$QaB3Co3wtu+{?wq9$i4+Op+=q_`$OP!OMdL{S$2F|2YK delta 696 zcmZvX&ubGw6vtFQwf}3U;emn zwzO)2M%$+f^D#XSViIfx%x}x}(pCCGek|SIv=u?x>X5Jzp8_u>l0`D1cKk_#jSgZP zw6Vt1fhM%J9@4RnJ+=aB2GopDg)TA$f}AB`e4G{8u_}}xE7Xuu!gCWc&hh+&h@5Hg zqwSgCSO|XGFjr??Vo!abkSGW>D57lYA_XjoG;j`99k-`N@*Q~}E0Ulrayas7T`24m zr$GfCP!&o@Lwc7$TyqI}i|RI;drhwl;J-h?2>B6wb@!a-FP9n0hhq4DVlN!Zo8>cW zBgpIzIHcs?y!{R=p@>_6Na=dqV}4|Gtqqeo9gDYyj>#?NI-C`uLVhcsr**kgzBnH# zO|SQ;<+9V*ejl-lXaJ%_v(xI!<;uCGHPqHoQ~QI5otFRDfd$FGKD&o$6Y&7Bn3ta` z8)qY}Ibh7`ant7(cN(dKufaZBH^O{>XUUXL+(vbsR8$vf4BnRq^? z(==7%3dNh)NyOEd99Ex|1a9jhIN}vz31P^stRd^Q6LeGFs9ioX0Wp%Yc7b~Gd+quz D_wTbx diff --git a/lerobot_aloha/common/agilex_robot.py b/lerobot_aloha/common/agilex_robot.py index 0dfca78..ce63d76 100644 --- a/lerobot_aloha/common/agilex_robot.py +++ b/lerobot_aloha/common/agilex_robot.py @@ -366,18 +366,18 @@ class AgilexRobot(Robot): from_idx = to_idx # Apply safety checks if configured - if 'max_relative_target' in self.config: - # Get current position from the queue - if len(self.sync_arm_queues[arm_name]) > 0: - current_state = self.sync_arm_queues[arm_name][-1] - current_pos = np.array(current_state.position) + # if 'max_relative_target' in self.config: + # # Get current position from the queue + # if len(self.sync_arm_queues[arm_name]) > 0: + # current_state = self.sync_arm_queues[arm_name][-1] + # current_pos = np.array(current_state.position) - # Clip the action to stay within max relative target - max_delta = self.config['max_relative_target'] - clipped_action = np.clip(arm_action, - current_pos - max_delta, - current_pos + max_delta) - arm_action = clipped_action + # # Clip the action to stay within max relative target + # max_delta = self.config['max_relative_target'] + # clipped_action = np.clip(arm_action, + # current_pos - max_delta, + # current_pos + max_delta) + # arm_action = clipped_action action_sent.append(arm_action) diff --git a/lerobot_aloha/main.py b/lerobot_aloha/main.py index 0dc0290..f7c6391 100644 --- a/lerobot_aloha/main.py +++ b/lerobot_aloha/main.py @@ -2,7 +2,7 @@ import argparse from common.rosrobot_factory import RobotFactory from common.utils.data_utils import record from common.utils.replay_utils import replay - +import cv2 def get_arguments(): """ diff --git a/lerobot_aloha/test.py b/lerobot_aloha/test.py index 8eb8748..7aea744 100644 --- a/lerobot_aloha/test.py +++ b/lerobot_aloha/test.py @@ -2,7 +2,7 @@ from lerobot.common.policies.act.modeling_act import ACTPolicy from lerobot.common.robot_devices.utils import busy_wait import time import argparse -from agilex_robot import AgilexRobot +from common.agilex_robot import AgilexRobot import torch def get_arguments(): @@ -29,12 +29,12 @@ def get_arguments(): cfg = get_arguments() -robot = AgilexRobot(config_file="/home/ubuntu/LYT/aloha_lerobot/collect_data/agilex.yaml", args=cfg) +robot = AgilexRobot(config_file="/home/ubuntu/LYT/lerobot_aloha/lerobot_aloha/configs/agilex.yaml", args=cfg) inference_time_s = 360 fps = 30 device = "cuda" # TODO: On Mac, use "mps" or "cpu" -ckpt_path = "/home/ubuntu/LYT/lerobot/outputs/train/act_move_tube_on_scale/checkpoints/last/pretrained_model" +ckpt_path = "/home/ubuntu/LYT/lerobot_aloha/outputs/train/act_move_tube_on_scale/checkpoints/last/pretrained_model" policy = ACTPolicy.from_pretrained(ckpt_path) policy.to(device)