Page 1 of 1

Hacking the Wii Controller for Roomba Navigation

Posted: January 30th, 2008, 9:58 pm
by cadcoke4
This was mentioned in another thread, but I felt it was best to start a new one. The Wii Remote is often called the WiiMote

I am not persuing this concept, and don't have a Wii, but did a bit of research on the Internet.

Here is a good source for technical info on the Wii Contoller, including the communications signal;
http://www.wiili.org/index.php/Wiimote

Here is a summary of some info I found;

Communications are via Bluetooth using HID standard.

The camera has a 45 Degree field of view, and according to the Procrastineering blog "The wii remote contains a 1024x768 camera with built-in hardware for IR blob tracking of upto 4 points at 100Hz. This significantly outperforms any $40 webcam I'm aware of. It'll work with a webcam, just not as well and not as easily."
http://procrastineering.blogspot.com/

A maganged API for the Wii via C# or Visual Basic.
http://blogs.msdn.com/coding4fun/archiv ... 79033.aspx

Posted: January 30th, 2008, 10:16 pm
by cadcoke4
Regarding using the WiiMote for Roomba Navigation, I imagine there are three possibilities.

#1- Use the WiiMote at a stationary base, and put IR led's on the Roomba. Then remote control the Roomba from a computer.

#2- Put the WiMote on the Roomba, and the IR led's on the wall or base or even on the ceiling. The Roomba would have to spin in place to scan for the dots to determine its location.

#3- WiiMote on the Roomba (like #2) but project IR spots onto the ceiling like in the NorthStar system. The Wimote must be aimed up.

I like #3, because this allows for a lot of mobility of the Roomba while still maintaining the WiiMote navigation ability. In fact, it may be that the WiMote can act as the wireless interface for the Roomba. The buttons can be activated to indicate bumper hits. The WiiMote has provision to receive data, so it should be possible to interpret this data and send it to the Roomba serial control port by using another processor as an intermediary. The drawback is that the WiiMote's Bluetooth does not have as much range as I would like. It has only 30' open air range (vs. the 100' Bluetooth can potentially do).

Note that the WiiMote has an expansion port. I don't know how much can be done with it, but it is an obvious interface to use.

Another issue is the possibility of coding the IR sources so they can be uniquely identified. I don't think they currently are coded as the Wii uses them. But it may be possible to add this feature by blinking the IR source in some way. I don't know how quickly the WiiMote would respond. If it can't detect the IR, it won't send the position information. But, perhaps this lack of signal could be considered the binary code for "0".

The reason I feel this coding is important is that you can put more than one IR source in a single room to make it easier for the Roomba to see at least one source. Then, of course, it is needed for navigating to different rooms.

Posted: January 31st, 2008, 3:03 am
by Rello
I was looking at the API in detail yesterday and the output of the IRState sounds interesting:

X1/Y1 ... X4/Y4 - Normalized data from 0.0 - 1.0 on each axis

AND:
Size1/2/3/4 - Size of the dot seen by the Wiimote (only valid in IRAccel mode)

this might be interesting as it might be able to use this for "coding" as the sizes can be compared to each other.

It might be complicated to put up a theoretical idea but by using a certain combination of small and bigger dots over the ceiling it might be able to position itself in the room

but the problem is the 45% view angle. when driving in a room with a 250cm ceiling height, this should give a view area of around 2m in diameter (if i did not calculate wrong).
so the sensor can covere more or less 4 sqare meters. so you can calculate how many coded sensors might be required for a 15sqm room

Posted: January 31st, 2008, 5:14 am
by debugger
Rello wrote: but the problem is the 45% view angle. when driving in a room with a 250cm ceiling height, this should give a view area of around 2m in diameter (if i did not calculate wrong).
so the sensor can covere more or less 4 sqare meters. so you can calculate how many coded sensors might be required for a 15sqm room
I think exact location is not that critical - if you can pinpoint it at some point in the room then you can guestimate where you are from how much distance you have covered and in which direction and just use the IR to confirm or correct any drift periodically.

Posted: January 31st, 2008, 9:14 am
by cadcoke4
The Roomba with a WiiMote is going to loose site of its IR targes on a regular basis since it goes under furniture. But, as you already mention, we just need to see the IR targets to occasionally correct for odometer drift.

One way increase the coverage area we can use 2 WiiMotes.

Another way would be to increase the view angle of its camera by changing the lens.

Finally, aiming the camera at a shiney curved surface, like a ball bearing. Then the reflected view would be much wider. Of course, that makes the calculation more difficult, but I've seen papers written on the subject at uninversity robot departments. This approach would also reduce the accuracy because we are asking the same number of pixels to see a larger area.

I suspect it might be better to go for accuracy, since we can already estimate the position using odometry. Perhaps a good compromise is to use the two WiiMotes, with one aiming up with a wide field of view, and the other unmodified, and perhaps aiming somewhat forward so it can be used to see targets lower down, such as the charging base.

By the way, I've been unemployed since Dec 7, so that is the reason I am posting so much ... looking for something to do and of course something PAID. If anyone knows of a postion for a CAD design expert (AutoCAD, Solidworks, some Pro-Engineer) who has a portion of a B.S. in Electro-Mechanical Enginnering)