|Note: This tutorial assumes that you have completed the previous tutorials: Assembling the TurtleBot Arm, Arm Software Installation Instructions.|
|Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.|
Setting up TurtleBot Arm ServosDescription: This tutorial walks through setting the correct IDs for the servos, confirming that the power to the board works correctly, and testing the arm.
Tutorial Level: INTERMEDIATE
Power the Board (only for TurtleBot 1)
Once the board is properly connected to the TurtleBot power board (subject to change), and the servos wired to the controller board as shown below, connect the board via an FTDI USB cable to the computer. This should power the processor off USB. Make sure that you plug in the FTDI USB cable after the iRobot Create cable.
Next, turn on the correct breaker (breaker 1 or 2) from turtlebot_dashboard. You should see red LEDs flash on the back of the servos as they power on.
Set Servo IDs
Install ArbotiX Firmware
Next, follow the Mini Maxwell tutorial for setting up the firmware on the ArbotiX.
Install ArbotiX Firmware (Alternate Method)
If you have an AVR ISP mkII and want to skip all of the Arduino setup the following hex file used.
The following command will burn it to the Arbotix board.
sudo avrdude -p m644p -c avrisp2 -P usb -U flash:w:ros.hex
Programming the Servos
The general procedure here is to break the daisychain one-by-one, so that only one new servo is connected at each step, and rename the servos from base to gripper. The IDs and names of the servos are shown in the image below.
Each servo ships with an ID of 1, so we need to program the servos with new IDs before use. The easiest way to do this is to connect the ArbotiX to the PC using the USB cable, and then attach one servo at a time setting the ID using Arbotix terminal program.
To start the terminal, pull down pypose, and run PyPose.py. You will either need to be on the turtlebot system directly, or, you will need to ssh to your turtlebot specifying the -X option to forware X windows to your local system.
cd ~ git clone https://github.com/vanadiumlabs/pypose cd pypose ./PyPose.py
You will get a PyPose window.
Click on Configuration -> port
Select the correct port. (Likley /dev/ttyUSB1)
Now Click on tools -> terminal
The terminal works like a typical Linux terminal. Typing ls will query the ArbotiX for the attached servos and print the number of each. If you attach a single servo, you should get just "1" when you type ls. You can then move this servo to a new ID using the mv old_id new_id command. Let's move our servo #1 to ID 2:
mv 1 2
Do the same until you have number your servos as follows:
Arm Servos (from base to gripper) ID 1 = Shoulder pan ID 2 = Shoulder lift ID 3 = Elbow flex ID 4 = Wrist flex ID 5 = Gripper
Remember, each servo must be plugged in one at a time -- if you have two servos with the same ID plugged in at the same time you will be unable to communicate with either!
To test the arm, we will bring up the turtlebot_arm stack and teleoperate the arm. Run this command on a remote terminal on the turtlebot.
roslaunch turtlebot_arm_bringup arm.launch
You should see:
[INFO] [WallTime: 1312416101.995488] Started ArbotiX connection on port /dev/ttyUSB1.
Next, we will teleoperate the arm with a GUI from the arbotix_python package. Run this command on your local PC.
rosrun arbotix_python controllerGUI.py
You can now use this GUI to teleoperate individual joints. To operate a joint, click the checkbox next to it, and then operate the slider.
Check the box next to the servo to power it, and uncheck the box to unpower (relax) it.