View Single Post
  #29   Spotlight this post!  
Unread 20-05-2011, 17:33
mwtidd's Avatar
mwtidd mwtidd is offline
Registered User
AKA: mike
FRC #0319 (Big Bad Bob)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2003
Location: Boston, MA
Posts: 714
mwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond repute
Re: How to go about making tankDrive and ArcadeDrive methods

Quote:
Originally Posted by Ether View Post
See Joe's post.



The joystick makes a square, not a circle. The algorithms mentioned here map every point in the square to a set of left/right motor outputs.




You don't need trig to do this.




FR = -Y -X -Z

FL = -Y +X +Z

RR = -Y +X -Z

RL = -Y -X +Z

How does trig make the above any easier ?




How does using trigonometry make the above mec code any "cleaner", or "more efficient"? The above code is kinematically correct, even after normalization.


thanks for the feedback.

I guess if you approach the js as a square, you are def right. I personally always approach the joystick as a circle as the points you can get on a joystick can be easily mapped to either a circle or a square.

The way you solve the grid seems to be a case statement. Personally I would rather have one equation that gets the value based on heading and magnitude.

Again your algorithm certainly solves the problem well and I do not believe it would have any dead spots. But i guess we approach the joystick from 2 different views: a square vs a circle. I believe both approaches to be correct.

approaching it as a square requires normalization where as approaching it as a circle does not (unless we start looking at mecanum where factoring in rotation requires normalization )
__________________
"Never let your schooling interfere with your education" -Mark Twain
Reply With Quote