View Full Version : Error in mecanumDrive_Polar of WPILIBJ
We determined that the mecanum drive function has an error. Specifically the line
double sinD = Math.cos(dirInRad);
should be
double sinD = Math.sin(dirInRad);
Can someone provide information on how to get this fixed in the WPILIBJ library.
Thanks!
Patrick Chiang
18-01-2011, 22:07
What we do when this kind of thing happens is just copy the entire FRC supplied class into our package and correct the part that seems wrong. And use the one in our package instead of the one in wpilib.
bakketti
21-01-2011, 00:03
Good catch! This explains why mecanumDrive_Polar() isn't working. Thanks.
derekwhite
21-01-2011, 09:30
I added this as a bug at http://firstforge.wpi.edu/sf/go/projects.wpilib/tracker.wpilib_java_bugs as artf1315.
Does the problem exist in mecanumDrive_Cartesian too? We're seeing similar problems.
This is what we're doing:
drive.mecanumDrive_Cartesian(lstick.getX(), lstick.getY(), rstick.getX(), gyro.getAngle());
bakketti
22-01-2011, 12:34
Does the problem exist in mecanumDrive_Cartesian too? We're seeing similar problems.
This is what we're doing:
drive.mecanumDrive_Cartesian(lstick.getX(), lstick.getY(), rstick.getX(), gyro.getAngle());
I have experienced problems with mecanumDrive_Cartesian too. It actually works when I put a fixed 0 degrees or 180 degress in the angle input. However, other values have not worked for me (from what I remember). I have spent some time trying to figure out the problem. No luck yet. But rotateVector() in RobotDrive is okay. Our team got field relative driving running by using rotateVector() to manually transform coordinates.
7519534682
22-01-2011, 18:41
Is there any way to get a working mecanum drive until mecanumDrive_Polar() is fixed?
Thanks
Is there any way to get a working mecanum drive until mecanumDrive_Polar() is fixed?
Thanks
You could write your own. It's not that hard. Here's (http://www.chiefdelphi.com/media/papers/download/2896) some help.
MattG_3165
22-01-2011, 19:35
Is there any way to get a working mecanum drive until mecanumDrive_Polar() is fixed?
Thanks
There sure is, Patrick explained how in post #2:
What we do when this kind of thing happens is just copy the entire FRC supplied class into our package and correct the part that seems wrong. And use the one in our package instead of the one in wpilib.
Robototes2412
24-01-2011, 11:46
attatched should be enough to be a better mecanum drive with no black box
http://www.chiefdelphi.com/forums/attachment.php?attachmentid=9749&d=1295551765
BradAMiller
27-01-2011, 15:11
We determined that the mecanum drive function has an error. Specifically the line
double sinD = Math.cos(dirInRad);
should be
double sinD = Math.sin(dirInRad);
Can someone provide information on how to get this fixed in the WPILIBJ library.
Thanks!
You just did get it fixed. Will be in the next release. Thanks for the patch!
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.