This commit is contained in:
2025-12-09 14:29:12 +08:00
parent bcb678c608
commit b8a76bab69
5 changed files with 28 additions and 17 deletions

View File

@@ -1,6 +1,6 @@
type: realman type: realman
port: 192.168.3.18:8080 port: 192.168.3.18:8080
mock: True mock: False
mode: 1 mode: 1
gripper_range: gripper_range:
- 10 - 10
@@ -9,31 +9,31 @@ motors:
joint_1: joint_1:
id: 1 id: 1
model: realman model: realman
norm_mode: DEGREES norm_mode: degrees
joint_2: joint_2:
id: 2 id: 2
model: realman model: realman
norm_mode: DEGREES norm_mode: degrees
joint_3: joint_3:
id: 3 id: 3
model: realman model: realman
norm_mode: DEGREES norm_mode: degrees
joint_4: joint_4:
id: 4 id: 4
model: realman model: realman
norm_mode: DEGREES norm_mode: degrees
joint_5: joint_5:
id: 5 id: 5
model: realman model: realman
norm_mode: DEGREES norm_mode: degrees
joint_6: joint_6:
id: 6 id: 6
model: realman model: realman
norm_mode: DEGREES norm_mode: degrees
gripper: gripper:
id: 7 id: 7
model: realman model: realman
norm_mode: DEGREES norm_mode: degrees
# cameras: # cameras:
# left: # left:
# serial_number_or_name: 153122077516 # serial_number_or_name: 153122077516
@@ -54,10 +54,10 @@ motors:
# height: 480 # height: 480
# use_depth: False # use_depth: False
joint: joint:
- -90 - 15
- 90 - 90
- 90 - 10
- 90 - 80
- 90 - 110
- -90 - 0
- 10 - 10

View File

@@ -79,7 +79,6 @@ from lerobot.datasets.utils import build_dataset_frame, combine_feature_dicts
from lerobot.datasets.video_utils import VideoEncodingManager from lerobot.datasets.video_utils import VideoEncodingManager
from lerobot.policies.factory import make_policy, make_pre_post_processors from lerobot.policies.factory import make_policy, make_pre_post_processors
from lerobot.policies.pretrained import PreTrainedPolicy from lerobot.policies.pretrained import PreTrainedPolicy
from lerobot.policies.utils import make_robot_action
from lerobot.processor import ( from lerobot.processor import (
PolicyAction, PolicyAction,
PolicyProcessorPipeline, PolicyProcessorPipeline,

View File

@@ -75,7 +75,7 @@ class RealmanMotorsBus(MotorsBus):
if mock: if mock:
self.rmarm = RoboticArmMock() self.rmarm = RoboticArmMock()
else: 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(':') address = port.split(':')
self.ip = address[0] self.ip = address[0]
self.port = int(address[1]) self.port = int(address[1])
@@ -103,6 +103,9 @@ class RealmanMotorsBus(MotorsBus):
''' '''
使能机械臂并检测使能状态,尝试5s,如果使能超时则退出程序 使能机械臂并检测使能状态,尝试5s,如果使能超时则退出程序
''' '''
self.handle = self.rmarm.rm_create_robot_arm(self.ip, self.port)
self.rmarm.rm_set_arm_run_mode(0)
enable_flag = False enable_flag = False
loop_flag = False loop_flag = False
# 设置超时时间(秒) # 设置超时时间(秒)
@@ -140,7 +143,6 @@ class RealmanMotorsBus(MotorsBus):
break break
time.sleep(1) 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) self.rmarm.rm_movej(self.init_joint_position[:-1], 5, 0, 0, 1)
time.sleep(3) time.sleep(3)
ret = self.rmarm.rm_get_current_arm_state() ret = self.rmarm.rm_get_current_arm_state()

View File

@@ -68,7 +68,7 @@ class RealmanRobot(Robot):
"Mismatch between calibration values in the motor and the calibration file or no calibration file found" "Mismatch between calibration values in the motor and the calibration file or no calibration file found"
) )
self.calibrate() self.calibrate()
self.configure() # self.configure()
logger.info(f"{self} connected.") logger.info(f"{self} connected.")
@property @property

10
test.py Normal file
View File

@@ -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)