Starting the roviopy project
For my birthday, I asked for a Rovio. It is a pretty cool little platform and I saw it on woot for only $100. What a deal, I said.
Anyway, my plan is to create a little python script to control it, and then on top of that add some computer vision stuff to write some autonomous code. I think I'll be working this up to a cat play-thing. We are planning on getting a cat next year and this way it'll have something to play with. It seems like a pretty formidable task, but we'll see what I can do on it.
So far, just playing around with it from the web interface it's been working pretty well. Battery life leaves something to be desired, but it seems as though the battery is becoming conditioned and it's getting better. Also, when you tell it move it doesn't always move exactly where you expect it to. (In fact I've heard this from other sources that use this platform too.) But hopefully the computer vision stuff can take care of that issue.
The API for the Rovio is all CGI commands found here. It's a pretty nasty specification without many details, but I think I'll be able to work it out.
I guess now is a good time to now that there has been some work already done on a python API for the Rovio at University of Buffalo by Jonathan Bona and Michael Prentice. (Link) The code can be found on github here. The reason I'm not using any of that code is 1) it really only is the API layer and it won't take me too long to write that myself / it will help me learn and 2) it's under a license I find a little restrictive. So I'll do it on my own. (Some say I say that too much ;))
Today I began by checking out how to grab the webcam stream. This turned out to be much harder than I would have expected. In fact, after a few hours I've all but given up. It seems the only way to grab the stream is through an ActiveX control provided by WowWee. However, I can't even seem to find the file. I tried going through the rtsp interface the API specified, but with mplayer and kaffeine it failed. I ought to try VLC, but I don't have it installed right now.
So after my fail at retrieving the stream I decided to see how fast I could poll the Rovio to grab images. The API provides a facility to retrieve one image at a time (http://
So, likely 15 fps will be more than enough. I imagine any computer vision algorithms I apply to the images take much longer than 1/15 seconds, so I think the polling method will work fine. Another reason polling is good is that I can run the poll at whatever rate is necessary at the time, including varying the rate depending on the circumstances (though I don't really know what good that will do me).
PS: The code for this project can be found on googlecode at http://code.google.com/p/roviopy/
12:36 PM
Jason
, Posted in

0 Response to "Starting the roviopy project"
Post a Comment