Primarily designed for MX series
- Clone the dynamixel robotis repo. Note that the repo has gone through changes that aren't backward compatible. Checkout an earlier commit compatibility .
git clone https://github.com/ROBOTIS-GIT/DynamixelSDK.git
cd DynamixelSDK
git checkout 2ae37fc2390eedcd8fe356f40ece398720db0532
- build the c library
cd ~/Libraries/DynamixelSDK/c/build/linux64/
make
- add path to the ctype wrapper in the bashrc
export PYTHONPATH="/home/vik/Libraries/DynamixelSDK/python/dynamixel_functions_py:$PYTHONPATH"
- Edit
DynamixelSDK/python/dynamixel_functions_py/dynamixel_functions.py
to point to the right libraries (absolute path)
dxl_lib = cdll.LoadLibrary("/home/vik/Libraries/DynamixelSDK/c/build/linux64/libdxl_x64_c.so")
- Edit user permissions to access ports
sudo usermod -a -G tty yourname
sudo usermod -a -G dialout yourname
Note that logout/login will be required for the group addition to take effect.
- Port's latency can significantly affect your performance. You can check its value by:
$ cat /sys/bus/usb-serial/devices/ttyUSB0/latency_timer
If you think that the communication is too slow, type following after plugging the usb in to change the latency timer
Method 1.
$ echo 1 | sudo tee /sys/bus/usb-serial/devices/ttyUSB0/latency_timer
$ cat /sys/bus/usb-serial/devices/ttyUSB0/latency_timer
Method 2.
$ echo ACTION==\"add\", SUBSYSTEM==\"usb-serial\", DRIVER==\"ftdi_sio\", ATTR{latency_timer}=\"1\" > 99-dynamixelsdk-usb.rules
$ sudo cp ./99-dynamixelsdk-usb.rules /etc/udev/rules.d/
Use commands below to reload the rules, or log-off+login for the new rules to take effect.
$ sudo udevadm control --reload-rules
$ sudo udevadm trigger --action=add
$ cat /sys/bus/usb-serial/devices/ttyUSB0/latency_timer
- Create identifiable link for your usb devices now. Check the serial of the device using
udevadm info -a -p $(udevadm info -q path -n /dev/ttyUSBX) | grep serial
Now add a synlink to your udev file /etc/udev/rules.d/99-dynamixel-usb.rules
. The final file will look something like this
ACTION=="add", SUBSYSTEM=="usb-serial", DRIVER=="ftdi_sio", ATTR{latency_timer}="1"
ACTION=="add", SUBSYSTEM=="tty", ENV{ID_MODEL_ID}=="6014", ENV{ID_VENDOR_ID}=="0403", ENV{ID_SERIAL_SHORT}=="FT3R4CCT", SYMLINK+="DKitty"
ACTION=="add", SUBSYSTEM=="tty", ENV{ID_MODEL_ID}=="6014", ENV{ID_VENDOR_ID}=="0403", ENV{ID_SERIAL_SHORT}=="FT2H2MX4", SYMLINK+="DLeg"
Note that logout/login will be required for the new rules to take effect. Alternatively one can also use udevadm control -R
- Open dynamixel_utils.py and pick the connected dynamixel type
python dynamixel_utils.py
to test