mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-27 06:29:47 +00:00
uncomment handshake (issue on this model)
This commit is contained in:
@@ -444,8 +444,8 @@ class MotorsBus(abc.ABC):
|
|||||||
try:
|
try:
|
||||||
if not self.port_handler.openPort():
|
if not self.port_handler.openPort():
|
||||||
raise OSError(f"Failed to open port '{self.port}'.")
|
raise OSError(f"Failed to open port '{self.port}'.")
|
||||||
elif handshake:
|
# elif handshake:
|
||||||
self._handshake()
|
# self._handshake()
|
||||||
except (FileNotFoundError, OSError, serial.SerialException) as e:
|
except (FileNotFoundError, OSError, serial.SerialException) as e:
|
||||||
raise ConnectionError(
|
raise ConnectionError(
|
||||||
f"\nCould not connect on port '{self.port}'. Make sure you are using the correct port."
|
f"\nCould not connect on port '{self.port}'. Make sure you are using the correct port."
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class SO101FollowerT(Robot):
|
|||||||
|
|
||||||
_CURRENT_STEP_A: float = 6.5e-3 # 6.5 mA per register LSB #http://doc.feetech.cn/#/prodinfodownload?srcType=FT-SMS-STS-emanual-229f4476422d4059abfb1cb0
|
_CURRENT_STEP_A: float = 6.5e-3 # 6.5 mA per register LSB #http://doc.feetech.cn/#/prodinfodownload?srcType=FT-SMS-STS-emanual-229f4476422d4059abfb1cb0
|
||||||
_KT_NM_PER_AMP: float = 0.814 # Torque constant Kt [N·m/A] #https://www.feetechrc.com/811177.html
|
_KT_NM_PER_AMP: float = 0.814 # Torque constant Kt [N·m/A] #https://www.feetechrc.com/811177.html
|
||||||
_MAX_CURRENT_A: float = 3.0 # Safe driver limit for this model
|
_MAX_CURRENT_A: float = 4.0 # Safe driver limit for this model
|
||||||
|
|
||||||
# Control gains for bilateral teleoperation
|
# Control gains for bilateral teleoperation
|
||||||
_KP_GAINS = { # Position gains [Nm/rad] - reduced for bilateral stability
|
_KP_GAINS = { # Position gains [Nm/rad] - reduced for bilateral stability
|
||||||
@@ -344,6 +344,7 @@ class SO101FollowerT(Robot):
|
|||||||
self.bus.write("Operating_Mode", motor, 2, num_retry=2) # Set to current mode
|
self.bus.write("Operating_Mode", motor, 2, num_retry=2) # Set to current mode
|
||||||
self.bus.write("Torque_Limit", motor, 1000, num_retry=2) # 100%
|
self.bus.write("Torque_Limit", motor, 1000, num_retry=2) # 100%
|
||||||
self.bus.write("Max_Torque_Limit", motor, 1000, num_retry=2) # 100%
|
self.bus.write("Max_Torque_Limit", motor, 1000, num_retry=2) # 100%
|
||||||
|
self.bus.write("Overcurrent_Protection_Time", motor, 250, num_retry=2)
|
||||||
|
|
||||||
def setup_motors(self) -> None:
|
def setup_motors(self) -> None:
|
||||||
for motor in reversed(self.bus.motors):
|
for motor in reversed(self.bus.motors):
|
||||||
@@ -422,10 +423,6 @@ class SO101FollowerT(Robot):
|
|||||||
max_cnt = int(round(self._MAX_CURRENT_A / self._CURRENT_STEP_A))
|
max_cnt = int(round(self._MAX_CURRENT_A / self._CURRENT_STEP_A))
|
||||||
counts = {}
|
counts = {}
|
||||||
for joint, τ in tau_cmd_nm.items():
|
for joint, τ in tau_cmd_nm.items():
|
||||||
# Set wrist_flex commands to 0
|
|
||||||
if joint == "wrist_flex":
|
|
||||||
counts[joint] = 0
|
|
||||||
continue
|
|
||||||
cnt = τ * self.torque_sign[joint] * inv_coef # flip SIGN
|
cnt = τ * self.torque_sign[joint] * inv_coef # flip SIGN
|
||||||
cnt = max(-max_cnt, min(max_cnt, cnt))
|
cnt = max(-max_cnt, min(max_cnt, cnt))
|
||||||
counts[joint] = int(round(cnt))
|
counts[joint] = int(round(cnt))
|
||||||
|
|||||||
Reference in New Issue
Block a user