View Single Post
  #1   Spotlight this post!  
Unread 19-01-2014, 07:11
theonlydvr theonlydvr is offline
Registered User
FRC #4338
 
Join Date: Jan 2014
Location: United States
Posts: 12
theonlydvr is an unknown quantity at this point
Gyro Returning Values Not According to Actual Robot Movement [Answered]

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:

Code:
public void operatorControl()
{
    chassis.setSafetyEnabled(false);
    gyro.reset();
    chassis.setInvertedMotor(RobotDrive.MotorType.kRearLeft, true);
    chassis.setInvertedMotor(RobotDrive.MotorType.kRearRight, 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

Last edited by theonlydvr : 19-01-2014 at 10:09. Reason: Answered
Reply With Quote