theonlydvr
19-01-2014, 07:11
Hello everyone,
I am a programmer for team 4338 in Israel and have encountered problems while using the gyro supplied by First. On testing the gyro in operator control using a simple program which printed out the current angle, the printed values began at a negative number near zero and continued slowly increasing minimally only reaching 1 degree after a minute. The robot, however was turning frequently and definitely more than 1 degree.
This was our code for operator control:
public void operatorControl()
{
chassis.setSafetyEnabled(false);
gyro.reset();
chassis.setInvertedMotor(RobotDrive.MotorType.kRea rLeft, true);
chassis.setInvertedMotor(RobotDrive.MotorType.kRea rRight, true);
while (isOperatorControl() && isEnabled())
{
chassis.tankDrive(leftStick.getY(), rightStick.getY());
System.out.println("Angle: " + gyro.getAngle());
Timer.delay(0.01);
}
}
chassis is our RobotDrive object
rightStick is our right joystick object and vice verse for leftStick
Thanks for any help
I am a programmer for team 4338 in Israel and have encountered problems while using the gyro supplied by First. On testing the gyro in operator control using a simple program which printed out the current angle, the printed values began at a negative number near zero and continued slowly increasing minimally only reaching 1 degree after a minute. The robot, however was turning frequently and definitely more than 1 degree.
This was our code for operator control:
public void operatorControl()
{
chassis.setSafetyEnabled(false);
gyro.reset();
chassis.setInvertedMotor(RobotDrive.MotorType.kRea rLeft, true);
chassis.setInvertedMotor(RobotDrive.MotorType.kRea rRight, true);
while (isOperatorControl() && isEnabled())
{
chassis.tankDrive(leftStick.getY(), rightStick.getY());
System.out.println("Angle: " + gyro.getAngle());
Timer.delay(0.01);
}
}
chassis is our RobotDrive object
rightStick is our right joystick object and vice verse for leftStick
Thanks for any help