|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Analog Gyro .getAngle() function occasionally giving massive random values
We're working in java, and we're running into an issue with our gyro. Occasionally we get large position spikes from the .getAngle() function. Not sure why. We're using the gyro in between threads, could it be an issue with the .getAngle() not being thread safe? I noticed that we don't (I think) get spikes in the main thread that the roborio runs by default, we only get spikes in other threads. It's been really annoying to debug because it only happens like once a minute or so.
I posted to Programming rather than to Java to see if this was an issue not just specific to java. I also can post code if needed, but for the most part it's fairly straight forward code. I was wondering if anyone has seen anything similar, or knows about things like this. Thanks for any help in advance. |
|
#2
|
||||
|
||||
|
Re: Analog Gyro .getAngle() function occasionally giving massive random values
Look at your electrical connections. Analog Gyros will give some crazy numbers if they don't have a good connection.
I might be wrong here, but when you have no radial velocity, the analog gyro should output 2.5V, then increase or decrease depending on which way it's rotated. If the connection isn't good, the controller won't see 2.5V and will give you widely varying numbers like what you're seeing. Last edited by RyanN : 03-03-2016 at 20:42. |
|
#3
|
||||
|
||||
|
Re: Analog Gyro .getAngle() function occasionally giving massive random values
Quote:
|
|
#4
|
||||
|
||||
|
Re: Analog Gyro .getAngle() function occasionally giving massive random values
Quote:
|
|
#5
|
|||
|
|||
|
Re: Analog Gyro .getAngle() function occasionally giving massive random values
Quote:
|
|
#6
|
||||
|
||||
|
Re: Analog Gyro .getAngle() function occasionally giving massive random values
Quote:
|
|
#7
|
|||
|
|||
|
Re: Analog Gyro .getAngle() function occasionally giving massive random values
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|