Go to Post One button, ten copyrights, you do the math. - StephLee [more]
Home
Go Back   Chief Delphi > Technical > Programming
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 31-01-2014, 23:27
owltheory owltheory is offline
Registered User
FRC #2172
 
Join Date: Jan 2014
Location: Ohio
Posts: 6
owltheory is an unknown quantity at this point
gyro.getAngle() only outputs 0.0

Greetings all,

With two weeks left, I hope everyone's robots are coming along well.

We're in the process of getting our sensors to work in Java, but we seem to have hit a wall when it comes to the gyro. As the title suggests, when we call the getAngle() method, all we consistently get is 0.0. We've tripled checked wiring based on this document, and we've tried multiple analog breakouts and multiple gyro sensors. We know the analog breakout works because we've gotten a rangefinder sensor to work off of the same unit. Based on this, I've concluded it has something to do with the programming. We are using java, the 2014 library (haven't checked for an update yet, but I don't think that would be the issue), and the cRio is running the 2014 image.

We're out of ideas and hoping you can help.

I attached the relevant snippets of code, but I can attach the whole class if necessary. We're planning to use the gyro for direction-sensitive mecanum drive.

Quote:
Gyro gyro;

public void robotInit()
{
...
gyro = new Gyro(1); // We've checked the port number
...
}

public void teleopInit()
{
gyro.reset();
}

public void teleopPeriodic()
{
System.out.println(gyro.getAngle());
}
Which yields a continuous stream of "0.0\n", regardless of how the gyro is moved.

We appreciate any help you can offer, and let me know if you need more information.
 


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 22:02.

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