This commit is contained in:
Remi Cadene 2024-07-28 01:00:58 +02:00
parent a5e2571881
commit 03e00a26f9
3 changed files with 7 additions and 5 deletions

View File

@ -224,7 +224,7 @@ def assert_same_address(model_ctrl_table, motor_models, data_name):
def find_available_ports(): def find_available_ports():
ports = [] ports = []
for path in Path("/dev").glob("tty*"): for path in Path("/dev").glob("*"):
ports.append(str(path)) ports.append(str(path))
return ports return ports
@ -286,7 +286,6 @@ class DynamixelMotorsBus:
>>> The port of this DynamixelMotorsBus is /dev/tty.usbmodem575E0031751. >>> The port of this DynamixelMotorsBus is /dev/tty.usbmodem575E0031751.
>>> Reconnect the usb cable. >>> 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: Example of usage for 1 motor connected to the bus:
```python ```python
@ -300,7 +299,9 @@ class DynamixelMotorsBus:
) )
motors_bus.connect() motors_bus.connect()
motors_bus.teleop_step() degrees = motors_bus.read("Present_Position")
motors_bus.write("Goal_Position", degrees + 30)
# when done, consider disconnecting # when done, consider disconnecting
motors_bus.disconnect() motors_bus.disconnect()
@ -357,7 +358,7 @@ class DynamixelMotorsBus:
self.port_handler.setPacketTimeoutMillis(TIMEOUT_MS) self.port_handler.setPacketTimeoutMillis(TIMEOUT_MS)
# Set expected baud rate for the bus # Set expected baudrate for the bus
self.set_bus_baudrate(BAUDRATE) self.set_bus_baudrate(BAUDRATE)
if not self.are_motors_configured(): if not self.are_motors_configured():

View File

@ -371,7 +371,7 @@ class KochRobot:
"during manipulation or transportation of your robot. " "during manipulation or transportation of your robot. "
f"The values and motors: {values} {self.leader_arms[name].motor_names}.\n" 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 " "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 # Set better PID values to close the gap between recored states and actions

View File

@ -1,4 +1,5 @@
_target_: lerobot.common.robot_devices.robots.koch.KochRobot _target_: lerobot.common.robot_devices.robots.koch.KochRobot
calibration_path: .cache/calibration/koch.pkl
leader_arms: leader_arms:
main: main:
_target_: lerobot.common.robot_devices.motors.dynamixel.DynamixelMotorsBus _target_: lerobot.common.robot_devices.motors.dynamixel.DynamixelMotorsBus