Dynamixel - gkgkgk1215/else GitHub Wiki

Dynamixel Wizard 2.0

Official Webpage Download the file here

Authorize to run the file and install following the wizard

sudo chmod 775 DynamixelWizard2Setup_x64
./DynamixelWizard2Setup_x64

Put your account to the group to access to the USB port

sudo usermod -aG dialout <your_account_id>
reboot

Dynamixel Wizard Error (Infinite Loading in Ubuntu 22.04)

This is due to DX cannot load QT library. You need to set the library path.

  1. Test if this solution is working:
cd ~/ROBOTIS/DynamixelWizard2
export LD_LIBRARY_PATH=$PWD:$PWD/platforms:$PWD/xcbglintegrations:$LD_LIBRARY_PATH
./DynamixelWizard2
  1. For future use, let's make a script:
cd ~/ROBOTIS/DynamixelWizard2
gedit NewWizard.sh
#!/bin/bash

DIR=$(cd "$(dirname "$0")" && pwd)

# Qt6 라이브러리 경로
export LD_LIBRARY_PATH="$DIR:$DIR/platforms:$DIR/xcbglintegrations:$LD_LIBRARY_PATH"

# Qt 플랫폼 명시
export QT_QPA_PLATFORM=xcb

# (선택) Qt plugin 경로 명시
export QT_PLUGIN_PATH="$DIR"

exec "$DIR/DynamixelWizard2" "$@"
  1. or you can register alias in ".bashrc":
alias dx_wiz='cd ~/ROBOTIS/DynamixelWizard2 && LD_LIBRARY_PATH=$PWD:$PWD/platforms:$PWD/xcbglintegrations:$LD_LIBRARY_PATH ./DynamixelWizard2'

Dynamixel SDK

Install ROS library (C++ library and Python module)

sudo apt-get install ros-[ROS Distribution]-dynamixel-sdk

Clone repo and install Python modules for Dynamixel

cd ~
git clone https://github.com/ROBOTIS-GIT/DynamixelSDK.git
cd ~/DynamixelSDK/python/
sudo python3 setup.py install

Test with examples

cd ~/DynamixelSDK/python/tests/protocol2_0/
python3 ping.py
python3 read_write.py

You might need to install dependencies

sudo apt install python3-pip
pip install pyserial

Modify USB latency

Check the current latency

cat /sys/bus/usb-serial/devices/ttyUSB0/latency_timer

Change the latency to 1

sudo gedit /sys/bus/usb-serial/devices/ttyUSB0/latency_timer

If needed, change the latency regardless of rebooting

sudo apt install setserial
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/ 
sudo udevadm control --reload-rules 
sudo udevadm trigger --action=add 
cat /sys/bus/usb-serial/devices/ttyUSB0/latency_timer

Reading from the DX usually takes 16 ms under baudrate=1Mbps & latency=16 ms (by default), Changing the USB latency to 1 ms will reduce the reading time to under 1 ms, which enables build the controller on the desktop.

GPT recommended:

# create rules
sudo nano /etc/udev/rules.d/99-ftdi-latency.rules

# write down the rules
ACTION=="add", SUBSYSTEM=="usb-serial", DRIVER=="ftdi_sio", ATTR{latency_timer}="1"

# apply to the system
sudo udevadm control --reload-rules
sudo udevadm trigger

# check the latency applied
cat /sys/bus/usb-serial/devices/ttyUSB0/latency_timer