Skip to content

Commit 0c28606

Browse files
Cadenevmayoral
authored andcommitted
Fix autocalib moss (huggingface#486)
1 parent d4d72e3 commit 0c28606

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lerobot/common/robot_devices/robots/feetech_calibration.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def move_until_block(arm, motor_name, positive_direction=True, while_move_hook=N
6464
# print(f"{present_voltage=}")
6565
# print(f"{present_temperature=}")
6666

67-
if present_speed == 0 and present_current > 50:
67+
if present_speed == 0 and present_current > 40:
6868
count += 1
6969
if count > 100 or present_current > 300:
7070
return present_pos
@@ -306,16 +306,16 @@ def run_arm_auto_calibration_moss(arm: MotorsBus, robot_type: str, arm_name: str
306306
calib = {}
307307

308308
print("Calibrate shoulder_pan")
309-
calib["shoulder_pan"] = move_to_calibrate(arm, "shoulder_pan", load_threshold=350, count_threshold=200)
309+
calib["shoulder_pan"] = move_to_calibrate(arm, "shoulder_pan")
310310
arm.write("Goal_Position", calib["shoulder_pan"]["zero_pos"], "shoulder_pan")
311311
time.sleep(1)
312312

313313
print("Calibrate gripper")
314-
calib["gripper"] = move_to_calibrate(arm, "gripper", invert_drive_mode=True, count_threshold=200)
314+
calib["gripper"] = move_to_calibrate(arm, "gripper", invert_drive_mode=True)
315315
time.sleep(1)
316316

317317
print("Calibrate wrist_flex")
318-
calib["wrist_flex"] = move_to_calibrate(arm, "wrist_flex", invert_drive_mode=True, count_threshold=200)
318+
calib["wrist_flex"] = move_to_calibrate(arm, "wrist_flex", invert_drive_mode=True)
319319
calib["wrist_flex"] = apply_offset(calib["wrist_flex"], offset=-210 + 1024)
320320

321321
wr_pos = arm.read("Present_Position", "wrist_roll")
@@ -329,7 +329,7 @@ def run_arm_auto_calibration_moss(arm: MotorsBus, robot_type: str, arm_name: str
329329
time.sleep(1)
330330

331331
print("Calibrate wrist_roll")
332-
calib["wrist_roll"] = move_to_calibrate(arm, "wrist_roll", invert_drive_mode=True, count_threshold=200)
332+
calib["wrist_roll"] = move_to_calibrate(arm, "wrist_roll", invert_drive_mode=True)
333333
calib["wrist_roll"] = apply_offset(calib["wrist_roll"], offset=790)
334334

335335
arm.write("Goal_Position", calib["wrist_roll"]["zero_pos"] - 1024, "wrist_roll")
@@ -348,7 +348,6 @@ def in_between_move_elbow_flex_hook():
348348
arm,
349349
"elbow_flex",
350350
invert_drive_mode=True,
351-
count_threshold=200,
352351
in_between_move_hook=in_between_move_elbow_flex_hook,
353352
)
354353
arm.write("Goal_Position", calib["wrist_flex"]["zero_pos"] - 1024, "wrist_flex")

0 commit comments

Comments
 (0)