Python controller interface with improved buck reading and writing for faster communication rate and lower latency.
-
High USB latency time.
There might be a default USB latency time limiting the communication frequency with USB devices (16 ms for example in Ubuntu 18.04). For more information please refere to https://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_wizard2/#usb-latency-setting.
To change the latency time on ubuntu (replace "ttyUSB0" with your device name):
cat /sys/bus/usb-serial/devices/ttyUSB0/latency_timer
To manaully change the latency time on ubuntu:
echo 1 | sudo tee /sys/bus/usb-serial/devices/ttyUSB0/latency_timer
NOTE: You have to set the latency time every time you plug you USB device.
-
Low baudrate of Dynamixel bus.
Change the baudrate of dynamixel actuators to a higher value (4M or higher)
-
The package is tested and targeted to run only on ubuntu. (tested on Ubuntu 18.04)
-
Download dynamixel_sdk source code (we use develop branch to take the advantage of fast sync read/write):
git clone https://github.com/ROBOTIS-GIT/DynamixelSDK/tree/develop
-
Navigate to DynamixelSDK/python/src.
-
Open the file "port_handler.py". In line 27, change the variable LATENCY_TIMER to the USB latency time you set.
LATENCY_TIMER = 16 # Change the value to the USB latency time
Note: This only changes the timeout of the port_handler. If not properly set, the default timeout will be longer and may cause problems with a high communication frequency.
-
Navigate to DynamixelSDK/python. Install the modified package by running:
python3 setup.py install
pip install -i https://test.pypi.org/simple/ dynamixel-controller==0.0.12