Go to Post Imagination is important, but try not to use it as a substitute for actual information. - Alan Anderson [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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