Page 208 - Hacking Roomba
P. 208

Using Roomba as                                                 chapter



                   an Input Device







                          he Roomba’s sensors are designed to sense the world in very particu-
                          lar ways. Unlike our own “sensors” which have a wide sensing range
                     Tand can be adapted for a variety of tasks, each of the Roomba’s sen-
                     sors are extremely limited. The limitation is partly due to cost reasons (this
                     is a price-sensitive consumer device after all) and partly because creating
                     high dynamic range durable sensors is hard. Current electronic vision sen-  in this chapter
                     sors are low-resolution and require an enormous amount of space and com-
                     putation when compared to even simple organic eyes. There has yet to be    Alternative uses for
                     invented a touch sensor that responds as accurately and complexly as skin.  Roomba sensors
                     For now robots must make do with simple sensors that detect only a small
                     bit of their environment. Such sensors are custom designed for a particular    Use Roomba as a
                     task and aren’t meant for any other. But that doesn’t mean you can’t co-opt  mouse
                     the sensors and make them do more.
                     The Roomba can act as a general-purpose input device. The sensors it nor-    Make a theremin
                     mally uses to avoid obstacles and know its world can be turned upside   with Roomba
                     down (literally as you’ll see) and made to work as a multi-dimensional input
                     device for whatever you can dream up. This chapter presents a few different    Turn Roomba into
                     examples of how to use the Roomba’s inputs in ways its designers never  an alarm clock
                     imagined.


                     Ways to Use the Roomba’s Sensors

                     As discussed in Chapter 7, Roomba has two different classes of sensors:
                     internal and external. The internal sensors provide data about the internal
                     Roomba state: how far it has gone, how much it has rotated, battery charge
                     and drain, and so on. Another factor to consider is the sensor resolution.
                     Most sensors are a single binary value: on or off, cliff detected or not, button
                     pressed or not. A few Roomba sensors have greater resolution than one bit.
                     It turns out that all the sensors with greater resolution than a single bit,
                     except one (the dirt sensor), are internal sensors. Roomba needs accurate
                     internal knowledge about its power system, so that makes sense. For the
                     external sensors, it’s usually easier to design a sensor for the physical world
                     that unambiguously detects if a quantity is above or below a predefined
                     value than it is to measure that quantity precisely.
   203   204   205   206   207   208   209   210   211   212   213