mirror of
https://github.com/huggingface/lerobot.git
synced 2026-07-23 09:46:00 +00:00
chore(dynamixel): protocol polish (int default, logging, AX note)
Make the PROTOCOL_VERSION default an int, replace the stray print with a debug log, and document why AX-series is absent from MODEL_OPERATING_MODES.
This commit is contained in:
@@ -47,7 +47,7 @@ if TYPE_CHECKING or _dynamixel_sdk_available:
|
||||
else:
|
||||
dxl = None
|
||||
|
||||
PROTOCOL_VERSION = 2.0
|
||||
PROTOCOL_VERSION = 2
|
||||
DEFAULT_BAUDRATE = 1_000_000
|
||||
DEFAULT_TIMEOUT_MS = 1000
|
||||
|
||||
@@ -127,7 +127,7 @@ class DynamixelMotorsBus(SerialMotorsBus):
|
||||
self._assert_same_protocol()
|
||||
self.port_handler = dxl.PortHandler(self.port)
|
||||
self.packet_handler = dxl.PacketHandler(protocol_version)
|
||||
print(f"Using protocol version {protocol_version}")
|
||||
logger.debug(f"Using protocol version {protocol_version}")
|
||||
self.sync_reader = dxl.GroupSyncRead(self.port_handler, self.packet_handler, 0, 0)
|
||||
self.sync_writer = dxl.GroupSyncWrite(self.port_handler, self.packet_handler, 0, 0)
|
||||
self._comm_success = dxl.COMM_SUCCESS
|
||||
|
||||
@@ -215,6 +215,8 @@ MODEL_NUMBER_TABLE = {
|
||||
|
||||
# {model: available_operating_modes}
|
||||
# https://emanual.robotis.com/docs/en/dxl/x/{MODEL}/#operating-mode11
|
||||
# Note: AX-series (Protocol 1.0) has no Operating_Mode register; joint vs wheel mode is
|
||||
# selected via the CW/CCW angle limits, so it is intentionally absent from this table.
|
||||
MODEL_OPERATING_MODES = {
|
||||
"xl330-m077": [0, 1, 3, 4, 5, 16],
|
||||
"xl330-m288": [0, 1, 3, 4, 5, 16],
|
||||
|
||||
Reference in New Issue
Block a user