mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-25 13:40:00 +00:00
fix(feetech): motor position readings overflow (#3373)
This commit is contained in:
@@ -216,6 +216,14 @@ class FeetechMotorsBus(SerialMotorsBus):
|
||||
self.write("Maximum_Acceleration", motor, maximum_acceleration)
|
||||
self.write("Acceleration", motor, acceleration)
|
||||
|
||||
# Clear bit 4 (0x10) of the Phase register (0x12) to set angle feedback mode to 0.
|
||||
# This forces position readings to be in the range [0, resolution - 1] and prevents overflow or negative values.
|
||||
# Only known to be necessary for the STS3215.
|
||||
if self.motors[motor].model == "sts3215":
|
||||
phase = self.read("Phase", motor, normalize=False)
|
||||
if phase & 0x10:
|
||||
self.write("Phase", motor, phase & ~0x10)
|
||||
|
||||
@property
|
||||
def is_calibrated(self) -> bool:
|
||||
motors_calibration = self.read_calibration()
|
||||
|
||||
Reference in New Issue
Block a user