Thursday, January 14, 2010

Linguo: a Telepresence Robot Using an iRobot Create

Two Christmases ago my roommates gave me an iRobot Create. I decided to make a telepresence robot similar to the one my friend, Damon, constructed.

The key electronic components were:
  • iRobot Create® Programmable Robot
  • Samsung NC10 Netbook
  • Quickcam 4000 (an old one I had lying around)
The hard parts in constructing this robot was mounting everything cleanly and securely. I turned to acrylic and a laser cutter for this task. While this was my first foray into this type of construction, it went very well. A critical step in this process was constructing a prototype using cardboard and hot glue. This caught several physical mistakes that came as a result of my poor spatial reasoning.

With the hardware in place, I wrote two quick python scripts to control Linguo. One to get the commands from the user and the other to actually control the robot. These talked via Skype using its API. Skype was an excellent choice for this project because both video and audio came for free. In addition communication is done between screen names so there was no worrying about changing IP addresses.

The control script was pretty simple. It initiates a call via Skype, maps key presses to commands, and sends those commands as a Skype text message.

The other script (the one controlling the robot) automatically answered the call (super convenient), turned on the video, and waited for commands. When it received commands and requests, it controlled the Create and read from its sensors using PyRobot.

  • Everyone's first reaction to Linguo is to stand in front of it and "see what it does." Damn you human curiosity!
  • People are very hard to identify by their shoes.
  • Houses are surprisingly dark, it would have been nice to have a flashlight.
  • Operating live controls (i.e. where the length of the button press denotes how far the robot should go) over a high latency connection is very frustrating.
  • Don't think driving the robot in your room next to your computer is truly the same as controlling it from New York to San Francisco (which I did). You miss very important things like having a detailed charge and battery status and important perspective on how hard it is to drive using just the camera and microphone.
  • Telepresense is frikin' awesome!
Technologies: iRobot Roomba, Python, Skype, TkInter, PyRobot

Monday, January 11, 2010

How Far Does a Hamster Run?

About two years ago my housemates and I started wondering if our hamster, Lizzie, could run across the United States in her lifetime. I built a device to count revolutions of her wheel and a website to track her status. Recently Lizzie passed away making it almost 1000 miles (or about a third) of her journey. We were sad to see her go, but she left some interesting data.

How far does a hamster run?
Over her recorded life, Lizzie ran an average of 1.65 miles per day. In the first half of her life this average was higher at 2.27 miles per day. Later in her life, as she started getting old and sick, it dropped to 0.88 miles.

As one might expect, over time she ran less and less per month. Below is a graph of the distance she ran each month, the amount of time she spent running, and her average speed.
There are a couple interesting insights in this graph.
  • Lizzie ran a lot less in Dec-08 and Jan-09 (10 miles a month down from 40). We're not entirely sure what caused this but suspect it was some sort of pseudo hibernation. We know that we hadn't managed the heat well and there were a couple days when the temperature dropped inside the house which might have triggered this instinct. However she was still eating, drinking, and pooping fine.
  • In the precipitous decline at the end of her life, she both ran more slowly and ran less. This is in contrast to her pseudo hibernation where she just spent less time running. This might be a way to tell if a hamster is unhealthy (if you're not already being a diligent pet owner).

When does a hamster run?
Anyone who's owned a hamster and has been kept up by the pitter patter of little hamster feet running on the wheel knows that they're nocturnal. This was confirmed by our observations. As seen below, she runs almost exclusively at night.

I wish I had recorded light levels in her cage to see if the room lights and my roommate's sleep schedule) affected when she ran.

How fast does a hamster run?
Over her recorded lifetime she ran an average of 1.51 mph. This was higher when she was younger in 2008 at 1.62 mph and significantly lower as she got older in 2009 at 1.18 mph. Her top speed was about 2.5 mph.

This can also be graphed in interesting ways. Below shows how many miles he ran at each speed in 1/100th of a mph increments.
There's a spike at 0 mph which probably came from her starting and stopping, which she did a lot. In fact, if you were in the room watching her, she'd start and stop very often just to check if you were still there.

Looking rest of the graph, we see two peaks in the total (red line), almost as if she had two preferred speeds. It turns out that after whatever happened to her in the winter of '09, her preferred speed switched from 1.6 mph to 1.2 mph. Looking at the years by themselves (purple and green lines) we get something that looks a little closer to a bell curve (or some sort of distribution around a mean). Putting all three of these together we can see how 2008 and 2009 add to create the two peaks that we see in the total curve.

What's next?
Well the scientist in me would like to buy 5 more hamsters to see if these results are typical and measure more variables (like temperature, water consumption, and light levels). Realistically I think we're just going to get a new hamster to pick up where Lizzie left off. However, we are going to bury Lizzie's cremated remains where she stopped, in Carson National Forest in the Spring.

If you have more questions, check out the FAQ. Also, if you want to track your own hamster, I wrote an Instructable you can follow.

Technologies: PHP, Python, MySQL, Google Docs

Thursday, January 7, 2010

Singlespeed Handlebar Chop and Flip

About a year ago I bought a a $10 road bike off of Craigslist and converted it into a super hip single speed. While using it to commute to work, I started to get annoyed at the dropped handle bars. They were lower than my regular road bike making the brakes hard to reach. I decided to go even more hipster and convert them to bullhorn handlebars.

Overall the process was pretty simple. First I removed the handlebars from the bike as well as the brake cable (which was going to be replaced as well).

Next I chopped the handle bars to the correct length using a pipe cutter. If you do this yourself, I highly recommend this route as I've cut pipes with a Dremel before and this was significantly simpler. I sanded around the edge of the cut to clean it up a bit since the pipe cutter left it sharp.

Finally, I installed the handlebar again, hooked up the brake lever that I pulled from a defunct mountain bike, and wrapped the whole thing with some image appropriate bright orange handlebar tape. The mountain bike brake lever is really nice since its easier to pull a greater distance than the road lever that was on there. The picture below shows the the bike ready to ride (with my GPS and light).

Now please excuse me while I role up my skinny jeans, put on my Chrome messenger bag, and grab a can of PBR.

* Note: All hipster references are meant to be ironic. The writer of this blog does note condone or support the hipster lifestyle in any way.

Technologies: Pipe Cutter, Basic Tools