Controlling the Robotic Arm

We control the arm through the serial port, using the "serial" python library to write commands. Here is a code base you can use:

#!/usr/bin/python
import serial

ser = serial.Serial("/dev/ttyUSB0") #Connects to the USB port
ser.write('BD1\r') #First command "wakes up" the controller board
#more ser.write commands here
ser.close()

The remaining commands that you send should be of the form SV<A servo number> M<1-255> \r (but with no angle brackets)

Controlling the Turtlebot

In one terminal, start up one of turtleLegs, turtleEyes, or turtleLegsEyes, depending on which of the base and kinect (or both) you need. Then you can write a python program that imports and uses the robot class from turtleAPI.py to control the robot. Several examples are located within the turtleAPI directory on the communal laptops.

Running MCL On Our Turtlebots

  1. In a terminal, run turtleMCL.
  2. If the Map and a cluster of particles shows up, skip to step 8
  3. Click 'Add' in the lower left corner
  4. Click 'By topic'
  5. Under /map, click 'Map' and click OK
  6. Click 'Add' and 'By topic' again
  7. Under /particlecloud, click 'PoseArray' and click OK
  8. At the top, click '2D Pose Estimate'
  9. Wherever you've put your robot down, click on the map, and drag in the direction the robot is facing. A cloud of particles should appear. As your robot moves, the particle cloud should move with it. You can now get the MCL estimate of the robot pose by calling getMCLTup() in the turtleAPI robot class.