added linux fixes

This commit is contained in:
toni
2020-01-28 11:33:17 +01:00
parent 464e3c3614
commit 46aaef2b69
12 changed files with 28 additions and 23 deletions

View File

@@ -21,7 +21,7 @@ float Kalman::predictAndUpdate(const Timestamp timestamp, const float measurment
Eigen::Map<Eigen::Matrix<float, 2, 2>> P(this->P);
// init kalman filter
if (isnan(lastTimestamp))
if (std::isnan(lastTimestamp))
{
P << 10, 0,
0, 10; // Initial Uncertainty
@@ -30,7 +30,7 @@ float Kalman::predictAndUpdate(const Timestamp timestamp, const float measurment
0;
}
const float dt = isnan(lastTimestamp) ? 1 : timestamp.sec() - lastTimestamp;
const float dt = std::isnan(lastTimestamp) ? 1 : timestamp.sec() - lastTimestamp;
lastTimestamp = timestamp.sec();
Eigen::Matrix<float, 1, 2> H; // Measurement function
@@ -62,7 +62,7 @@ float Kalman::predictAndUpdate(const Timestamp timestamp, const float measurment
KalmanPrediction Kalman::predict(const Timestamp timestamp)
{
if (isnan(lastTimestamp))
if (std::isnan(lastTimestamp))
{
// Kalman has no data => nothing to predict
return KalmanPrediction{ NAN, NAN };