diff --git a/lerobot/common/robot_devices/motors/dynamixel.py b/lerobot/common/robot_devices/motors/dynamixel.py index 3cf55684..fb00f18b 100644 --- a/lerobot/common/robot_devices/motors/dynamixel.py +++ b/lerobot/common/robot_devices/motors/dynamixel.py @@ -224,7 +224,7 @@ def assert_same_address(model_ctrl_table, motor_models, data_name): def find_available_ports(): ports = [] - for path in Path("/dev").glob("tty*"): + for path in Path("/dev").glob("*"): ports.append(str(path)) return ports @@ -286,7 +286,6 @@ class DynamixelMotorsBus: >>> The port of this DynamixelMotorsBus is /dev/tty.usbmodem575E0031751. >>> Reconnect the usb cable. ``` - To find the motor indices, use [DynamixelWizzard2](https://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_wizard2). Example of usage for 1 motor connected to the bus: ```python @@ -300,7 +299,9 @@ class DynamixelMotorsBus: ) motors_bus.connect() - motors_bus.teleop_step() + degrees = motors_bus.read("Present_Position") + + motors_bus.write("Goal_Position", degrees + 30) # when done, consider disconnecting motors_bus.disconnect() @@ -357,7 +358,7 @@ class DynamixelMotorsBus: self.port_handler.setPacketTimeoutMillis(TIMEOUT_MS) - # Set expected baud rate for the bus + # Set expected baudrate for the bus self.set_bus_baudrate(BAUDRATE) if not self.are_motors_configured(): diff --git a/lerobot/common/robot_devices/robots/koch.py b/lerobot/common/robot_devices/robots/koch.py index 94f77682..0b508bb6 100644 --- a/lerobot/common/robot_devices/robots/koch.py +++ b/lerobot/common/robot_devices/robots/koch.py @@ -371,7 +371,7 @@ class KochRobot: "during manipulation or transportation of your robot. " f"The values and motors: {values} {self.leader_arms[name].motor_names}.\n" "Rotate the arm to fit the range ]-180, 180[ and relaunch the script, or recalibrate all motors by setting a different " - "`calibration_path` during the instatiation of your robot." + "calibration path during the instatiation of your robot (e.g. `--robot-overrides calibration_path=.cache/calibration/koch_v2.pkl`)" ) # Set better PID values to close the gap between recored states and actions diff --git a/lerobot/configs/robot/koch.yaml b/lerobot/configs/robot/koch.yaml index 74853b33..224040ab 100644 --- a/lerobot/configs/robot/koch.yaml +++ b/lerobot/configs/robot/koch.yaml @@ -1,4 +1,5 @@ _target_: lerobot.common.robot_devices.robots.koch.KochRobot +calibration_path: .cache/calibration/koch.pkl leader_arms: main: _target_: lerobot.common.robot_devices.motors.dynamixel.DynamixelMotorsBus