mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-21 11:39:50 +00:00
Use disable_torque_on_disconnect
This commit is contained in:
@@ -33,7 +33,7 @@ class Reachy2RobotConfig(RobotConfig):
|
|||||||
ip_address: str | None = "localhost"
|
ip_address: str | None = "localhost"
|
||||||
|
|
||||||
# If True, turn_off_smoothly() will be sent to the robot before disconnecting.
|
# If True, turn_off_smoothly() will be sent to the robot before disconnecting.
|
||||||
disable_torque_on_disconnect: bool = True
|
disable_torque_on_disconnect: bool = False
|
||||||
|
|
||||||
# Tag for external commands control
|
# Tag for external commands control
|
||||||
# Set to True if you use an external commands system to control the robot,
|
# Set to True if you use an external commands system to control the robot,
|
||||||
|
|||||||
@@ -211,5 +211,6 @@ class Reachy2Robot(Robot):
|
|||||||
if self.reachy is not None:
|
if self.reachy is not None:
|
||||||
for cam in self.cameras.values():
|
for cam in self.cameras.values():
|
||||||
cam.disconnect()
|
cam.disconnect()
|
||||||
|
if self.config.disable_torque_on_disconnect:
|
||||||
self.reachy.turn_off_smoothly()
|
self.reachy.turn_off_smoothly()
|
||||||
self.reachy.disconnect()
|
self.reachy.disconnect()
|
||||||
|
|||||||
@@ -60,11 +60,12 @@ PARAMS = [
|
|||||||
{"with_mobile_base": False},
|
{"with_mobile_base": False},
|
||||||
{"with_mobile_base": False, "with_l_arm": False, "with_antennas": False},
|
{"with_mobile_base": False, "with_l_arm": False, "with_antennas": False},
|
||||||
{"with_r_arm": False, "with_neck": False, "with_antennas": False},
|
{"with_r_arm": False, "with_neck": False, "with_antennas": False},
|
||||||
{"use_external_commands": True},
|
{"use_external_commands": True, "disable_torque_on_disconnect": True},
|
||||||
{"use_external_commands": True, "with_mobile_base": False, "with_neck": False},
|
{"use_external_commands": True, "with_mobile_base": False, "with_neck": False},
|
||||||
{"with_right_teleop_camera": False},
|
{"with_right_teleop_camera": False},
|
||||||
{"with_left_teleop_camera": False, "with_right_teleop_camera": False},
|
{"with_left_teleop_camera": False, "with_right_teleop_camera": False},
|
||||||
{"with_left_teleop_camera": False, "with_torso_camera": True},
|
{"with_left_teleop_camera": False, "with_torso_camera": True},
|
||||||
|
{"disable_torque_on_disconnect": False},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@@ -191,7 +192,10 @@ def test_connect_disconnect(reachy2):
|
|||||||
reachy2.disconnect()
|
reachy2.disconnect()
|
||||||
assert not reachy2.is_connected
|
assert not reachy2.is_connected
|
||||||
|
|
||||||
|
if reachy2.config.disable_torque_on_disconnect:
|
||||||
reachy2.reachy.turn_off_smoothly.assert_called_once()
|
reachy2.reachy.turn_off_smoothly.assert_called_once()
|
||||||
|
else:
|
||||||
|
reachy2.reachy.turn_off_smoothly.assert_not_called()
|
||||||
reachy2.reachy.disconnect.assert_called_once()
|
reachy2.reachy.disconnect.assert_called_once()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user