Add Rover constructor #63

Closed
wants to merge 1 commit into
from

Projects

None yet

3 participants

@haugstrup

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.

@rwaldron
Owner

I very specifically made the aliases to reduce typing when controlling from REPL. I'm headed to New York tomorrow so I won't be able to try this out until Monday

@haugstrup

That makes sense. And no worries, I figure this will take some rounds to get right anyway.

@rwaldron
Owner

Cool, glad you're up for smoothing it all out. Looking forward to digging into this on Monday :)

@rwaldron
Owner

I promise I haven't forgotten about this, nor am I ignoring it ;)

I've been moving from Boston to Brooklyn since last week and all of my stuff is still at Bocoup

@haugstrup

I know, no worries. I'm almost done building something else while I wait for your comments. Real life got in the way of robots for me also.

@rwaldron
Owner

Finally have everything unpacked so I'll be able to dig in soon!!

@haugstrup

Sounds great. I'm been burried in work the past month. Had my arduino out last night for the first time in forever (to see if I could run the 7-segment example) so I'm also ready to make any changes you want. :)

@divanvisagie
Collaborator

when you say rover do you mean this? http://www.pololu.com/catalog/product/1551/specs

@rwaldron
Owner

@divanvisagie I think this was meant for a two-wheeled bot that was driven with opposing continuous servos.

@divanvisagie
Collaborator

@rwaldron This PR is a year old now with no resolve. I think it would be nice to get it off the issue list. Feelings?

@rwaldron
Owner

Let's close for now

@haugstrup you should publish this a module on npm :)

@rwaldron rwaldron closed this Dec 21, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment