Robotics-2010

From Earlham CS Department
Revision as of 07:02, 23 February 2010 by Charliep (talk | contribs)
Jump to navigation Jump to search

Software Stack

Ubuntu with Brad's Live ISO

  1. Make sure you have the latest version of the Live ISO (as of this writing)
    • Recent improvements: Right and middle click from the mac touchpad, no longer need to use sudo when trying to access USB bus, based on latest Ubuntu version, new Bluetooth management tool
  2. Boot off the live ISO, either on real hardware or virtually
  3. Login using cs282/johnny5
  4. Download Brad's installation kit and untar it anywhere you want.
  5. In your editor of choice, modify the install.sh script to connect to your brick instead of Brad's. This will be within the first few lines.
  6. Open a terminal, navigate to the folder with your newly untarred files and type
sudo ./install.sh

If your computer supports bluetooth, set up your connection to your robot

  1. Turn on your brick.
  2. Navigate through the menu to enable bluetooth
    • Ensure that your device is set to "findable"
  3. Click the bluetooth symbol at the top of your computer's screen, next to the envelope.
  4. Select "Set up new device"
  5. Select your robot
  6. You will be prompted to input a passkey into your robot
    • Use the small grey button to delete characters and the large orange button to select characters
    • Select the checkmark to submit your passkey
    • Work quickly! You have about a minute before the passkey kicks you out and makes you start over!
    • You will be notified on-screen if your passkey was successful
  7. After your passkey is accepted, try running query.py

OSX

  • These instructions were tested under Snow Leopard (10.6.2), they will probably work under Leopard too.
  • These instructions assume you already have Python, you can check this by typing python at a shell (aka Terminal) prompt. The Python interpreter should start, read the on-screen instructions to see how to exit it.
  • Frequently it's easier to get USB working than it is Bluetooth, and they use much of the same underlying plumbing.
  • You should test each step as you go, most of the packages have example code you can use to do this.
  • Each of the steps below require that a package or files to be downloaded to your computer first. They are all available in the CS282 packages directory. Once you have downloaded the zip file you can un-zip it, cd to the created directory, and run the command listed below for that directory.
$ sudo python ez_setup.py -U setuptools # setuptools
$ sudo python setup.py install # py2app
$ sudo python setup.py install # lightblue
$ sudo python setup.py install # nxt-python-1.1
  • Simon Levy's script (bluetooth.py*) must be in the directory that you are running the interpreter in for the Bluetooth interface to work. Update: Release v1.1 appears to have integrated this script into the NXT-Python library.
  • For USB support you will need PyUSB, you can download it from its SourceForge site and then install it.
  • Once you think all the plumbing is working correctly you can use the query.py script in the CS282 source directory to test it. N.B. Change the BlueTooth ID in query.py to match your NXT.

Python