rwldrn/johnny-five — pull request #63 by haugstrup (2012-08-26 02:38:36+00:00)
Title: Add Rover constructor. Refs #62

First attempt at a rover constructor. As you can see I based it very heavily on the navigator example, but I did decide to make some decisions I'm unsure of how well will go over :)

The aliases for movement methods (e.g. `fwd` and `rev`) are gone because I felt they cluttered the code without providing a ton of benefit. At the same time I went away with the dynamically generated methods for two reasons:

* It makes the code much easier to comprehend on the first read through (very important to me)
* I could get rid of the directionMap object literal which made it hard for me to read and understand the code

Instead there are two methods `go` (forward, reverse movement) and `pivot` (left right pivoting) which handle movement and four convenience methods (`forward`, `reverse`, `left`, `right`) which just calls either `go` or `pivot`.

In the same go I'm using `pivot` for what the Navigator example called turning because I feel moving tracks in opposite directions are more appropriately called pivoting while turning only one track at a time should be called turning. I haven't implemented what the Navigator example called pivoting yet.