|
Gyro problem, please help!
Our gyro is not working properly. Gyro is connected to the analog breakout port 1 and signal is going to the output which is closer to the rate sign ( its not the temperature). We are running it through java.
when we enable the teleoperated mod it resets itself but its drifting the angle even when its stable. i already checked the sensitivity and its just multiplying with other numbers so when it turns it gives lower or higher numbers.At 0.007 i can get the degree for a while (around 10 sec)but it keep increasing even when i'm moving it. here is my simple code for it ...
package edu.wpi.first.wpilibj.templates;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.Gyro;
import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Timer;
public class RobotTemplate extends SimpleRobot {
private Gyro gyro = new Gyro(1);
public void autonomous() {
}
public void operatorControl() {
double number1 = 0;
gyro.reset();
while (isEnabled() && isOperatorControl()) {
Timer.delay(0.05);
double number = gyro.getAngle();
System.out.println(number);
}
}
public void test() {
}
}
thanks for your helps.
|