Go to Post And THAT is why they have safety manuals. - Eria4044 [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 30-01-2011, 11:31
wdell wdell is offline
Registered User
AKA: William Dell
FRC #3999 (Shadetree Mechanics)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Killeen, Texas
Posts: 55
wdell has a spectacular aura aboutwdell has a spectacular aura about
Need help with gyros

I'm getting some strange results when trying to read my gyroscope. As it sits there the gyro seems to accumulate angle: it will slowly count upwards, starting at zero and gradually drifting upwards into positive values. For the life of me I can't figure out why, with the robot sitting dead still, the gyro reading does not stay at zero. Anyone else have this problem?

Gyro test loop:
Code:
        // gyro test
        while (this.isDisabled()) {
        station.toLCDLine(3, "Gyro Test");
        double sensitivity = 0.000;
        //spinGyro.setSensitivity(sensitivity);
        String msg = "Sensitivity " + sensitivity;
        station.toLCDLine(4, msg);
        msg = "Heading " + getCurrentHeading();
        station.toLCDLine(5, msg)
Heading code, changes headings to plus or minus 180 degrees:
Code:
    public double getCurrentHeading() {
        double current = spinGyro.getAngle()%360;
        if (current > 180) {
            current = -(current - 360);
        }
        return current;
    }
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 10:45.

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