drivers/imu: ensure timestamp_sample adjustment isn't done as float

- larger HRT timestamps can't be represented exactly when cast to float
This commit is contained in:
Daniel Agar
2021-10-04 18:34:30 -04:00
parent 6b8840a01b
commit dc1b423721
11 changed files with 11 additions and 11 deletions
@@ -220,7 +220,7 @@ void BMI088_Accelerometer::RunImpl()
// tolerate minor jitter, leave sample to next iteration if behind by only 1
if (samples == _fifo_samples + 1) {
timestamp_sample -= FIFO_SAMPLE_DT;
timestamp_sample -= static_cast<int>(FIFO_SAMPLE_DT);
samples--;
}
@@ -262,7 +262,7 @@ void ICM20608G::RunImpl()
// tolerate minor jitter, leave sample to next iteration if behind by only 1
if (samples == _fifo_gyro_samples + 1) {
timestamp_sample -= FIFO_SAMPLE_DT;
timestamp_sample -= static_cast<int>(FIFO_SAMPLE_DT);
samples--;
}
@@ -262,7 +262,7 @@ void ICM20689::RunImpl()
// tolerate minor jitter, leave sample to next iteration if behind by only 1
if (samples == _fifo_gyro_samples + 1) {
timestamp_sample -= FIFO_SAMPLE_DT;
timestamp_sample -= static_cast<int>(FIFO_SAMPLE_DT);
samples--;
}
@@ -225,7 +225,7 @@ void ICM40609D::RunImpl()
// tolerate minor jitter, leave sample to next iteration if behind by only 1
if (samples == _fifo_gyro_samples + 1) {
timestamp_sample -= FIFO_SAMPLE_DT;
timestamp_sample -= static_cast<int>(FIFO_SAMPLE_DT);
samples--;
}
@@ -226,7 +226,7 @@ void ICM42605::RunImpl()
// tolerate minor jitter, leave sample to next iteration if behind by only 1
if (samples == _fifo_gyro_samples + 1) {
timestamp_sample -= FIFO_SAMPLE_DT;
timestamp_sample -= static_cast<int>(FIFO_SAMPLE_DT);
samples--;
}
@@ -226,7 +226,7 @@ void ICM42688P::RunImpl()
// tolerate minor jitter, leave sample to next iteration if behind by only 1
if (samples == _fifo_gyro_samples + 1) {
timestamp_sample -= FIFO_SAMPLE_DT;
timestamp_sample -= static_cast<int>(FIFO_SAMPLE_DT);
samples--;
}
@@ -231,7 +231,7 @@ void MPU6000::RunImpl()
// tolerate minor jitter, leave sample to next iteration if behind by only 1
if (samples == _fifo_gyro_samples + 1) {
timestamp_sample -= FIFO_SAMPLE_DT;
timestamp_sample -= static_cast<int>(FIFO_SAMPLE_DT);
samples--;
}
@@ -263,7 +263,7 @@ void MPU6500::RunImpl()
// tolerate minor jitter, leave sample to next iteration if behind by only 1
if (samples == _fifo_gyro_samples + 1) {
timestamp_sample -= FIFO_SAMPLE_DT;
timestamp_sample -= static_cast<int>(FIFO_SAMPLE_DT);
samples--;
}
@@ -298,7 +298,7 @@ void MPU9250::RunImpl()
// tolerate minor jitter, leave sample to next iteration if behind by only 1
if (samples == _fifo_gyro_samples + 1) {
timestamp_sample -= FIFO_SAMPLE_DT;
timestamp_sample -= static_cast<int>(FIFO_SAMPLE_DT);
samples--;
}
@@ -231,7 +231,7 @@ void MPU9250_I2C::RunImpl()
// tolerate minor jitter, leave sample to next iteration if behind by only 1
if (samples == _fifo_gyro_samples + 1) {
timestamp_sample -= FIFO_SAMPLE_DT;
timestamp_sample -= static_cast<int>(FIFO_SAMPLE_DT);
samples--;
}
+1 -1
View File
@@ -189,7 +189,7 @@ void LSM9DS1::RunImpl()
} else {
// tolerate minor jitter, leave sample to next iteration if behind by only 1
if (samples == _fifo_gyro_samples + 1) {
timestamp_sample -= FIFO_SAMPLE_DT;
timestamp_sample -= static_cast<int>(FIFO_SAMPLE_DT);
samples--;
}