Friday, November 30, 2007

Experts miss target on storm numbers

Every year, about June-time, you here the media outlets regurgitating some press release put out by some government/academic body (usually the NOAA) about the upcoming hurricane season. It's typically got some eye-grabbing headlines predicting something close to Armageddon. Once you've lived past the age of about 25, and if you've been paying attention, the question starts to creep into your mind as to how accurate have these people been over the years, especially since you have yet to see Armageddon despite 25+ years of expecting it.

So each year, you see the same story in the media (which is what passes for news) and start to think that responsible journalism would require publishing the record of the people making the predictions. Yet all that is ever included in these articles are the fear-mongering predictions, nothing about the past accuracy of these agencies making the predictions, which seems like the most logical thing that should be included.

So it was quite the surprise for me to see the CNN article that appeared today that seemed to actually revisit the predictions, especially because they were stating just how wrong they had been: not even in the ballpark. I've been paying attention to this for many years, and this is the first instance where I have seen any main-stream media outlet make any attempt to revisit the predictions, so it was a pleasant surprise.

I suspect that, come June, CNN will still run the same annual article on the NOAA press-release. I'd like to hope they mention just how wildly wrong they were in 2007 when they report their 2008 predictions, but my experience tells me not to get my hopes up.

Thursday, November 29, 2007

CNN Atrocities

I have, and I will continue to rant about CNN's treatment of news and/or journalism. I read the CNN home page mainly to ensure I do not miss 'mainstream media', since I tend to be forced to interact with people whose entire view of the world is derived from such sources.

Still, even in this context, the ineptitude of this "news source" drives me to a semi-uncontrollable need to rant about its coverage. Therefore, if you think I should stop reading CNN's headlines if I don't like them, you should understand that I really have no choice: society is forcing me to stay "informed".

My favorite "CNN Atrocity":


One morning, maybe 9 or 10am EST a few month ago, in the top stories list of headlines was something very close to the effect:

    Ford recalls 500,000 vehicles

Interesting. A bit of a black eye for Ford I thought. An hour later, in the same position in their "top headlines", I see the two part headline to the effect:

    Ford offers big rebates | Recall

Are you kidding me? Ford offering rebates is a "top story"? That's a commercial, not a news story. Yet CNN decided that this is more important that 1/2 millions vehicles being recalled, or in reality, used this as a sorry excuse to bury the recall story.

Is there anyone out there that doesn't think that someone at Ford called someone at CNN to get this headlines changed? If so, please refrain from contacting me: you clearly need more experience in the world before having an opinion on such matters.

I even suspect that someone at CNN thought they were maintaining some form of journalistic integrity by still including the link to the recall story in the second part of that line. All the while, someone at Ford is smiling with how clever they were in turning a negative news article into a free advertisement platform.

Your computer may be part of criminal network

The title of this post is the same as the CNN title of what appears to be the 6th most important thing happening in the world (or maybe just the US) at 10pm EST tonight. Essentially, they took a non-news story and cleverly crafted it to the most inflammatory, eye-catching headline they could.

The fact that millions of personal computers serve as a bots in these spam bot networks is a known fact and this situation has existed for many, many years. This is not news to anyone that knows of such things, and is very, very late news for anyone that does not. Still, because someone, somewhere, issued a press release that was news to the generally technically-naive CNN reporter(s)/editor(s), this was clearly something they needed to report as "breaking news". Then someone at CNN decides to do it in a way that would have the highest emotional impact among people that were just as naive about such things (since all great journalism tries to cater to the lowest common denominator). If I were the unscrupulous editor-in-charge, I would have boiled down the headline to say:

"Your computer is a criminal!"

Maybe this might be a little too obvious that we were depending on the shock factor to lure readers in, so maybe the editors made the right choice in their toned-down headline. Then again, just removing the exclamation point might be enough to turn that 'National Enquirer' headline, into being CNN-worthy.

Just another example of how rare good journalism is in this day and age. It seems two types of people dominate in today's media: the naive lower-level journalists and the corrupt editors that are in someone's pocket. That's a very, very bad combination.

Thursday, November 22, 2007

The Making of Sparky II - Preparing the Brain


See Part I if you want to read the preceding article. Lots of progress made recently, and the picture shows the current look of Sparky.

Though the Roomba has an on-board processor, to use as the main 'brain' for a roomba-based autonomous robot requires a lot of contortions. The iRobot folks provide a nice API, and underlying control algorithms that run on this processor, but do not provide any direct way to download arbitrary software to it. The best way to use the roomba is to allow its processor to do the low-level motor/sensor control, and add a 'brain' to it.

Even a small form-factor computer is too much weight for the roomba, and often too much of a power hog. The best thing to use is a device made for low-power, small form-factor, embedded situations. It turns out that a typical Linksys wireless AP/router is an ideal device to use for this. It can be made to run GNU/Linux, has built in wired and wireless ethernet, a built in switch, and through the SDK of the OpenWRT project, a semi-easy way to develop custom code.

The Linksys WRTSL54GS model also has a USB hub, and extra flash memory, which makes it a little more expensive than the generic WRT54G routers, but worth it for this application.

Installing GNU/Linux on the Linksys routers is pretty simple and safe IF you do not get too adventurous. You download the image from OpenWRT, go to ther Linksys admin page on the routers web pages, choose to install new firmware, and that's it.

The pitfalls to avoid that resulted in two 'bricked' routers for me:
  • even when the software reports that the firmware is upgraded and ready, do not believe it: don't reboot the thing or otherwise look the wrong way at it if it still has flashing lights;
  • do not use the 2.6 Linux kernel;
  • avoid building your own kernel/image unless you absolutely need it.
I am not sure exactly which ones of these was the cause of my failures, but by avoiding these, you can save yourself some money. Keep in mind, every one of these I did successfully more than one time before I hosed up the router, so these are things that can safely be done, but something in this space of things also caused the problems.

There are a number of ways to salvage a 'bricked' router. I tried them all, multiple times, with no success (including some very tricky soldering for the last-resort JTAG method).

My final call was to use the newer Kamikaze openwrt build, but with the 2.4 kernel. That runs fine and has the right module for operation of the webcam that will serve as the robot's eye(s).
Instead of trying to make a custom image, I just use the SDK to cross-compile any software that is not already available that I need.

Friday, November 16, 2007

Barry Bonds Indictment

Bary Bonds is probably not the sort of person I would like if I knew him. He might even be a big jerk, though probably not as big a one as the media makes him out to be. However, the whole case against him reeks of someone powerful with friends and influence deliberately singling him out for for their own personal reasons. Either they're ticked off because they personally do not like him, or else they want to make an example of him to help boost their position, or cover up just how bad a job they do in their position. It's a politically-based witch hunt. Who might be abusing their power this way? Bud Selig? He may or may not be the main protagonist in this, but he's certainly fully on-board with this sordid game. The case against Bonds will serve as a nice diversion for how asleep at the wheel MLB has been, or rather, how much they've be culpable in the whole steroid mess.

Thursday, November 1, 2007

The Making of Sparky I - Preparing the Roomba

First in a series of posts about how Milestone #1 of creating the autonomous robot "Sparky ". This post deals with the basics of using the Roomba as the platform for moving around.

Modern Roomba vacuums come already capable of being controlled through a serial interface, using a well documented API of commands via a 7-pin DIN connector on their sides hidden by a covering piece of plastic though. Prior to this modern era, there was a "near" modern era that had the 7-pin connectors and all other the other hardware setup to make it controllable. However, its software did not support this. I happened to have one of these.

Luckily though, the iRobot folks provided a software updater for it called the OSMO Hacker. It costs $30, and there are two versions which adds a little thrill to purchasing it. One needs to decipher serial numbers to determine which is needed. Fortunately, I got it right.

Once delivered, it was relatively (though not completely) obvious how to use it: plug it in, turn on the roomba, watch light blick, wait for light to stop blinking, restart.

Now, since it is all flashing lights and invisible software, who really knows what was happening or if it worked. First test is to make sure the Roomba itself still operated, which was a relief when I found out that I did not just create a $300 paperweight. Next up is to hook up a computer's serial interface to the Roomba to see if it accepts and responds to API commands. Here's where the fun begins.

Being a hardware novice, the book Hacking Roomba was a very good crutch and how-to manual on the basics. In the book, the author shows a number of ways to do this, which basically comes down to a build vs. buy decision. I opted for 'buy' at this point, wanting to worry more about the software, though many things would conspire to have to build anyway. Given I was a soldering klutz, Iwanted to ensure my software upgrade worked without having to worry about failure being caused by my soldering. I'm much, much better at soldering now btw.


Simplest solution was to buy the 'RooStick', which I got from Sparkfun Electronics.
$30 seemed a little expensive, but figured the time it saved me would be worth it. When it actually arrived, the size of it (puny) certainly made me wonder about its price tag again. This thingy's job is to convert a computer USB port into a serial port specifically for talking to a roomba. This is no small trick because of two important things:
  • the Roomba has this funky, non-standard 7-pin DIN connector; and
  • the Roomba's serial port operates at +5 Volts (the RS232 spec is a +12V serial port).
And if $30 seemed a little steep for this, wait because we are not done yet: one needs a non-standard cable to hook up the RooStick to the Roomba (actually an 8-pin DIN cable, which happens to fit into the 7-ping female connectors).

With (pricey) hardware in hand, onto hooking it up and seeing if we can control the Roomba. This was successful, both from my Mac Powerbook (OS X 10.3) and my GNU/Linux (Ubuntu 7.04) laptops. Below are details on getting this to work on each platform. While the excitement of being able to control the roomba for the first time was great, it was also severely constraint by a 6 ft. cable. Still this was a major mini-milestone, proving that a Roomba can indeed be used as my robot platform.


RooStick on GNU/Linux (Ubuntu 7.04)

Plugged in RooStick to USB port, and dmesg reads:

[86202.740000] usbcore: registered new interface driver usbserial


[86202.744000] drivers/usb/serial/usb-serial.c: USB Serial support registered for generic

[86202.744000] usbcore: registered new interface driver usbserial_generic

[86202.744000] drivers/usb/serial/usb-serial.c: USB Serial Driver core

[86202.784000] drivers/usb/serial/usb-serial.c: USB Serial support registered for cp2101

[86202.788000] cp2101 1-2:1.0: cp2101 converter detected

So it was automatically detected, and driver installed. Nice.

In an xterm, set device setting with:

stty -F /dev/ttyUSB0 57600 raw -parenb -parodd cs8 -hupcl -cstopb clocal

And test commands to drive (though need to pick it up to stop it due to cable length):

printf "\x80" > /dev/ttyUSB0
printf "\x82" > /dev/ttyUSB0
printf "\x89\x00\xc8\x80\x00" > /dev/ttyUSB0

Worked, but I had to send the last line a few times before it seemed to take. Maybe the sequence got messed up and it took a while to coordinate what the first byte was.


Roostick on Mac OSX 10.3

First needed to download and install the USB driver:

https://www.mysilabs.com/public/documents/software_doc/drivers/Microcontrollers/Interface/en/Mac_OSX_VCP_Driver.zip

Needed to restart the machine. I hate that.

Device now shows up as:

/dev/cu.SLAB_USBtoUART
/dev/tty.SLAB_USBtoUART

Next, needed to get and unzip RoombaComm java library from Hacking Roomba site.

After downloading and unzipping, I needed to initialize something with respect to the rxtxlib that java code calls out to.

% ./rxtxlib/macosx_setup.command

Also needed to restart after this. Yuck again.

Power on manually roomba, then run this:

% sh runit.sh roombacomm.SimpleTest /dev/cu.SLAB_USBtoUART

And it worked.