diff --git a/lerobot/common/robot_devices/motors/dynamixel.py b/lerobot/common/robot_devices/motors/dynamixel.py index 6234e59de..0eb93b79c 100644 --- a/lerobot/common/robot_devices/motors/dynamixel.py +++ b/lerobot/common/robot_devices/motors/dynamixel.py @@ -450,64 +450,3 @@ class DynamixelMotorsBus: def __del__(self): if getattr(self, "is_connected", False): self.disconnect() - - # def read(self, data_name, motor_name: str): - # motor_idx, model = self.motors[motor_name] - # addr, bytes = self.model_ctrl_table[model][data_name] - - # args = (self.port_handler, motor_idx, addr) - # if bytes == 1: - # value, comm, err = self.packet_handler.read1ByteTxRx(*args) - # elif bytes == 2: - # value, comm, err = self.packet_handler.read2ByteTxRx(*args) - # elif bytes == 4: - # value, comm, err = self.packet_handler.read4ByteTxRx(*args) - # else: - # raise NotImplementedError( - # f"Value of the number of bytes to be sent is expected to be in [1, 2, 4], but " - # f"{bytes} is provided instead.") - - # if comm != COMM_SUCCESS: - # raise ConnectionError( - # f"Read failed due to communication error on port {self.port} for motor {motor_idx}: " - # f"{self.packet_handler.getTxRxResult(comm)}" - # ) - # elif err != 0: - # raise ConnectionError( - # f"Read failed due to error {err} on port {self.port} for motor {motor_idx}: " - # f"{self.packet_handler.getTxRxResult(err)}" - # ) - - # if data_name in CALIBRATION_REQUIRED: - # value = self.apply_calibration([value], [motor_name])[0] - - # return value - - # def write(self, data_name, value, motor_name: str): - # if data_name in CALIBRATION_REQUIRED: - # value = self.revert_calibration([value], [motor_name])[0] - - # motor_idx, model = self.motors[motor_name] - # addr, bytes = self.model_ctrl_table[model][data_name] - # args = (self.port_handler, motor_idx, addr, value) - # if bytes == 1: - # comm, err = self.packet_handler.write1ByteTxRx(*args) - # elif bytes == 2: - # comm, err = self.packet_handler.write2ByteTxRx(*args) - # elif bytes == 4: - # comm, err = self.packet_handler.write4ByteTxRx(*args) - # else: - # raise NotImplementedError( - # f"Value of the number of bytes to be sent is expected to be in [1, 2, 4], but {bytes} " - # f"is provided instead.") - - # if comm != COMM_SUCCESS: - # raise ConnectionError( - # f"Write failed due to communication error on port {self.port} for motor {motor_idx}: " - # f"{self.packet_handler.getTxRxResult(comm)}" - # ) - # elif err != 0: - # raise ConnectionError( - # f"Write failed due to error {err} on port {self.port} for motor {motor_idx}: " - # f"{self.packet_handler.getTxRxResult(err)}" - # )