remove comment read/write single value

This commit is contained in:
Remi Cadene
2024-07-10 14:13:22 +02:00
parent dd7bce7563
commit fb06417a83

View File

@@ -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)}"
# )