From b8a76bab6980f4c8dbd7ebbaf195c4bb69864e8c Mon Sep 17 00:00:00 2001 From: yutang Date: Tue, 9 Dec 2025 14:29:12 +0800 Subject: [PATCH] xiufu --- realman.yml | 26 +++++++++++------------ record.py | 1 - robot_client/robots/realman/motors_bus.py | 6 ++++-- robot_client/robots/realman/robot.py | 2 +- test.py | 10 +++++++++ 5 files changed, 28 insertions(+), 17 deletions(-) create mode 100644 test.py diff --git a/realman.yml b/realman.yml index 0a99cfee..e710986b 100644 --- a/realman.yml +++ b/realman.yml @@ -1,6 +1,6 @@ type: realman port: 192.168.3.18:8080 -mock: True +mock: False mode: 1 gripper_range: - 10 @@ -9,31 +9,31 @@ motors: joint_1: id: 1 model: realman - norm_mode: DEGREES + norm_mode: degrees joint_2: id: 2 model: realman - norm_mode: DEGREES + norm_mode: degrees joint_3: id: 3 model: realman - norm_mode: DEGREES + norm_mode: degrees joint_4: id: 4 model: realman - norm_mode: DEGREES + norm_mode: degrees joint_5: id: 5 model: realman - norm_mode: DEGREES + norm_mode: degrees joint_6: id: 6 model: realman - norm_mode: DEGREES + norm_mode: degrees gripper: id: 7 model: realman - norm_mode: DEGREES + norm_mode: degrees # cameras: # left: # serial_number_or_name: 153122077516 @@ -54,10 +54,10 @@ motors: # height: 480 # use_depth: False joint: - - -90 + - 15 - 90 - - 90 - - 90 - - 90 - - -90 + - 10 + - 80 + - 110 + - 0 - 10 \ No newline at end of file diff --git a/record.py b/record.py index aac19fd0..91d3d0ff 100644 --- a/record.py +++ b/record.py @@ -79,7 +79,6 @@ from lerobot.datasets.utils import build_dataset_frame, combine_feature_dicts from lerobot.datasets.video_utils import VideoEncodingManager from lerobot.policies.factory import make_policy, make_pre_post_processors from lerobot.policies.pretrained import PreTrainedPolicy -from lerobot.policies.utils import make_robot_action from lerobot.processor import ( PolicyAction, PolicyProcessorPipeline, diff --git a/robot_client/robots/realman/motors_bus.py b/robot_client/robots/realman/motors_bus.py index f7123329..44832b13 100644 --- a/robot_client/robots/realman/motors_bus.py +++ b/robot_client/robots/realman/motors_bus.py @@ -75,7 +75,7 @@ class RealmanMotorsBus(MotorsBus): if mock: self.rmarm = RoboticArmMock() else: - self.rmarm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E) + self.rmarm = RoboticArm(rm_thread_mode_e.RM_DUAL_MODE_E) address = port.split(':') self.ip = address[0] self.port = int(address[1]) @@ -103,6 +103,9 @@ class RealmanMotorsBus(MotorsBus): ''' 使能机械臂并检测使能状态,尝试5s,如果使能超时则退出程序 ''' + + self.handle = self.rmarm.rm_create_robot_arm(self.ip, self.port) + self.rmarm.rm_set_arm_run_mode(0) enable_flag = False loop_flag = False # 设置超时时间(秒) @@ -140,7 +143,6 @@ class RealmanMotorsBus(MotorsBus): break time.sleep(1) - self.handle = self.rmarm.rm_create_robot_arm(self.ip, self.port) self.rmarm.rm_movej(self.init_joint_position[:-1], 5, 0, 0, 1) time.sleep(3) ret = self.rmarm.rm_get_current_arm_state() diff --git a/robot_client/robots/realman/robot.py b/robot_client/robots/realman/robot.py index 3ca379a2..75d4bedf 100644 --- a/robot_client/robots/realman/robot.py +++ b/robot_client/robots/realman/robot.py @@ -68,7 +68,7 @@ class RealmanRobot(Robot): "Mismatch between calibration values in the motor and the calibration file or no calibration file found" ) self.calibrate() - self.configure() + # self.configure() logger.info(f"{self} connected.") @property diff --git a/test.py b/test.py new file mode 100644 index 00000000..9f1f3dca --- /dev/null +++ b/test.py @@ -0,0 +1,10 @@ +import time +from Robotic_Arm.rm_robot_interface import * +if __name__=="__main__": + rmarm = RoboticArm(rm_thread_mode_e.RM_DUAL_MODE_E) + rmarm.rm_create_robot_arm("192.168.3.18", 8080) + rmarm.rm_set_arm_run_mode(0) + while True: + ret = rmarm.rm_get_arm_software_info() + print(ret) + time.sleep(1) \ No newline at end of file