Software

In this section, we’ll be setting up the software for the WidowX Robot Arm. You will need the Arduino IDE to install firmware on to the ArbotiX-M. If you are setting up ROS, you will need a computer compatible with Xenial (Ubuntu 16.04), and ROS Kinetic.

Arduino IDE Setup

Download and Install the Arduino IDE (last tested version 1.8.5)

The Arduino IDE (Integrated Developer Environment) is an application that you can use to program and interact with Arduino based microcontrollers like the ArbotiX-M. You can grab the latest tested version of the Arduino IDE here.

Install the FTDI drivers

Now you will need to install FTDI drivers. These drives will allow your FTDI-USB cable or UartSBee to function properly. Some modern Operating Systems either have these drivers or can automatically find them. If you don't have the drivers or you are unsure, you can find the FTDI drivers here, and a guide to installing them here. Windows users can download the the drivers and install them through the windows hardware wizard, or click on the 'setup executable' link automate the process.
FTDI Drivers
FTDI Installation Guides

Install the ArbotiX-M Hardware and Library Files

For the Arduino IDE to support the ArbotiX-M, we'll need to add files into the Arduino user folder. Click here to download the needed ArbotiX-M Library and Hardware Files. In this .zip file, there will be 2 folders that need to be installed to your Arduino user folder.

hardware-this folder contains all of the hardware definitions that will allow the Arduino IDE to build programs for the ATMega644p on the ArbotiX-M. This folder also contains definitions for the AVRSTK500 serial programmer.
libraries-this folder contains libraries that will help you use the ArbotiX-M to its full potential. Many of these libraries will be required to compile the programs for InterbotiX robots. Click herefor more information on the individual ArbotiX-M Libraries.

You will also need the ArbotiX Sketches folder from here to continue following along. This folder has all of the firmware that will be discussed in the firmware section of this guide.
ArbotiX Sketches-this folder contains test code and sample code for various ArbotiX-M projects and InterbotiX robots.
To install the ArbotiX-M files you will move these folders into your 'Arduino' user folder. This is NOT the folder where the Arduino IDE itself is located. The location of this folder will be different based on your operating system.

Windows XP
My Documents\Arduino\


Windows Vista/7
Documents\Arduino\


Mac/Linux
~/Documents/Arduino/

Where '~' represents the path to your user account.

If you're having trouble finding your 'Arduino' folder, open the Arduino IDE and open the 'Preferences' panel (File->Preferences). Here you will find a file path under 'Sketchbook location:'. This is the path to your 'Arduino' folder.
If you aleady have a library or hardware folder, simply copy the contents of the ArbotiX-M Libary/Hardware folder into the library/hardware folder in your 'Arduino' folder.Your folder structure should look like the one shown above, along with your pre-installed files.
Now open the Arduino IDE. You should see the following options:
Under
 'Sketch->Import Library->'
you should see Bioloid and Commander among other libraries
Under
 'Tools->Board->'
you should see ArbotiX Std at the top of the list
Under
 'Tools->Programmer->'
you should see AVR ISP mkII(Serial)
If all of these are available, then your Arduino IDE is setup and ready to program the ArbotiX-M!

Connecting The Arbotix Robocontroller to your Computer

To program the ArbotiX-M Robocontroller from your computer you will need an FTDI-to-USB device. We recommend either the UartSBee or the FTDI-USB Cable.

  • In this example we will power the ArbotiX-M from the FTDI port. Move the power jumper so that it connects the middle pin and the 'USB' pin ('FTDI' for the original ArbotiX).
    Power Jumper for ArbotiX-M
  • The orientation of the FTDI cable is very important - it is possible to plug in the cable backwards and you will not be able to program your board. The top FTDI pin with the mark 'BLK' will always connect to the black FTDI cable. This pin is a ground or 'GND' pin. The bottom pin with the mark 'GRN' will always connect to the Green FTDI cable.Click here to learn more about powering the ArbotiX-M
  • If you are using the UartSBee, the 'BLK' and 'GRN' marking are on the underside of the board.
  • If you are using a UartSBee, make sure that the switch is set to '5v' so that the unit is running at 5v like the ArbotiX-M
  • Click here to learn about more options to program the ArbotiX-M


ArbotiX-M to UartSBee Connection


ArbotiX-M to FTDI-USB Connection

You cannot program the ArbotiX while an XBee is plugged into the ArbotiX or the UartSBee. You must unplug any XBees from the ArbotiX-M or UartSBee while programming. This is because the XBee and the FTDI cable are connected to the same serial port. If you wish to program the board while an XBee is plugges in, you must use ISP programming.

Firmware

Firmware for the WidowX is dependent on how you intend to control it. For an ROS installation or to use DynaManager, you will use the ros sketch in the ArbotiX Sketches folder you downloaded in the Arduino IDE Setup. To use the Arm with the Armlink Software, you will use the Armlink Sketch and follow the Armlink instructions.

Firmware: WidowxArmTest

A great piece of code to run for testing your WidowX Arm build is the WidowxArmTest, included in the files you downloaded in the Arduino IDE Setup. Once the program is loaded, make sure that your robot is powered from a 12v power supply, and that the power jumper is set to ‘VIN’. Once the robot is programmed and powered, it will move to a ‘Center Position’ where each servo horn is at its centered position. You will need to wait for ~10 seconds as the robot starts the build check. The robot should move in the exact way as shown in this video.

Troubleshooting

If your robot does not move as shown in the video, there has been a problem assembling, configuring, or programming your robot.

In addition to running a motion test, the ArbotiX Robocontroller will also send serial communications with more details about the build check. This feature will help you figure out exactly what's going wrong with your robot.

To see the serial communications, make sure your FTDI cable is still plugged into your computer. After you have uploaded the test sketch onto the ArbotiX, unplug the power from your robot. Click the 'Serial Terminal' button on the upper right corner (the button should have a magnifying glass). Now plug power back into your robot. Normally, if everything was working, you would see the following text.

###########################
Serial Communication Established.
###########################
System Voltage: 12.00 volts.
Voltage levels nominal.
###########################
###########################
Moving servos to centered position
###########################

This terminal will warn you if servos are not found or if the voltage is too low or high.

No Serial Communications

  • Check that your ArbotiX is powered correctly Make sure that you are applying a 12v power source and that the power jumper is set to 'Vin'.
  • If you are using a LiPo battery, make sure your battery is fully charged
  • Re-load the test firmware onto your ArbotiX and make sure you see an 'Upload Successful' message.
  • Check that your FTDI cable is oriented properly
  • Make sure you are opening the serial monitor on the same port as you programmed the board.
  • Check that your Servos are set to the correct IDs. Having multiple servos set to the same ID can cause problems with the serial monitor.

If you are still having problems you may have a hardware problem, Contact Support

"Voltage levels below 10v, please charge battery."

  • Usually this error is very straightforward - you may get this error if you batteries are low, or you are using a power supply blow 10v. Check your power and your power jumpers
  • This error can also be caused if there is a problem with servo #1. If servo #1 cannot be found, the system cannot check the voltage. Problems with servo # 1 are most commonly
    • Multiple Servo ID #1 If multiple servos with ID # 1 are on the same bus, they will interfere with each other. The ArbotiX will not be able to detect any servo # 1, nor will it be able to read the system voltage.
    • No Servo ID # 1If there is no servo # 1 present, then the system voltage will not be read.
    In both cases, you can solve this problem by correctly setting the IDs on your servos.

"ERROR! Servo ID(s) are missing from Scan"

  • The serial monitor will tell you which servos cannot be found. Inspect these servos first.
  • Check to make sure that each servo's cables are firmly seated. Inspect each cable for breaks or tears.
  • Watch each servo as you apply power to the robocontroller. The red led on the servo should light up if it is receiving power.
  • Run through the Servo ID guide and test each servo to make sure that it has the correct ID. Also make sure that each servo works in its full range of motion.

If you cannot communicate with the DYNAMIXEL or it does not move in it's full range, Contact Support

The robot does not move as the video shows

  • Check the assembly guide to make sure the robot has been assembled correctly. Specifically, make sure that the horn is aligned correctly and matches the instructions. Having the servo horn attached at the wrong angle can lead to problems.
  • Make sure that your servos are in the correct position, according to this diagram

If you are still having problems you may have a hardware problem, Contact Support

Firmware: ROS

For an ROS install, you use the ROS sketch you downloaded in the Arduino IDE Setup. This firmware acts as a passthrough, compatible with the arbotix_python library and any derivatives. All of the configuration is handled by the software passing commands to and reading data from your ArbotiX-M. This sketch is also used by the DynaManager Software, useful for IDing your servos.

Attention

If you are installing this firmware for use with the ROS kit, skip to the rest of the Firmware Section, Follow the instruction for IDing your Dynamixel Servos, and Follow the instruction in the Software for ROS section.

Dynamixel Servo ID

This guide will teach you how to ID servos using an ArbotiX Robocontroller and a computer.

The DynaManager software requires Java to run. If you do not have Java installed on your system, it is available here.

Once you have Java installed, you will need to download the DynaManager Software. The software is compatible with Windows XP, Vista, 7, 8, 8.1, 10, Mac OS 10.5+, and Linux. Windows 10 users should download the Dynamanager 1.4 Preview release due to compatibility issues. Mac users please see the 'Note for Mac Users' here before following the rest of this guide.

For the DynaManager to work, you will need the ROS.ino sketch loaded onto your ArbotiX. New ArbotiX boards come pre-loaded with the ROS sketch. If you have already loaded another program onto your ArbotiX, you can find the ROS sketch here:

File->Sketchbook->ArbotiX Sketches->ROS
If you need help programming your board, see the Arduino IDE setup and Firmware sections above this. Once you have ROS loaded onto your ArbotiX, set up your hardware as shown.

Single Servo Setup for ArbotiX-M


The Rest of this tutorial will guide you through using the DynaManager software. Before you set your servo IDs, here are some things to keep in mind.
  • You can only ID one servo at a time. Do not plug multiple servos into the ArbotiX when using the DYNAManger.
  • Make sure you label your servos as you ID them! This will make the assmebly phase go much faster
  • All servos come pre-set to ID # 1. However we still recomend that you use the DynaManager to set the ID on servo #1. This will make sure the servo's baud rate is set correctly, as well as allow you test the servo.
  • Most kits use only AX-12A or AX-18A servos. For these kits, you can simply ID the servos in sequential, increasing order for however many servos you have. The exceptions are:
    • If you have a PhantomX Reactor Robot Arm without wrist-rotate then skip servo 7 (ID the first 6 servos normally, then set the last servo to ID #8)
    • If you have a WidowX Robot Arm MK-II, see this diagram. (The MK-I diagram is availbe here)

    Using the Dynamanager

    Launch the Dynamanager application on your computer. You should see a screen as shown above.
    The easiset way to connect to the ArbotiX is to lick on 'Auto Search'. This will scan all of your available serial ports for an active ArbotiX running ROS.
    If you have problems with the Auto Search Function, manaully pick the serial port that corresponds to your FTDI device, and hit 'connect'.
    Once connected to the ArbotiX, the Servo Scan panel will appear.
    Click the 'Scan' button to begin the servo scan. While scanning the 'Scan' button will change color and the text 'Scanning' will show in the Servo ID field. New AX servos should be found almost instantly, and new MX servos will take a 5-10 seconds to find. The scanner will scan from IDs 0-252 at both 1000000 baud and 57600 baud. A full scan takes about a minute. If the scan completes and your servo is not found, make sure that your servo is powered and connected to the ArbotiX.
    Once a servo is found, the servo's ID and model number will appear. The 'Set Servo ID' and 'Test Servo' panels will now appear.
    Enter in the ID that you would like to set the servo to. In the assembly guide for your robot, you will find a diagram of which servo should get which ID.
    Click the 'Set ID/Baud' button.Note:New servos come pre-set to an ID of '1'. However it is still a good idea to 'Set' your first servo to an ID of 1, to make sure that your Baud rate is set correctly.
    The 'Servo Scan' panel should now update to reflect your newly ID'ed servo (if it does not, click 'Scan' again. Now you can use the 'Test Servo' panel to move your servo horn to make sure it is working properly. Click and hold anywhere along the blue ring and the servo should move to that position.
    Once you are done, click the 'Center Servo' button to set the servo horn back to its centered position. This is very important, as the assmbly guide for your robot will assume your servo horn is centered. Assembling your robot with mis-aligned horns will cause it to malfunction.
    Now you can repeat these steps until you have all of your servos IDed. Once you are done, click 'Disconnect' to disconnect from the ArbotiX

Software For ROS

Install Xenial (Ubuntu 16.04.X LTS) on your machine. If you don’t know how to do this, follow the directions on the Ubuntu Website

Install Dev branch of GTK 3 for compilers

  • sudo apt-get install build-essential libgtk-3-dev

Install ROS Kinetic

Installation Instructions from ROS.org

  • 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 update
  • sudo apt upgrade
  • sudo apt install ros-kinetic-desktop
  • sudo rosdep init
  • rosdep update
  • echo “source /opt/ros/kinetic/setup.bash” >> ~/.bashrc
  • source ~/.bashrc

RealSense ROS Package Install:

Prerequisites
Sensor package
  • sudo apt install ros-kinetic-librealsense ros-kinetic-realsense-camera
  • sudo reboot
Kernel 4.10 installation work-around
  • sudo apt-get install libglfw3-dev
  • cd ~
  • git clone https://github.com/IntelRealSense/librealsense.git
  • cd librealsense
  • mkdir build && cd build
  • cmake ../
  • make && sudo make install
  • cd ..
  • sudo cp config/99-realsense-libusb.rules /etc/udev/rules.d/
  • sudo udevadm control –reload-rules && udevadm trigger
  • ./scripts/patch-realsense-ubuntu-xenial.sh

Additional dependencies

  • sudo apt install git htop
  • sudo apt install ros-kinetic-moveit ros-kinetic-pcl-ros

Setting dialout permission for Arbotix

Replace yourUserAccount with the system account you are using * sudo usermod -a -G dialout yourUserAccount

  • sudo reboot

Clone widowx_arm repository and build

Test execution without additional sensors

  • cd ~/widowx_arm
  • source devel/setup.bash
  • roslaunch widowx_arm_bringup arm_moveit.launch sim:=false sr300:=false

Test execution with SR300 sensor

  • cd ~/widowx_arm
  • source devel/setup.bash
  • roslaunch widowx_arm_bringup arm_moveit.launch sim:=false sr300:=true