Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Error in mecanumDrive_Polar of WPILIBJ (http://www.chiefdelphi.com/forums/showthread.php?t=89525)

85450 01-18-2011 09:32 PM

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 01-18-2011 10:07 PM

Re: Error in mecanumDrive_Polar of WPILIBJ
 
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 01-21-2011 12:03 AM

Re: Error in mecanumDrive_Polar of WPILIBJ
 
Good catch! This explains why mecanumDrive_Polar() isn't working. Thanks.

derekwhite 01-21-2011 09:30 AM

Re: Error in mecanumDrive_Polar of WPILIBJ
 
I added this as a bug at http://firstforge.wpi.edu/sf/go/proj...ilib_java_bugs as artf1315.

sfletty 01-22-2011 11:52 AM

Re: Error in mecanumDrive_Polar of WPILIBJ
 
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 01-22-2011 12:34 PM

Re: Error in mecanumDrive_Polar of WPILIBJ
 
Quote:

Originally Posted by sfletty (Post 1005737)
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 01-22-2011 06:41 PM

Re: Error in mecanumDrive_Polar of WPILIBJ
 
Is there any way to get a working mecanum drive until mecanumDrive_Polar() is fixed?
Thanks

Ether 01-22-2011 06:45 PM

Re: Error in mecanumDrive_Polar of WPILIBJ
 
Quote:

Originally Posted by 7519534682 (Post 1005876)
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 some help.



MattG_3165 01-22-2011 07:35 PM

Re: Error in mecanumDrive_Polar of WPILIBJ
 
Quote:

Originally Posted by 7519534682 (Post 1005876)
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:

Quote:

Originally Posted by Patrick Chiang (Post 1003174)
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 01-24-2011 11:46 AM

Re: Error in mecanumDrive_Polar of WPILIBJ
 
attatched should be enough to be a better mecanum drive with no black box

http://www.chiefdelphi.com/forums/at...9&d=1295551765

BradAMiller 01-27-2011 03:11 PM

Re: Error in mecanumDrive_Polar of WPILIBJ
 
Quote:

Originally Posted by 85450 (Post 1003144)
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!


All times are GMT -5. The time now is 08:29 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi