View Single Post
  #13   Spotlight this post!  
Unread 26-02-2014, 14:32
JohnGilb JohnGilb is offline
Programming Mentor, Drive Mentor
FRC #0488
 
Join Date: Mar 2011
Rookie Year: 2003
Location: Redmond, WA
Posts: 116
JohnGilb has a spectacular aura aboutJohnGilb has a spectacular aura aboutJohnGilb has a spectacular aura about
Re: faster field-centric mecanum drive

inkling16, this is very possible. Your idea is a good one - and the fact that you're listening to your drive team and trying to help them control the robot "the way they want it" is even better.

Your post was a little unclear - it's hard to tell if you are asking:
-Is this idea new and unique?
or
-How do I do this?

As far as new and unique, not especially, though I don't think it's very common. Our team did something pretty similar, and at one point we had it coded up. Unlike your drive team, ours didn't like it very much, so we reverted to our earlier form. To each their own.

As far as the how:
You'll need to determine three inputs to drive the robot.
Translation intent: - probably from X/Y axes of a "Translation" joystick
Rotation intent: - probably from X axis (of another joystick) or Twist axis (in a 1-joystick setup)
Translation directional intent: do some trig on the X/Y axes of the Translation joystick in order to figure out in what direction the driver is trying to go.

Compare the translation directional intent to your current heading (you already have a gyro or something like it, since you're using field-oriented drive). Use the difference between them (the "error") and determine a rotational input from that (either by using PID or just multiplying by some constant).

When it comes time to actually use the Mecanum code - plug in your translation values as usual, but for rotation:
-If you're being given an explicit rotation intent from the human operator, use that.
-If the human operator rotation intent is below some threshold (maybe 0.1), use your other calculated rotational input.