View Single Post
  #6   Spotlight this post!  
Unread 17-02-2015, 18:54
JacobD's Avatar
JacobD JacobD is offline
Registered User
AKA: Jacob
FRC #1672 (Mahwah Robo T-Birds)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2013
Location: New Jersey
Posts: 90
JacobD is an unknown quantity at this point
Re: Acceleration Curve java help

Quote:
Originally Posted by Ether View Post
You might also caution that your suggestion maps the domain -1..+1 to the range 0.769..1.3


Yeah, I wasn't thinking. I fixed that. Also, the domain is [0,1] because you cannot have a negative magnitude. But, that assumes that he is using mecanum drive. If not, another solution will be needed.

Code:
Joystick stick1, stick2;
double stick1val,stick2val;

stick1val = Math.pow(stick1.getX(),3);
stick2val = Math.pow(stick2.getY(),3);

chassis.tankDrive(stick1val, stick2val);
That would let you take input with a domain of [-1,1] and use it with tank drive.

Last edited by JacobD : 17-02-2015 at 19:16.
Reply With Quote