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.