View Single Post
  #1   Spotlight this post!  
Unread 12-02-2014, 01:50
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 429
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Gyro reset() troubles

We were testing out some autonomous code over the weekend which utilized the gyro for turning. We were noticing that about 50% of the time our code didn't seem to be working. After placing in some debug print statements (see below) we confirmed the source of the problem.
The value printed before and after the reset are quite often the same non-zero number. About 50% of the time. This is quite repeatable on our hardware. I've tried multiple gyro sensors with similar results.

Code:
public void resetGyro() {
    double before = getGyroAngle();
    gyro.reset();
    System.out.println("Gyro Before: " + before + " After: " + getGyroAngle());
}
Other than it not resetting reliably, the gyro appears to be working as expected.

I was wondering if any one else was experiencing this behavior. It looks like the gyro.reset() call ultimately just boils down to the following:
Code:
NiFpga.writeU32(m_DeviceHandle, kReset_Addresses[m_SystemIndex], 1, status);
I know there were changes made in the FPGA, was a bug introduced?


We have a workaround, but knowing others are seeing this problem would at least restore sanity to my world.
__________________
http://team2168.org
Reply With Quote