Here are some pictures and a video from testing as well as a list of everything that needs to get done.
What we have now:
What we need:
Our final demo for our project is going to be a game of Chutes and Ladders where the pieces are the robots, and you can save and load the game board. Basically, the robot is starting off in the upper right-hand corner and snakes its way down the board. The first “dice roll” is a 2, so it moves to the end of that row. The next “dice roll” is a 3, so it needs to go down to the next row and move all the way to the right. The yellow square is meant to represent the location of another robot, so the moving robot moves around that square to get to where it needs to be. If that robot wasn’t there, then the moving robot would have just moved straight to the end of the row.
We’re approaching the final stretch, but we still have much to do. Below, we just posted a bunch of photos and videos from our various testing sessions.
First, here’s a video from right before our midterm demo:
Next, we have some pictures from testing. We basically would line up the robot with the tape and tell it to go various distances at various speeds in order to get an idea for how accurately it could move.
In the process of testing our robots, we’ve also been developing a camera tracking system for them using Processing.
Here’s our camera and tripod. We’re doing color tracking with various materials (see below). You’ll notice the red and green squares on the computer monitor, which correspond to…
Well, that’s it for now. We need to get back to work on our robot and user clients as well as our control server.
Here are the tests that we will conduct to ensure reliable operation of our system:
We will write scripts to automate as many of these tests as possible, in order to achieve easy reproducibility.
We just completed setting up the central server part of the project. Our server setup involves an Amazon EC2 instance, which is a virtual server in the cloud. This allows us to have a fully customizable server with a static IP address. The static IP was required so that each robot knows how to contact the server at any given time.
We’re working on a big update, and will have something for you guys to see soon enough. Our mid-semester demo is coming up this Friday, and we’re really excited to show off what we have.
For now, all I’ll say is that Python is a very fun language!
I’ve been discovering things about it and learning it along the way as we need it for our development, and are planning on having at least all the code on our Pi be in Python.
One thing slightly annoying about the language is manipulating bits around. Well, it was annoying for me because I wasn’t quite familiar with the usual tricks and tips of how to do it in Python. But instead of talk about those today, I’d like to introduce a new library we’ve decided to use, bitstring.
Say you want to create one unsigned byte, and two 16 bit signed 2’s complement integers, and form one five byte string to send across a serial port. This becomes trivially easy with bitstring.
num1 = BitArray(uint=INTEGER1, length=8)
num2 = BitArray(int=INTEGER2, length=16)
num3 = BitArray(int=INTEGER3, length=16)
return num1.bytes + num2.bytes + num3.bytes
And there you have it! As opposed to randomly manipulating bits with masks, and shifts, and other really low level operations that behave ever so slightly differently from C on some occasions!
Here’s just some information we used to started with our Pi
Installing the OS
We installed the Raspbian Wheezy OS on our Pi. The OS image we used was from this website.
And we used the following tutorial to install our OS.
Connecting to Pi using an Ethernet Cable
Getting an ethernet connection working to SSH into the Pi directly from our computer was the next step we completed, and we followed this forum post to get that working. We also found this guide helpful.
Wifi Access on the Pi
1) The wifi dongle we are using is the Edimax EW-7811Un USB Wifi dongle. We got it on amazon at
2) The Raspbian Wheezy OS is supposed to have the driver for this dongle pre-installed, but our OS wouldn’t even boot when the dongle was plugged into the USB port.
We had to install the driver for dongle. The driver we used can be found at
3) After transferring the 8192cu.ko file to the /boot directory in the SD card, we then ran this script by MrEngman
4) At this point, the blue light on the Edimax should turn on. You should also be able to boot into the OS with the dongle connected to the USB port.
Try the following commands to see if installation worked
lsusb - Check if it recognizes the USB connection
lsmod - to see if the driver has been installed. You should see 8192cu in the list
iwconfig - you should see wlan0 there you should be ready to go.
5) Run these commands to connect to the wifi
sudo iwconfig wlan0 essid YOUR_NETWORK
sudo dhclient wlan0
This should give your Pi an IP address. If you run ifconfig again you should be able to see this IP address.
Note: This only works for WPA networks without passwords.
6) To have wireless turn on when the Pi boots follow the steps
The wpa_supplicant.conf file needs to be changed based on the network you are trying to connect to. For an open network the is no “psk” field and
key_mgmt = NONE
7) When you reboot the computer it should connect to the internet without having to do the steps in (5)
You might also want to try deleting /var/run/wpa_supplicant/wlan0 and rebooting.
Finally connecting to the internet on the Pi! Nidhi and Dhaval did some great work today.
[UPDATE] Wireless SSH works! No more ethernet for us! Tomorrow, we’re going to try to get communication between the Pi and a computer over the internet working. Maybe we’ll also get communication between the Pi and the iRobot working?
So this is pretty much our first real post. We met with our TA in the Robotics Club at CMU, and we ended up getting a colossal amount of work done. We were a little worried that our DB-25 cable (used for serial communication between our Raspberry Pi and iRobot Create) and our MicroUSB cable (used to power the Pi) had not arrived, but this turned out to be a non-issue. We used a ribbon cable header for our serial communication purposes and the GPIO pins themselves on the Pi to power it. All in all, we got a ton of work done. 7 days ‘til our midterm demo!
[Above] 5V regulator circuit.
[Above] Setting up the Pi with our Robot.
[Above] A better view.
[Above] Running the Raspberry Pi purely off of the iRobot’s battery power!!!
[Above] Late night programming session with the Pi. At this point, we were struggling to connect our Pi to CMU’s wireless signals.
[Above] Our trusty steed.
[Above] Success! We can establish a Wi-Fi connection! Now, all we need is for CMU to allow us to use their secured network. Back to work… :-/
We’re just getting started, but stay tuned for more exciting updates!