More hacks

This commit is contained in:
Simon Alibert
2025-05-27 16:53:35 +02:00
parent 6b4d465595
commit fbd636d6b0
2 changed files with 12 additions and 6 deletions

View File

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

View File

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