forked from tangger/lerobot
Simplify feetech read_calibration
This commit is contained in:
@@ -251,7 +251,6 @@ class FeetechMotorsBus(MotorsBus):
|
|||||||
|
|
||||||
def read_calibration(self) -> dict[str, MotorCalibration]:
|
def read_calibration(self) -> dict[str, MotorCalibration]:
|
||||||
offsets, mins, maxes = {}, {}, {}
|
offsets, mins, maxes = {}, {}, {}
|
||||||
drive_modes = dict.fromkeys(self.motors, 0)
|
|
||||||
for motor in self.motors:
|
for motor in self.motors:
|
||||||
mins[motor] = self.read("Min_Position_Limit", motor, normalize=False)
|
mins[motor] = self.read("Min_Position_Limit", motor, normalize=False)
|
||||||
maxes[motor] = self.read("Max_Position_Limit", motor, normalize=False)
|
maxes[motor] = self.read("Max_Position_Limit", motor, normalize=False)
|
||||||
@@ -263,7 +262,7 @@ class FeetechMotorsBus(MotorsBus):
|
|||||||
for motor, m in self.motors.items():
|
for motor, m in self.motors.items():
|
||||||
calibration[motor] = MotorCalibration(
|
calibration[motor] = MotorCalibration(
|
||||||
id=m.id,
|
id=m.id,
|
||||||
drive_mode=drive_modes[motor],
|
drive_mode=0,
|
||||||
homing_offset=offsets[motor],
|
homing_offset=offsets[motor],
|
||||||
range_min=mins[motor],
|
range_min=mins[motor],
|
||||||
range_max=maxes[motor],
|
range_max=maxes[motor],
|
||||||
|
|||||||
Reference in New Issue
Block a user