This guide assumes that you are running Ubuntu 18 and that you want to control dynamixel XM-430 servos using the U2D2.

1) SET USB LATENCY

Start by setting the USB latency on the NUC for fast communication. This can be done by running the following command:

sudo usermod -aG dialout $USER && echo 1 | sudo tee /sys/bus/usb-serial/devices/ttyUSB0/latency_timer

You can check it by running the following:

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

2) Install dependencies

The following dependencies need to be installed on the nuc.

2.1) ROS

To install ROS melodic on ubuntu 18 run the following commands:

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
sudo apt-get update
sudo apt-get install ros-melodic-desktop-full

2.2) Dynamixel SDK and ROS Controller

Run the following commands to install the remaining dependencies:

sudo apt-get install -y git cmake python-tempita python-catkin-tools python-lxml xsltproc qt4-qmake libqt4-dev libqscintilla2-dev

Run the following to install the Dynamixel Workbench used for communicating with the servos through ROS:

sudo apt-get install ros-melodic-dynamixel-sdk
mkdir ~/catkin_ws && cd ~/catkin_ws
mkdir src && cd src
git clone https://github.com/MathiasThor/my_dynamixel_workbench.git
git clone https://github.com/MathiasThor/dynamixel-workbench.git
git clone https://github.com/ROBOTIS-GIT/dynamixel-workbench-msgs.git
git clone https://github.com/stonier/qt_ros
cd dynamixel-workbench-msgs && git checkout f91ae7dbd5d368a3121ca5bb901771b2e6471c01
source /opt/ros/melodic/setup.bash
source /home/$USER/catkin_ws/devel/setup.sh

In order to add the above command to your .bashrc use the following command:

gedit ~/.bashrc

and add the following in the end of the file:

source /opt/ros/melodic/setup.bash
source /home/$USER/catkin_ws/devel/setup.sh

Finally, compile the dynamixel ros controller:

cd ../.. && catkin_make