removed fixed port values in find_joint_limits.py

This commit is contained in:
Michel Aractingi
2025-05-07 14:32:42 +02:00
parent 7ee56676b9
commit e22411ff22

View File

@@ -26,9 +26,6 @@ from lerobot.common.robot_devices.robots.utils import make_robot_from_config
from lerobot.configs import parser
from lerobot.scripts.server.kinematics import RobotKinematics
follower_port = "/dev/tty.usbmodem58760431631"
leader_port = "/dev/tty.usbmodem585A0077921"
def find_joint_bounds(
robot,
@@ -99,25 +96,6 @@ def find_ee_bounds(
break
def make_robot(robot_type="so100"):
"""
Create a robot instance using the appropriate robot config class.
Args:
robot_type: Robot type string (e.g., "so100", "koch", "aloha")
Returns:
Robot instance
"""
# Get the appropriate robot config class based on robot_type
robot_config = RobotConfig.get_choice_class(robot_type)(mock=False)
robot_config.leader_arms["main"].port = leader_port
robot_config.follower_arms["main"].port = follower_port
return make_robot_from_config(robot_config)
if __name__ == "__main__":
# Create argparse for script-specific arguments
parser = argparse.ArgumentParser(add_help=False) # Set add_help=False to avoid conflict
@@ -145,7 +123,8 @@ if __name__ == "__main__":
args = parser.parse_args()
# Create robot with the appropriate config
robot = make_robot(args.robot_type)
robot_config = RobotConfig.get_choice_class(args.robot_type)(mock=False)
robot = make_robot_from_config(robot_config)
if args.mode == "joint":
find_joint_bounds(robot, args.control_time_s)