diff --git a/src/estimators/altitude/alt_generic.cpp b/src/estimators/altitude/alt_generic.cpp index 80fae06..ab3b6b9 100644 --- a/src/estimators/altitude/alt_generic.cpp +++ b/src/estimators/altitude/alt_generic.cpp @@ -329,7 +329,7 @@ void AltGeneric::timerUpdate(const ros::TimerEvent &event) { } double dt = (event.current_real - event.last_real).toSec(); - if (dt <= 0.0) { + if (dt <= 0.0 || dt > 1.0) { return; } diff --git a/src/estimators/heading/hdg_generic.cpp b/src/estimators/heading/hdg_generic.cpp index cedb4ce..79d0ecd 100644 --- a/src/estimators/heading/hdg_generic.cpp +++ b/src/estimators/heading/hdg_generic.cpp @@ -302,7 +302,7 @@ void HdgGeneric::timerUpdate(const ros::TimerEvent &event) { } double dt = (event.current_real - event.last_real).toSec(); - if (dt <= 0.0) { + if (dt <= 0.0 || dt > 1.0) { return; } diff --git a/src/estimators/lateral/lat_generic.cpp b/src/estimators/lateral/lat_generic.cpp index 7ece255..a6ae1c4 100644 --- a/src/estimators/lateral/lat_generic.cpp +++ b/src/estimators/lateral/lat_generic.cpp @@ -340,7 +340,7 @@ void LatGeneric::timerUpdate(const ros::TimerEvent &event) { // obtain dt for state prediction double dt = (event.current_real - event.last_real).toSec(); - if (dt <= 0.0) { // sometimes the timer ticks twice simultaneously in simulation - we ignore the second tick + if (dt <= 0.0 || dt > 1.0) { // sometimes the timer ticks twice simultaneously in simulation - we ignore the second tick, in case of stopping and starting the timer, the last_real is 0 return; }