This commit is contained in:
Remi Cadene
2024-07-11 20:03:56 +02:00
parent 3918e118c3
commit e615176845
3 changed files with 14 additions and 8 deletions

View File

@@ -1,5 +1,7 @@
import enum
import sys
import time
import traceback
from copy import deepcopy
from pathlib import Path
@@ -278,8 +280,15 @@ class DynamixelMotorsBus:
self.port_handler = PortHandler(self.port)
self.packet_handler = PacketHandler(PROTOCOL_VERSION)
if not self.port_handler.openPort():
raise OSError(f"Failed to open port {self.port}")
try:
if not self.port_handler.openPort():
raise OSError(f"Failed to open port '{self.port}'.")
except Exception:
traceback.print_exc()
print(
"\nTry running `python lerobot/common/robot_devices/motors/dynamixel.py` to make sure you use the correct port."
)
sys.exit(1)
self.port_handler.setBaudRate(BAUD_RATE)
self.port_handler.setPacketTimeoutMillis(TIMEOUT_MS)

View File

@@ -420,6 +420,7 @@ class KochRobot:
if not record_data:
return
# TODO(rcadene): Add velocity and other info
# Read follower position
follower_pos = {}
for name in self.follower_arms: