Quote:
Originally Posted by pblankenbaker
Our team used the ITG3200 last season. It was a challenge to work with due to the following:
- We typically wanted our measurements in degrees and the sensor reports readings in degrees/second (we ended up using a thread to accumulate values reported by the sensor).
- The sensor did not tend to report zero when sitting idle. This error (bias) needed to be determined at start up while the robot was stationary and then taken into consideration with each reading.
In any case, here is the code we came up with that worked reasonably well for the ITG-3200 when we wanted to detect if the robot was tipping or needed to perform an operation like "make a 90 degree turn":
https://github.com/frc868/2015-FRC-R...roItg3200.java
As far as the answer to your original question, I think you can use the following to convert the raw 16 bit values to degrees/second (not degrees):
Code:
rawAxisValue / 14.375 - axisBias
Where rawAxisValue is the 16 bit signed integer (short) read from the sensor for your z axis and axisBias is the average error reported by the axis when the robot is stationary (when you wish that the sensor reported 0 but discover it does not).
Good luck and I hope that helps.
|
Where do I get this "RotationTracker" interface that your code uses? I can't seem to find it or its called something else in the FRC lib jars?