EKF: use uint64_t cast for XeY to avoid float casting of variables

The default type for XeY is float
This commit is contained in:
ChristophTobler
2017-11-08 11:40:26 +01:00
parent bba3f70a0e
commit e388e59f32
8 changed files with 26 additions and 27 deletions
+2 -2
View File
@@ -799,7 +799,7 @@ void Ekf::fixCovarianceErrors()
// if we have failed for 7 seconds continuously, reset the accel bias covariances to fix bad conditioning of
// the covariance matrix but preserve the variances (diagonals) to allow bias learning to continue
if (_time_last_imu - _time_acc_bias_check > 7E6) {
if (_time_last_imu - _time_acc_bias_check > (uint64_t)7e6) {
float varX = P[13][13];
float varY = P[14][14];
float varZ = P[15][15];
@@ -870,7 +870,7 @@ void Ekf::resetWindCovariance()
zeroRows(P,22,23);
zeroCols(P,22,23);
if (_tas_data_ready && (_imu_sample_delayed.time_us - _airspeed_sample_delayed.time_us < 5e5)) {
if (_tas_data_ready && (_imu_sample_delayed.time_us - _airspeed_sample_delayed.time_us < (uint64_t)5e5)) {
// Use airspeed and zer sideslip assumption to set initial covariance values for wind states
// calculate the wind speed and bearing