Update feetech read_calibration
This commit is contained in:
@@ -250,20 +250,14 @@ class FeetechMotorsBus(MotorsBus):
|
|||||||
return same_ranges and same_offsets
|
return same_ranges and same_offsets
|
||||||
|
|
||||||
def read_calibration(self) -> dict[str, MotorCalibration]:
|
def read_calibration(self) -> dict[str, MotorCalibration]:
|
||||||
if self.protocol_version == 0:
|
offsets, mins, maxes = {}, {}, {}
|
||||||
offsets = self.sync_read("Homing_Offset", normalize=False)
|
drive_modes = dict.fromkeys(self.motors, 0)
|
||||||
mins = self.sync_read("Min_Position_Limit", normalize=False)
|
for motor in self.motors:
|
||||||
maxes = self.sync_read("Max_Position_Limit", normalize=False)
|
mins[motor] = self.read("Min_Position_Limit", motor, normalize=False)
|
||||||
drive_modes = dict.fromkeys(self.motors, 0)
|
maxes[motor] = self.read("Max_Position_Limit", motor, normalize=False)
|
||||||
else:
|
offsets[motor] = (
|
||||||
offsets, mins, maxes, drive_modes = {}, {}, {}, {}
|
self.read("Homing_Offset", motor, normalize=False) if self.protocol_version == 0 else 0
|
||||||
for motor in self.motors:
|
)
|
||||||
offsets[motor] = 0
|
|
||||||
mins[motor] = self.read("Min_Position_Limit", motor, normalize=False)
|
|
||||||
maxes[motor] = self.read("Max_Position_Limit", motor, normalize=False)
|
|
||||||
drive_modes[motor] = 0
|
|
||||||
|
|
||||||
# TODO(aliberts): add set/get_drive_mode?
|
|
||||||
|
|
||||||
calibration = {}
|
calibration = {}
|
||||||
for motor, m in self.motors.items():
|
for motor, m in self.motors.items():
|
||||||
|
|||||||
Reference in New Issue
Block a user