A computer implemented method performed by one or more processors of a mobile device containing a calibration database, comprising: receiving angular rate and temperature measurements from, respectively, an angular rate sensor which comprises a three-axis gyro, the three axes being axes of the local coordinate frame, and a temperature sensor onboard the mobile device; assuming that the device is stationary per axis when the variance for that axis calculated from window averaged angular rate measurements is less than a threshold; when the device is assumed to be stationary per axis, performing the following: (a) a calculation of an angular rate bias ( ω) for that axis based on a window average of the latest samples of the received angular rate sensor measurements for that axis; (b) a calculation of a current temperature for that axis based on a window average of the latest angular rate temperature samples corresponding to the latest samples of the received angular rate sensor measurements for that axis; and (c) a storage, in the calibration database, of a calibration point ( ω, T), the calibration point comprising the calculated angular bias and the current temperature; subsequently retrieving a plurality of previously stored calibration points from the calibration database and (d) computing a temperature slope per axis and temperature bias offset per axis based on the plurality of previously stored calibration points, (e) building a temperature slope vector having the three per axis temperature slope values as components and building a temperature bias offset vector having the three per axis temperature bias offset value as components, inputting the temperature slope vector and the temperature bias offset vector into a state estimator, wherein these quantities are used to compute an estimated attitude of the device. receiving angular rate and temperature measurements from, respectively, an angular rate sensor which comprises a three-axis gyro, the three axes being axes of the local coordinate frame, and a temperature sensor onboard the mobile device; assuming that the device is stationary per axis when the variance for that axis calculated from window averaged angular rate measurements is less than a threshold; when the device is assumed to be stationary per axis, performing the following: (a) a calculation of an angular rate bias ( ω) for that axis based on a window average of the latest samples of the received angular rate sensor measurements for that axis; (b) a calculation of a current temperature for that axis based on a window average of the latest angular rate temperature samples corresponding to the latest samples of the received angular rate sensor measurements for that axis; and (c) a storage, in the calibration database, of a calibration point ( ω, T), the calibration point comprising the calculated angular bias and the current temperature; subsequently retrieving a plurality of previously stored calibration points from the calibration database and (d) computing a temperature slope per axis and temperature bias offset per axis based on the plurality of previously stored calibration points, (e) building a temperature slope vector having the three per axis temperature slope values as components and building a temperature bias offset vector having the three per axis temperature bias offset value as components, inputting the temperature slope vector and the temperature bias offset vector into a state estimator, wherein these quantities are used to compute an estimated attitude of the device. (a) a calculation of an angular rate bias ( ω) for that axis based on a window average of the latest samples of the received angular rate sensor measurements for that axis; (b) a calculation of a current temperature for that axis based on a window average of the latest angular rate temperature samples corresponding to the latest samples of the received angular rate sensor measurements for that axis; and (c) a storage, in the calibration database, of a calibration point ( ω, T), the calibration point comprising the calculated angular bias and the current temperature; subsequently retrieving a plurality of previously stored calibration points from the calibration database and (d) computing a temperature slope per axis and temperature bias offset per axis based on the plurality of previously stored calibration points, (e) building a temperature slope vector having the three per axis temperature slope values as components and building a temperature bias offset vector having the three per axis temperature bias offset value as components, inputting the temperature slope vector and the temperature bias offset vector into a state estimator, wherein these quantities are used to compute an estimated attitude of the device.