Detecting rotation with the gyroscope
We've had some raw data from the gyroscope, but to use it more effectively, we'll need to perform two operations, calibrating the gyroscope, and then integrating it, as shown in the following diagram:
Figure 16.4 shows the data flow, and we will look closer at the concepts later in this section. The first operation is shown at the top, which shows the gyroscope data going through an offset calibration to take out errors. This gives us a calibrated gyroscope, with a rate of change in degrees per second (per axis)—shown by the arrow around the circle. The gyroscope makes a relative measurement.
The lower part of the diagram is the second operation, combining delta time with the calibrated gyroscope (gyro). We need to integrate that to find an absolute measurement. An integrator multiplies an input value by delta time and adds this to a previous result....