added linux fixes
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user