View Single Post
  #3   Spotlight this post!  
Unread 26-02-2015, 08:56
FlyOldPlanes FlyOldPlanes is offline
Registered User
FRC #1592
 
Join Date: Feb 2015
Location: Titusville, FL
Posts: 6
FlyOldPlanes is an unknown quantity at this point
Re: Gyro's angle value going up

If you want to null out a small rate like that, you can use the setDeadband method in the Gyro class. we were a little confused since it shows up in the c++ version of the code, but not the java version. Look at the gyro.java code posted here:

https://usfirst.collab.net/gerrit/gitweb?p=allwpilib.git;a=blob;f=wpilibj/wpilibJavaDevices/src/main/java/edu/wpi/first/wpilibj/Gyro.java;h=ea1e1cc301c71243e091206312fa281fb2f5e5 87;hb=HEAD

The setDeadband is not made public, I don't know why. we just copied the code as a newGyro.java class in our project and made it public. It seems to work fine so far. You will lose a little accuracy with a larger deadband, but if it is small, it most likely won't be a problem.

Hope this helps,

Lennie
Reply With Quote