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 84750e2..3cb50e6 100644 Binary files a/lerobot_aloha/common/__pycache__/agilex_robot.cpython-310.pyc and b/lerobot_aloha/common/__pycache__/agilex_robot.cpython-310.pyc differ 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)