{"id":23081,"library":"dynamixel-sdk","title":"ROBOTIS DynamixelSDK","description":"Official SDK for controlling ROBOTIS Dynamixel servos. Supports Python, C++, C (Linux, Windows, Mac). Current version 4.0.3/4.0.4. Active development; breaking changes introduced in 4.0.0 with new 'Easy' API.","status":"active","version":"4.0.3","language":"python","source_language":"en","source_url":"https://github.com/ROBOTIS-GIT/DynamixelSDK","tags":["robotics","servo","dynamixel","robotis","motor-control","serial"],"install":[{"cmd":"pip install dynamixel-sdk","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"","symbol":"PortHandler","correct":"from dynamixel_sdk import PortHandler"},{"note":"Internal module path changed; use top-level import.","wrong":"from dynamixel_sdk.dynamixel import PacketHandler","symbol":"PacketHandler","correct":"from dynamixel_sdk import PacketHandler"},{"note":"Top-level import is the supported pattern since SDK 3.x.","wrong":"from dynamixel_sdk.group_sync_write import GroupSyncWrite","symbol":"GroupSyncWrite","correct":"from dynamixel_sdk import GroupSyncWrite"},{"note":"","symbol":"GroupBulkRead","correct":"from dynamixel_sdk import GroupBulkRead"}],"quickstart":{"code":"from dynamixel_sdk import PortHandler, PacketHandler\n\nADDR_TORQUE_ENABLE = 64\nADDR_GOAL_POSITION = 116\nADDR_PRESENT_POSITION = 132\nPROTOCOL_VERSION = 2.0\nDXL_ID = 1\nDEVICENAME = '/dev/ttyUSB0'\nBAUDRATE = 57600\n\nport_handler = PortHandler(DEVICENAME)\npacket_handler = PacketHandler(PROTOCOL_VERSION)\n\nif port_handler.openPort():\n    print('Succeeded to open port')\nelse:\n    print('Failed to open port')\n    quit()\n\nif port_handler.setBaudRate(BAUDRATE):\n    print('Succeeded to set baudrate')\nelse:\n    print('Failed to set baudrate')\n    quit()\n\n# Enable torque\npacket_handler.write1ByteTxRx(port_handler, DXL_ID, ADDR_TORQUE_ENABLE, 1)\n# Write goal position\npacket_handler.write4ByteTxRx(port_handler, DXL_ID, ADDR_GOAL_POSITION, 1024)\n\nport_handler.closePort()","lang":"python","description":"Basic open port, enable torque, write position."},"warnings":[{"fix":"Use top-level imports like `from dynamixel_sdk import PortHandler`. Do not import from submodules.","message":"Version 4.0.0 introduced a new 'Easy' API that may break existing code. The classic SDK API still works, but some internal imports have changed.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Set PROTOCOL_VERSION to 1.0 for AX-series servos.","message":"AX-12A servos use Protocol 1.0, not 2.0. Using the wrong protocol version causes silent failures.","severity":"gotcha","affected_versions":"all"},{"fix":"Add user to dialout group: `sudo usermod -a -G dialout $USER`, then log out and back in.","message":"On Linux, permission denied when opening port `/dev/ttyUSB0` without udev rules or usermod.","severity":"gotcha","affected_versions":"all"},{"fix":"Migrate to `GroupSyncRead` for Protocol 1.0, or upgrade to SDK 4.x.","message":"`GroupBulkRead` with Protocol 1.0 may return incomplete data; use `GroupSyncRead` instead for 1.0.","severity":"deprecated","affected_versions":"<4.0.0"},{"fix":"Always call `packet_handler.write1ByteTxRx(port_handler, DXL_ID, ADDR_TORQUE_ENABLE, 1)` before position writes.","message":"Torque must be enabled before writing goal position, else write may fail silently.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install dynamixel-sdk`. Ensure you are in the correct Python environment.","cause":"Library not installed or installed in wrong environment.","error":"ModuleNotFoundError: No module named 'dynamixel_sdk'"},{"fix":"Use `from dynamixel_sdk import PacketHandler` (top-level).","cause":"Incorrect import path; SDK version 3.x and 4.x changed internal structure.","error":"ImportError: cannot import name 'PacketHandler' from 'dynamixel_sdk'"},{"fix":"Verify DEVICENAME, BAUDRATE (e.g. 57600 or 1000000), PROTOCOL_VERSION (1.0 or 2.0), and DXL_ID. Check wiring.","cause":"Communication failure: wrong baudrate, port, protocol version, or servo ID.","error":"[TxRxResult] There is no status packet!"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}