tokyorails/rrroomba — pull request #8 by JordiPolo (2013-03-10 08:02:03+00:00)
Title: refactoring into low level driver

The idea is that those interfaces (roomba, position2d, sensors) do not have any logic inside. The only thing they do is transforming data from one format to another or deal with delays and stuff like that.
You can even make all these classes only one class driver if you prefer.

You may notice that once all this is moved (and the schedule and play and song needs still to be moved) then Roomba does not need to include the Api but it will go to the driver and it does not need to have a serial itself either.

So you may think it will all move to the driver and makes no sense. The only things I think will be saved is the move method because it uses a combination of position and sensors to do something intelligent and the demo1 , motors because also it is much more than just transforming data.

The good part is that roomba class then should be pristine and ready to get new methods with lots of intelligence into them.

Also the simulation would get much more simpler and general as we will not simulate at the binary protocol level but at the level of methods like drive so we can ignore lots of details and do a more generic job.