diff --git a/src/lerobot/robots/bi_so100_follower/config_bi_so100_follower.py b/src/lerobot/robots/bi_so100_follower/config_bi_so100_follower.py index 00643b85f..5806d7415 100644 --- a/src/lerobot/robots/bi_so100_follower/config_bi_so100_follower.py +++ b/src/lerobot/robots/bi_so100_follower/config_bi_so100_follower.py @@ -29,10 +29,10 @@ class BiSO100FollowerConfig(RobotConfig): # Optional left_arm_disable_torque_on_disconnect: bool = True - left_arm_max_relative_target: int | None = None + left_arm_max_relative_target: float | dict[str, float] | None = None left_arm_use_degrees: bool = False right_arm_disable_torque_on_disconnect: bool = True - right_arm_max_relative_target: int | None = None + right_arm_max_relative_target: float | dict[str, float] | None = None right_arm_use_degrees: bool = False # cameras (shared between both arms) diff --git a/src/lerobot/robots/hope_jr/config_hope_jr.py b/src/lerobot/robots/hope_jr/config_hope_jr.py index 747e98e01..f2af5f47c 100644 --- a/src/lerobot/robots/hope_jr/config_hope_jr.py +++ b/src/lerobot/robots/hope_jr/config_hope_jr.py @@ -44,8 +44,8 @@ class HopeJrArmConfig(RobotConfig): disable_torque_on_disconnect: bool = True # `max_relative_target` limits the magnitude of the relative positional target vector for safety purposes. - # Set this to a positive scalar to have the same value for all motors, or a list that is the same length as - # the number of motors in your follower arms. - max_relative_target: int | None = None + # Set this to a positive scalar to have the same value for all motors, or a dictionary that maps motor + # names to the max_relative_target value for that motor. + max_relative_target: float | dict[str, float] | None = None cameras: dict[str, CameraConfig] = field(default_factory=dict) diff --git a/src/lerobot/robots/koch_follower/config_koch_follower.py b/src/lerobot/robots/koch_follower/config_koch_follower.py index a7c9249ae..02a95ef4e 100644 --- a/src/lerobot/robots/koch_follower/config_koch_follower.py +++ b/src/lerobot/robots/koch_follower/config_koch_follower.py @@ -28,9 +28,9 @@ class KochFollowerConfig(RobotConfig): disable_torque_on_disconnect: bool = True # `max_relative_target` limits the magnitude of the relative positional target vector for safety purposes. - # Set this to a positive scalar to have the same value for all motors, or a list that is the same length as - # the number of motors in your follower arms. - max_relative_target: int | None = None + # Set this to a positive scalar to have the same value for all motors, or a dictionary that maps motor + # names to the max_relative_target value for that motor. + max_relative_target: float | dict[str, float] | None = None # cameras cameras: dict[str, CameraConfig] = field(default_factory=dict) diff --git a/src/lerobot/robots/lekiwi/config_lekiwi.py b/src/lerobot/robots/lekiwi/config_lekiwi.py index f0f8c24b3..acaf5f0ec 100644 --- a/src/lerobot/robots/lekiwi/config_lekiwi.py +++ b/src/lerobot/robots/lekiwi/config_lekiwi.py @@ -39,9 +39,9 @@ class LeKiwiConfig(RobotConfig): disable_torque_on_disconnect: bool = True # `max_relative_target` limits the magnitude of the relative positional target vector for safety purposes. - # Set this to a positive scalar to have the same value for all motors, or a list that is the same length as - # the number of motors in your follower arms. - max_relative_target: int | None = None + # Set this to a positive scalar to have the same value for all motors, or a dictionary that maps motor + # names to the max_relative_target value for that motor. + max_relative_target: float | dict[str, float] | None = None cameras: dict[str, CameraConfig] = field(default_factory=lekiwi_cameras_config) diff --git a/src/lerobot/robots/so100_follower/config_so100_follower.py b/src/lerobot/robots/so100_follower/config_so100_follower.py index ea8b9f1c2..561790e77 100644 --- a/src/lerobot/robots/so100_follower/config_so100_follower.py +++ b/src/lerobot/robots/so100_follower/config_so100_follower.py @@ -30,9 +30,9 @@ class SO100FollowerConfig(RobotConfig): disable_torque_on_disconnect: bool = True # `max_relative_target` limits the magnitude of the relative positional target vector for safety purposes. - # Set this to a positive scalar to have the same value for all motors, or a list that is the same length as - # the number of motors in your follower arms. - max_relative_target: int | None = None + # Set this to a positive scalar to have the same value for all motors, or a dictionary that maps motor + # names to the max_relative_target value for that motor. + max_relative_target: float | dict[str, float] | None = None # cameras cameras: dict[str, CameraConfig] = field(default_factory=dict) diff --git a/src/lerobot/robots/so101_follower/config_so101_follower.py b/src/lerobot/robots/so101_follower/config_so101_follower.py index be630e6ac..03c3530c2 100644 --- a/src/lerobot/robots/so101_follower/config_so101_follower.py +++ b/src/lerobot/robots/so101_follower/config_so101_follower.py @@ -30,9 +30,9 @@ class SO101FollowerConfig(RobotConfig): disable_torque_on_disconnect: bool = True # `max_relative_target` limits the magnitude of the relative positional target vector for safety purposes. - # Set this to a positive scalar to have the same value for all motors, or a list that is the same length as - # the number of motors in your follower arms. - max_relative_target: int | None = None + # Set this to a positive scalar to have the same value for all motors, or a dictionary that maps motor + # names to the max_relative_target value for that motor. + max_relative_target: float | dict[str, float] | None = None # cameras cameras: dict[str, CameraConfig] = field(default_factory=dict) diff --git a/src/lerobot/robots/stretch3/configuration_stretch3.py b/src/lerobot/robots/stretch3/configuration_stretch3.py index 9fcf8f742..d4e217ca0 100644 --- a/src/lerobot/robots/stretch3/configuration_stretch3.py +++ b/src/lerobot/robots/stretch3/configuration_stretch3.py @@ -24,11 +24,6 @@ from ..config import RobotConfig @RobotConfig.register_subclass("stretch3") @dataclass class Stretch3RobotConfig(RobotConfig): - # `max_relative_target` limits the magnitude of the relative positional target vector for safety purposes. - # Set this to a positive scalar to have the same value for all motors, or a list that is the same length as - # the number of motors in your follower arms. - max_relative_target: int | None = None - # cameras cameras: dict[str, CameraConfig] = field( default_factory=lambda: { diff --git a/src/lerobot/robots/utils.py b/src/lerobot/robots/utils.py index 7486ee499..befd96424 100644 --- a/src/lerobot/robots/utils.py +++ b/src/lerobot/robots/utils.py @@ -70,7 +70,7 @@ def make_robot_from_config(config: RobotConfig) -> Robot: def ensure_safe_goal_position( - goal_present_pos: dict[str, tuple[float, float]], max_relative_target: float | dict[float] + goal_present_pos: dict[str, tuple[float, float]], max_relative_target: float | dict[str, float] ) -> dict[str, float]: """Caps relative action target magnitude for safety.""" diff --git a/src/lerobot/robots/viperx/config_viperx.py b/src/lerobot/robots/viperx/config_viperx.py index 4922f1d18..ed3876a9c 100644 --- a/src/lerobot/robots/viperx/config_viperx.py +++ b/src/lerobot/robots/viperx/config_viperx.py @@ -28,15 +28,15 @@ class ViperXConfig(RobotConfig): # /!\ FOR SAFETY, READ THIS /!\ # `max_relative_target` limits the magnitude of the relative positional target vector for safety purposes. - # Set this to a positive scalar to have the same value for all motors, or a list that is the same length as - # the number of motors in your follower arms. + # Set this to a positive scalar to have the same value for all motors, or a dictionary that maps motor + # names to the max_relative_target value for that motor. # For Aloha, for every goal position request, motor rotations are capped at 5 degrees by default. # When you feel more confident with teleoperation or running the policy, you can extend # this safety limit and even removing it by setting it to `null`. # Also, everything is expected to work safely out-of-the-box, but we highly advise to # first try to teleoperate the grippers only (by commenting out the rest of the motors in this yaml), # then to gradually add more motors (by uncommenting), until you can teleoperate both arms fully - max_relative_target: int | None = 5 + max_relative_target: float | dict[str, float] = 5.0 # cameras cameras: dict[str, CameraConfig] = field(default_factory=dict)