From fbd636d6b0211188936a269d9719dad31c34776d Mon Sep 17 00:00:00 2001 From: Simon Alibert Date: Tue, 27 May 2025 16:53:35 +0200 Subject: [PATCH] More hacks --- lerobot/common/robots/hope_jr/hope_jr_arm.py | 11 +++++++---- lerobot/common/robots/hope_jr/hope_jr_hand.py | 7 +++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lerobot/common/robots/hope_jr/hope_jr_arm.py b/lerobot/common/robots/hope_jr/hope_jr_arm.py index 506c621c..66e7f282 100644 --- a/lerobot/common/robots/hope_jr/hope_jr_arm.py +++ b/lerobot/common/robots/hope_jr/hope_jr_arm.py @@ -124,17 +124,20 @@ class HopeJrArm(Robot): unknown_range_motors = self.other_motors input("Move arm to the middle of its range of motion and press ENTER....") - homing_offsets_full_turn = self.bus.set_half_turn_homings(self.shoulder_pitch) + homing_offsets_full_turn = self.bus.set_half_turn_homings("shoulder_pitch") homing_offsets_unknown_range = self.bus.set_half_turn_homings(unknown_range_motors) homing_offsets = {**homing_offsets_full_turn, **homing_offsets_unknown_range} logger.info( - f"Move all joints except '{self.shoulder_pitch}' sequentially through their " + "Move all joints except 'shoulder_pitch' sequentially through their " "entire ranges of motion.\nRecording positions. Press ENTER to stop..." ) range_mins, range_maxes = self.bus.record_ranges_of_motion(unknown_range_motors) - range_mins[self.shoulder_pitch] = 1024 - range_maxes[self.shoulder_pitch] = 3071 + range_mins["shoulder_pitch"] = 1024 + range_maxes["shoulder_pitch"] = 3071 + + range_mins["wrist_roll"] = 1500 + range_maxes["wrist_roll"] = 2500 self.calibration = {} for motor, m in self.bus.motors.items(): diff --git a/lerobot/common/robots/hope_jr/hope_jr_hand.py b/lerobot/common/robots/hope_jr/hope_jr_hand.py index f32a5b8a..534c3caf 100644 --- a/lerobot/common/robots/hope_jr/hope_jr_hand.py +++ b/lerobot/common/robots/hope_jr/hope_jr_hand.py @@ -54,7 +54,7 @@ LEFT_HAND_INVERSIONS = [ "ring_radial_flexor", "ring_pip_dip", "pinky_radial_flexor", - "pinky_pip_dip", + # "pinky_pip_dip", ] @@ -152,7 +152,10 @@ class HopeJrHand(Robot): def configure(self) -> None: with self.bus.torque_disabled(): self.bus.configure_motors() - # TODO + # for motor in self.bus.motors: + # self.bus.write("Return_Delay_Time", motor, 0) + # self.bus.write("Acceleration_2", motor, 50) + # self.bus.write("Acceleration", motor, 50) def setup_motors(self) -> None: for motor in self.bus.motors: