Compare commits

...

2 Commits

Author SHA1 Message Date
0fae637b76 Merge branch 'robot_client' of https://git.matai.center/tangger/lerobot into robot_client 2025-12-09 14:33:22 +08:00
b8a76bab69 xiufu 2025-12-09 14:29:12 +08:00
5 changed files with 28 additions and 17 deletions

View File

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

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.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,

View File

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

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"
)
self.calibrate()
self.configure()
# self.configure()
logger.info(f"{self} connected.")
@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)