Sunday, July 22, 2012

Yesterday, I went into a thrift shop, and found not one, but twoRoboSapiens in great condition, with a remote. Both were marked as $14.99, but they let me have one for $9.99, since there was only one remote.

$25! Not one, but twoRobosapiens for $25! They normally go for $100 each! (YMMV)

Where did I find such a steal? Oh yeah, riiiight. like I'm going to reveal my sources on a public blog -- especially with a find like that.

Sunday, July 15, 2012

I make robots. Well, I do a lot of things, but one of the things I do is make robots. One of my main projects over the past few years has been Housebot. Housebot's stated purpose in life is a very challenging technical and engineering problem, which, if you look around on the youtubes, you will see many attempts at solving -- some attempts failing much more spectacularly than others. What's this challenge?

Go to the fridge. Get me a beer. Bring it back.

Extra credit: open it for me.

Now, you're smirking. I see you there. Ha, he wants a machine to go get him a beer. Lazy.

But think about it. There's many things that the robot (or, any machine) will have to do in order to complete this task. Here's a quick rundown, and then I'll show some pictures.

1. First, the robot has to know I want a beer. Otherwise, it just continually just brings me beers. While cool, I do have to go to work tomorrow. Many ways to solve this. Easy is press a button, harder is voice recognition ("Computer! <fleebp> Go make me a sammich!"), harder yet is using artificial intelligence of some sort.

2. Next up is figuring out where the fridge is. This is usually accomplished by what is called SLAM (Simultaneous Localization and Mapping) -- also not an easy problem, and, in fact, one we as an industry have not satisfactorily solved yet. It involves questions about whether the machine has a priori knowledge about its locale, or if it discovers it as it goes, how signal noise from the sensors is dealt with, and many other problems. Some of the best minds on the planet have been tackling this problem, as evidenced in the DARPA Grand Challenge.

3. Next up is getting to the fridge -- preferably without destroying any of the furniture along the way. This involves determining the robot's pose relative to its known world, determining features in the landscape that it can use as waypoint markers/beacons, and then correctly moving relative to those markers in order to navigate to the fridge. It also involves artificial intelligence at this point, in that you have to do planning of some sort to determine the path to take - the likely solution to this is the A* algorithm, but there are others, such as binary searches, or ACO (Ant Colony Optimization)

So, wow. Now we're at the fridge. And we've done a lot of work to get there, and there were many pitfalls, and many technical and engineering challenges. At this point, we're not even halfway done. We need to open the fridge (actuators, robotic arms, motor control, and all sorts of related things are needed here), recognize a beer (vision systems and pattern recognition here), get the beer (more actuator control here), close the fridge, and return (repeat steps 1-3, above, in order to return to the couch).

So, yeah, at this point I've already gotten my own damn beer.

But, it brings us to Housebot's second mission: be a configurable robotics experimentation platform, capable of modular expansion, and hackability. So, without further ado, I'll let Housebot introduce herself:

So, I'm sure you're asking, why wood? Well, wood as a construction material is cheap, and readily available. All of those pieces were bought at the Home Depot in Alameda, CA, which was right down the road for me. Wood is easily workable, and, if you screw it up, you just chuck it in the fireplace, no big deal. Also Housebot makes a nice end table when not in use, which was pretty useful in my cramped San Francisco area apartment.

So how's it work?

Basically, there's a USB cable sticking out of it, and you plug a brain into it. There used to be a built-in computer below decks, but I found it was much more useful (and versatile) to be able to plug in any sort of device, such as a laptop, a Beagleboard, or, even, if you're trying to figure something out and need a bit more horsepower, your desktop (if you actually still have a Grandpa Box, that is) Also, since practically everything inside of Housebot is arduino or netduino based, it can actually do a lot of things on its own, without any sort of a computer involved, and just using its microcontrollers. Generally, though, I have a laptop that is more or less dedicated to Housebot. It dual boots Windows 7 and Ubuntu, but I mainly use Win7 for my development work with it. Since the laptop is actually an old tablet computer, I will likely spend the $40 and upgrade to Windows 8 when it comes out, which should open up some interesting ways for Housebot to interact with her world.

So let me wrap this up with a couple pictures!

Here's Housebot from the front. From the top, we have the Kinect on the turret, then below that on the front panel, there are three Sharp long distance infrared distance sensors (two on the corners, one left middle), one Maxbotix sonar sensor, a motion detector from Radio Shack, and a couple of switches and LEDs. The reddish switch is the emergency kill switch, which drops power to all motors. This has proven to be very important -- Housebot is very strong. I take Porsche's approach to this -- there's no such thing as "too much horsepower". This has proven dangerous at times, and the kill switch is necessary. The LEDs, the black pushbutton switch, and the gauge in the middle are all programmatically controllable, i.e., their function (if any) is defined by the program currently running.

This is the drive motor for the turret. It's a windshield wiper motor out of a Chevy S-10 pickup, driven by an Arduino and a 10 amp capable H Bridge. The motor has a worm drive in it with tons of torque -- it's physically stronger than I am. I can't stop the motor when it's running.

This is the drive train. It's pretty simple -- it's a kit from parallax. The kit has some low resolution encoders on it -- 16 per revolution, if I remember -- which means I can't turn a single degree. My lowest resolution/the smallest turn I can make is about 11 degrees. This turns out to be basically OK -- I can hit all the points on the compass rose, and for sub-encoder-resolution turning, I can always use timing (i.e., short bursts of PWM activity to the motors) and the AHRS to tell me where I am pointing. It hasn't turned out to be necessary, though -- 11 degrees is quite sufficient.

And here's the guts! It's scary in there! Believe it or not, underneath that snake nest, there are three Arduino boards (including an Arduino Mega), a Netduino, and a Robotics Connection Serializer (now sold by cmrobot.com as the Element - a very capable board in my opinion)

I hope you enjoyed my introduction of Housebot!

As a footnote, there is one highly successful robot which has solved the Go Get Me A Beer problem: a fascinating robotics platform from Willow Garage, called the PR2. Here's a film of it in action.

Unfortunately, they have a larger budget than I do; last I understood, a PR2 went for about $400,000 USD.